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.
10 11 12 13 14 15 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 10 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.
8 9 10 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 8 def thread @thread end |
#zero_server ⇒ Object
Returns the value of attribute zero_server.
8 9 10 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 8 def zero_server @zero_server end |
Instance Method Details
#running? ⇒ Boolean
24 25 26 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 24 def running? @zero_server.running? end |
#start_chef_zero_server ⇒ Object
17 18 19 20 21 22 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 17 def start_chef_zero_server unless @thread @thread = @zero_server.start_background end @thread end |
#url ⇒ Object
28 29 30 |
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 28 def url @zero_server.url end |