Class: Cloudruler::Runner
- Inherits:
-
Object
- Object
- Cloudruler::Runner
- Defined in:
- lib/cloudruler/runner.rb
Class Method Summary collapse
Instance Method Summary collapse
- #dump ⇒ Object
- #find_ruler(name) ⇒ Object
-
#initialize(template_file, options) ⇒ Runner
constructor
A new instance of Runner.
- #load_rulers ⇒ Object
Constructor Details
#initialize(template_file, options) ⇒ Runner
Returns a new instance of Runner.
14 15 16 17 18 |
# File 'lib/cloudruler/runner.rb', line 14 def initialize(template_file, ) @template = Template.new(self, File.(template_file)) @rulers_root = File.([:rulers_root] || 'rulers', File.join(Dir.pwd)) @rulers = [] end |
Class Method Details
.dump(template_file, options = {}) ⇒ Object
7 8 9 10 11 |
# File 'lib/cloudruler/runner.rb', line 7 def dump(template_file, = {}) runner = self.new(template_file, ) runner.load_rulers runner.dump end |
Instance Method Details
#dump ⇒ Object
27 28 29 |
# File 'lib/cloudruler/runner.rb', line 27 def dump @template.resolve.dump end |
#find_ruler(name) ⇒ Object
31 32 33 34 |
# File 'lib/cloudruler/runner.rb', line 31 def find_ruler(name) name = name.to_sym @rulers.find { |ruler| ruler.name == name } end |