Class: HealthInspector::Context
- Inherits:
-
Struct
- Object
- Struct
- HealthInspector::Context
- Defined in:
- lib/health_inspector/context.rb
Instance Attribute Summary collapse
-
#config_path ⇒ Object
Returns the value of attribute config_path.
-
#no_color ⇒ Object
Returns the value of attribute no_color.
-
#quiet_success ⇒ Object
Returns the value of attribute quiet_success.
-
#repo_path ⇒ Object
Returns the value of attribute repo_path.
Instance Method Summary collapse
Instance Attribute Details
#config_path ⇒ Object
Returns the value of attribute config_path
4 5 6 |
# File 'lib/health_inspector/context.rb', line 4 def config_path @config_path end |
#no_color ⇒ Object
Returns the value of attribute no_color.
6 7 8 |
# File 'lib/health_inspector/context.rb', line 6 def no_color @no_color end |
#quiet_success ⇒ Object
Returns the value of attribute quiet_success.
6 7 8 |
# File 'lib/health_inspector/context.rb', line 6 def quiet_success @quiet_success end |
#repo_path ⇒ Object
Returns the value of attribute repo_path
4 5 6 |
# File 'lib/health_inspector/context.rb', line 4 def repo_path @repo_path end |
Instance Method Details
#chef_rest ⇒ Object
25 26 27 |
# File 'lib/health_inspector/context.rb', line 25 def chef_rest @chef_rest ||= Chef::REST.new( config[:chef_server_url], config[:node_name], config[:client_key] ) end |
#config ⇒ Object
12 13 14 |
# File 'lib/health_inspector/context.rb', line 12 def config @config ||= configure end |
#configure ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/health_inspector/context.rb', line 16 def configure begin Chef::Config.from_file(config_path) rescue LoadError Chef::Config.from_file("#{ENV['PWD']}/#{config_path}") end Chef::Config end |
#cookbook_path ⇒ Object
8 9 10 |
# File 'lib/health_inspector/context.rb', line 8 def cookbook_path Array( config.cookbook_path ) end |