Class: Katte
- Inherits:
-
Object
- Object
- Katte
- Defined in:
- lib/katte.rb,
lib/katte/config.rb,
lib/katte/driver.rb,
lib/katte/filter.rb,
lib/katte/recipe.rb,
lib/katte/runner.rb,
lib/katte/command.rb,
lib/katte/version.rb,
lib/katte/environment.rb,
lib/katte/thread_pool.rb
Defined Under Namespace
Modules: Node, Plugins, Recipe Classes: Command, Config, Driver, Environment, Filter, Runner, ThreadPool
Constant Summary collapse
- VERSION =
"0.0.1.3"
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #exec(recipe_path) ⇒ Object
-
#initialize(options = {}) ⇒ Katte
constructor
A new instance of Katte.
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Katte
Returns a new instance of Katte.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/katte.rb', line 17 def initialize( = {}) @env = Environment.new() @options = @config = Katte::Config.config @logger = if STDOUT.tty? Logger.new(STDOUT) else Logger.new(File.join(@config.log_root, 'katte.log'), 'daily') end @logger.level = Logger::WARN if config.mode == 'test' end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
13 14 15 |
# File 'lib/katte.rb', line 13 def config @config end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
12 13 14 |
# File 'lib/katte.rb', line 12 def env @env end |
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
14 15 16 |
# File 'lib/katte.rb', line 14 def logger @logger end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/katte.rb', line 15 def @options end |
Class Method Details
.app(params = {}) ⇒ Object
8 9 10 |
# File 'lib/katte.rb', line 8 def self.app(params = {}) @instance ||= new(params) end |
.new(params = {}) ⇒ Object
5 6 7 |
# File 'lib/katte.rb', line 5 def self.new(params = {}) @instance ||= super(params) end |
Instance Method Details
#exec(recipe_path) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/katte.rb', line 34 def exec(recipe_path) node_factory = config.factory || Katte::Recipe::NodeFactory.new node = node_factory.load(recipe_path) node.file_type.execute(node) end |