RubyMine 2017.1 Help

Chef Support

On this page:

Prerequisites

Basics

Following the main concepts of Chef, the Chef Integration plugin introduces cookbooks, recipes, resources and attributes. The plugin provides marking and detection for a cookbook and code insight for the resources and their attributes.

If a certain directory contains a sub-directory named recipes, with the Ruby file inside, such directory is recognized as a cookbook. RubyMine suggests to mark such a directory with /help/img/idea/2017.1/chef_cookbook_icon.png icon.

Since a directory is marked as a cookbook, code insight is available for any Ruby file inside the cookbook folder.

Marking directories as cookbooks

RubyMine provides the following ways of marking a directory as a cookbook:

  • RubyMine recognizes a cookbook and suggests to configure it. To see the suggestion to configure, start typing into a recipie file:
    /help/img/idea/2017.1/chef_configure_cookbooks.png
  • Command Mark Directory As on the context menu of the Project tool window:
    /help/img/idea/2017.1/chef_mark_directory_as.png
  • The Project Structure page of the Settings/Preferences dialog:
    /help/img/idea/2017.1/chef_mark_directory_as_project_structure.png

You can always cancel marking, using the command Unmark directory ....

Coding assistance

  • It is possible to invoke code completion for any Chef resource:
    /help/img/idea/2017.1/chef_code_completion.png
  • RubyMine enables navigation to a resource declaration in the Chef library:
    /help/img/idea/2017.1/chef_resources.png
  • Own attributes of a resource, and the inherited ones are also available inside the resource code block:
    /help/img/idea/2017.1/chef_attributes.png
  • Whenever possible, RubyMine suggests attribute arguments, such as allowed actions for the action attribute; actions for the notifies and subscribes; all boolean arguments, and many more.

Running the Bundler

On the UNIX-like computers, RubyMine suggests to run the Bundler with the sudo privileges, if SDK so requires. For example, Chef DK by default, requires installing gems under sudo:

/help/img/idea/2017.1/rm_chef_sudo.png

See Also

Last modified: 18 July 2017