Module: ChefDK::Helpers
- Included in:
- CLI, Command::Base, Command::Verify, ComponentTest, CookbookProfiler::Git, PolicyfileServices::Install, PolicyfileServices::Push, PolicyfileServices::UpdateAttributes
- Defined in:
- lib/chef-dk/helpers.rb
Instance Method Summary collapse
- #err(message) ⇒ Object
- #msg(message) ⇒ Object
- #omnibus_apps_dir ⇒ Object
- #omnibus_bin_dir ⇒ Object
- #omnibus_chefdk_location ⇒ Object
- #omnibus_embedded_bin_dir ⇒ Object
-
#omnibus_install? ⇒ Boolean
Locates the omnibus directories.
- #omnibus_root ⇒ Object
- #stderr ⇒ Object
- #stdout ⇒ Object
-
#system_command(*command_args) ⇒ Object
Runs given commands using mixlib-shellout.
Instance Method Details
#err(message) ⇒ Object
33 34 35 |
# File 'lib/chef-dk/helpers.rb', line 33 def err() stderr.print("#{}\n") end |
#msg(message) ⇒ Object
37 38 39 |
# File 'lib/chef-dk/helpers.rb', line 37 def msg() stdout.print("#{}\n") end |
#omnibus_apps_dir ⇒ Object
61 62 63 |
# File 'lib/chef-dk/helpers.rb', line 61 def omnibus_apps_dir @ominbus_apps_dir ||= (omnibus_root, "embedded", "apps") end |
#omnibus_bin_dir ⇒ Object
65 66 67 |
# File 'lib/chef-dk/helpers.rb', line 65 def omnibus_bin_dir @omnibus_bin_dir ||= (omnibus_root, "bin") end |
#omnibus_chefdk_location ⇒ Object
73 74 75 |
# File 'lib/chef-dk/helpers.rb', line 73 def omnibus_chefdk_location @omnibus_chefdk_location ||= File.('embedded/apps/chef-dk', expected_omnibus_root) end |
#omnibus_embedded_bin_dir ⇒ Object
69 70 71 |
# File 'lib/chef-dk/helpers.rb', line 69 def @omnibus_embedded_bin_dir ||= (omnibus_root, "embedded", "bin") end |
#omnibus_install? ⇒ Boolean
Locates the omnibus directories
53 54 55 |
# File 'lib/chef-dk/helpers.rb', line 53 def omnibus_install? File.exist?(omnibus_chefdk_location) end |
#omnibus_root ⇒ Object
57 58 59 |
# File 'lib/chef-dk/helpers.rb', line 57 def omnibus_root @omnibus_root ||= (expected_omnibus_root) end |
#stderr ⇒ Object
45 46 47 |
# File 'lib/chef-dk/helpers.rb', line 45 def stderr $stderr end |
#stdout ⇒ Object
41 42 43 |
# File 'lib/chef-dk/helpers.rb', line 41 def stdout $stdout end |
#system_command(*command_args) ⇒ Object
Runs given commands using mixlib-shellout
27 28 29 30 31 |
# File 'lib/chef-dk/helpers.rb', line 27 def system_command(*command_args) cmd = Mixlib::ShellOut.new(*command_args) cmd.run_command cmd end |