Class: BuildKit::Runner::TaskRunner
- Inherits:
-
Object
- Object
- BuildKit::Runner::TaskRunner
- Defined in:
- lib/ios_build_kit/task_runner.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#outputs ⇒ Object
readonly
Returns the value of attribute outputs.
-
#preferences ⇒ Object
readonly
Returns the value of attribute preferences.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
-
#tasks ⇒ Object
readonly
Returns the value of attribute tasks.
Instance Method Summary collapse
- #has_completed_task?(task) ⇒ Boolean
-
#initialize(attributes = {}) ⇒ TaskRunner
constructor
A new instance of TaskRunner.
- #run_tasks! ⇒ Object
- #task_completed!(task, success_message, output) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ TaskRunner
Returns a new instance of TaskRunner.
11 12 13 14 15 16 17 18 |
# File 'lib/ios_build_kit/task_runner.rb', line 11 def initialize(attributes = {}) passed = hash_from_yaml attributes[:config_file] @config = TaskRunnerConfig.new(passed[:configuration]).freeze @preferences = TaskRunnerConfig.new (passed[:preferences]).freeze prepare_task_queue! passed[:tasks] @store = {} @outputs = {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/ios_build_kit/task_runner.rb', line 9 def config @config end |
#outputs ⇒ Object (readonly)
Returns the value of attribute outputs.
9 10 11 |
# File 'lib/ios_build_kit/task_runner.rb', line 9 def outputs @outputs end |
#preferences ⇒ Object (readonly)
Returns the value of attribute preferences.
9 10 11 |
# File 'lib/ios_build_kit/task_runner.rb', line 9 def preferences @preferences end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
9 10 11 |
# File 'lib/ios_build_kit/task_runner.rb', line 9 def store @store end |
#tasks ⇒ Object (readonly)
Returns the value of attribute tasks.
9 10 11 |
# File 'lib/ios_build_kit/task_runner.rb', line 9 def tasks @tasks end |
Instance Method Details
#has_completed_task?(task) ⇒ Boolean
33 34 35 |
# File 'lib/ios_build_kit/task_runner.rb', line 33 def has_completed_task? task @tasks[:completed].include? task end |
#run_tasks! ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ios_build_kit/task_runner.rb', line 20 def run_tasks! @tasks[:raw].each do |task_name, task_opts| if task_opts[:run] @tasks[:running] = task_name BuildKit::Utilities::Console.info_msg "Running Task: #{task_name}" BuildKit::Tasks.send task_name, self, task_opts[:options] else BuildKit::Utilities::Console.warning_msg "Skipping Task: #{task_name}" end end all_tasks_completed end |
#task_completed!(task, success_message, output) ⇒ Object
37 38 39 40 41 |
# File 'lib/ios_build_kit/task_runner.rb', line 37 def task_completed! task, , output @tasks[:completed] << task BuildKit::Utilities::Console.success_msg @outputs[task] = output end |