Class: Perennial::Application::CommandEnv
- Includes:
- Loggable
- Defined in:
- lib/perennial/application.rb
Direct Known Subclasses
Class Method Summary collapse
-
.execute(blk, arguments) ⇒ Object
Executes a given block with given arguments in a specified environment.
Methods included from Loggable
Class Method Details
.execute(blk, arguments) ⇒ Object
Executes a given block with given arguments in a specified environment. Used to provide the logger functionality as well as the ability to do things such as easily write generators.
12 13 14 15 16 |
# File 'lib/perennial/application.rb', line 12 def self.execute(blk, arguments) klass = Class.new(self) klass.class_eval { define_method(:apply, &blk) } klass.new.apply(*arguments) end |