Module: ChefCLI::Configurable
- Included in:
- ChefCLI::Command::CleanPolicyCookbooks, ChefCLI::Command::CleanPolicyRevisions, ChefCLI::Command::DeletePolicy, ChefCLI::Command::DeletePolicyGroup, ChefCLI::Command::Diff, ChefCLI::Command::Export, ChefCLI::Command::GeneratorCommands::Base, ChefCLI::Command::Install, ChefCLI::Command::Push, ChefCLI::Command::PushArchive, ChefCLI::Command::ShowPolicy, ChefCLI::Command::Undelete, ChefCLI::Command::Update
- Defined in:
- lib/chef-cli/configurable.rb
Instance Method Summary collapse
- #chef_config ⇒ Object
- #chefcli_config ⇒ Object
- #config_loader ⇒ Object
- #generator_config ⇒ Object
- #knife_config ⇒ Object
- #reset_config! ⇒ Object
Instance Method Details
#chef_config ⇒ Object
47 48 49 50 51 52 |
# File 'lib/chef-cli/configurable.rb', line 47 def chef_config return @chef_config if @chef_config config_loader.load @chef_config = Chef::Config end |
#chefcli_config ⇒ Object
54 55 56 |
# File 'lib/chef-cli/configurable.rb', line 54 def chefcli_config chef_config.chefcli end |
#config_loader ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/chef-cli/configurable.rb', line 58 def config_loader if !config[:profile].nil? @config_loader ||= Chef::WorkstationConfigLoader.new(config[:config_file], profile: config[:profile]) else @config_loader ||= Chef::WorkstationConfigLoader.new(config[:config_file]) end end |
#generator_config ⇒ Object
66 67 68 |
# File 'lib/chef-cli/configurable.rb', line 66 def generator_config chefcli_config.generator end |
#knife_config ⇒ Object
70 71 72 |
# File 'lib/chef-cli/configurable.rb', line 70 def knife_config chef_config.knife end |
#reset_config! ⇒ Object
74 75 76 77 |
# File 'lib/chef-cli/configurable.rb', line 74 def reset_config! @chef_config = nil @config_loader = nil end |