Class: Rohbau::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/rohbau/runtime.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRuntime

Returns a new instance of Runtime.



21
22
23
24
25
# File 'lib/rohbau/runtime.rb', line 21

def initialize
  on_boot
  initialize_plugins
  after_boot
end

Class Method Details

.pluginsObject



17
18
19
# File 'lib/rohbau/runtime.rb', line 17

def self.plugins
  @plugins ||= {}
end

.register(name, plugin_class) ⇒ Object



6
7
8
9
10
# File 'lib/rohbau/runtime.rb', line 6

def self.register(name, plugin_class)
  attr_reader name
  plugins[name] = plugin_class
  plugin_class.registered(self) if plugin_class.respond_to?(:registered)
end

.unregister(name) ⇒ Object



12
13
14
15
# File 'lib/rohbau/runtime.rb', line 12

def self.unregister(name)
  remove_method name
  plugins.delete name
end

Instance Method Details

#rootObject



32
33
34
# File 'lib/rohbau/runtime.rb', line 32

def root
  Pathname.new(Dir.pwd)
end

#terminateObject



27
28
29
30
# File 'lib/rohbau/runtime.rb', line 27

def terminate
  terminate_plugins
  after_termination
end