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/api.rb,
lib/furnish/provisioner_group.rb,
lib/furnish/provisioners/dummy.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Provisioner Classes: Logger, Protocol, ProvisionerGroup, RunningSchedulerTestCase, Scheduler, SchedulerTestCase, TestCase, VM

Constant Summary collapse

VERSION =

The current version of Furnish.

"0.1.0"

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
# File 'lib/furnish.rb', line 18

def self.init(database_file)
  Palsy.change_db(database_file)
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.



28
29
30
31
# File 'lib/furnish.rb', line 28

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.



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

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.



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

def self.shutdown
  Palsy.instance.close
end