Class: Fhcap::Tasks::Chef::ChefZeroServer
- Inherits:
-
Object
- Object
- Fhcap::Tasks::Chef::ChefZeroServer
- Defined in:
- lib/fhcap/tasks/chef/chef_zero_server.rb
Instance Attribute Summary collapse
-
#thread ⇒ Object
Returns the value of attribute thread.
-
#zero_server ⇒ Object
Returns the value of attribute zero_server.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ ChefZeroServer
constructor
A new instance of ChefZeroServer.
- #running? ⇒ Boolean
- #start_chef_zero_server ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ChefZeroServer
Returns a new instance of ChefZeroServer.
11 12 13 14 15 16 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 11 def initialize(={}) host = [:host] || '127.0.0.1' port = [:port] || 7799 log_level = [:'log-level'] || 'info' @zero_server = ChefZero::Server.new(port: port, host: host, log_level: log_level) end |
Instance Attribute Details
#thread ⇒ Object
Returns the value of attribute thread.
9 10 11 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 9 def thread @thread end |
#zero_server ⇒ Object
Returns the value of attribute zero_server.
9 10 11 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 9 def zero_server @zero_server end |
Instance Method Details
#running? ⇒ Boolean
25 26 27 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 25 def running? @zero_server.running? end |
#start_chef_zero_server ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 18 def start_chef_zero_server unless @thread @thread = @zero_server.start_background end @thread end |
#url ⇒ Object
29 30 31 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 29 def url @zero_server.url end |