Module: Furnish

Defined in:
lib/furnish.rb,
lib/furnish/vm.rb,
lib/furnish/test.rb,
lib/furnish/logger.rb,
lib/furnish/version.rb,
lib/furnish/protocol.rb,
lib/furnish/scheduler.rb,
lib/furnish/provisioner.rb,
lib/furnish/provisioners/vm.rb,
lib/furnish/provisioners/api.rb,
lib/furnish/provisioner_group.rb,
lib/furnish/provisioners/dummy.rb,
lib/furnish/provisioners/dummy_vm.rb,
lib/furnish/provisioners/dummy_include.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Provisioner Classes: Logger, Protocol, ProvisionerGroup, RunningSchedulerTest, Scheduler, SchedulerTest, Test, VM

Constant Summary collapse

VERSION =

The current version of Furnish.

"0.1.3"

Class Method Summary collapse

Class Method Details

.init(database_file) ⇒ Object

Initialize Furnish. The path given is to a SQLite 3 database file that it will create for you.



18
19
20
21
# File 'lib/furnish.rb', line 18

def self.init(database_file)
  Palsy.change_db(database_file)
  @initialized = true
end

.initialized?Boolean

Has furnish been initialized?

Returns:

  • (Boolean)


26
27
28
# File 'lib/furnish.rb', line 26

def self.initialized?
  @initialized
end

.logger(io = $stderr, debug_level = 0) ⇒ Object

Access the logger (Furnish::Logger) or override it if it does not already exist. In the latter case, Furnish#logger= might be more reliable.

The default logger is pointed at standard error and has a debug level of 0.



36
37
38
39
# File 'lib/furnish.rb', line 36

def self.logger(io=$stderr, debug_level=0)
  return @logger if @logger
  @logger ||= Furnish::Logger.new(io, debug_level)
end

.logger=(logger) ⇒ Object

Set the logger. This is expected to have an interface akin to Furnish::Logger, it’s not the same as ruby’s Logger.



45
46
47
# File 'lib/furnish.rb', line 45

def self.logger=(logger)
  @logger = logger
end

.shutdownObject

Shutdown Furnish by closing its state file. Furnish::Scheduler objects and the threads it spawns must be stopped already, otherwise you’re going to have a bad day.



54
55
56
57
# File 'lib/furnish.rb', line 54

def self.shutdown
  @initialized = false
  Palsy.instance.close
end