Class: Fhcap::Tasks::Chef::ChefZeroServer

Inherits:
Object
  • Object
show all
Defined in:
lib/fhcap/tasks/chef/chef_zero_server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options={})
  host = options[:host] || '127.0.0.1'
  port = options[:port] || 7799
  log_level = options[:'log-level'] || 'info'
  @zero_server = ChefZero::Server.new(port: port, host: host, log_level: log_level)
end

Instance Attribute Details

#threadObject

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_serverObject

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

Returns:

  • (Boolean)


24
25
26
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 24

def running?
  @zero_server.running?
end

#start_chef_zero_serverObject



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

#urlObject



28
29
30
# File 'lib/fhcap/tasks/chef/chef_zero_server.rb', line 28

def url
  @zero_server.url
end