Class: Spectifly::Task
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Spectifly::Task
- Defined in:
- lib/spectifly/tasks.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
Instance Method Summary collapse
- #configure! ⇒ Object
-
#initialize(task_name, *args, &block) ⇒ Task
constructor
A new instance of Task.
Constructor Details
#initialize(task_name, *args, &block) ⇒ Task
Returns a new instance of Task.
16 17 18 19 20 21 |
# File 'lib/spectifly/tasks.rb', line 16 def initialize(task_name, *args, &block) configure! task task_name, *args do |task_name, task_args| block.call(configuration, task_args) if block end end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
8 9 10 |
# File 'lib/spectifly/tasks.rb', line 8 def configuration @configuration end |
Instance Method Details
#configure! ⇒ Object
10 11 12 13 14 |
# File 'lib/spectifly/tasks.rb', line 10 def configure! config_path = File.join(Rake.original_dir, 'config', 'spectifly.yml') config_hash = File.exist?(config_path) ? YAML.load_file(config_path) : {} @configuration = Spectifly::Configuration.new(config_hash) end |