Class: Roast::Workflow::ConfigurationParser
- Inherits:
-
Object
- Object
- Roast::Workflow::ConfigurationParser
- Defined in:
- lib/roast/workflow/configuration_parser.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#current_workflow ⇒ Object
readonly
Returns the value of attribute current_workflow.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #begin! ⇒ Object
-
#initialize(workflow_path, files = [], options = {}) ⇒ ConfigurationParser
constructor
A new instance of ConfigurationParser.
Constructor Details
#initialize(workflow_path, files = [], options = {}) ⇒ ConfigurationParser
Returns a new instance of ConfigurationParser.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/roast/workflow/configuration_parser.rb', line 10 def initialize(workflow_path, files = [], = {}) @configuration = Configuration.new(workflow_path, ) = @files = files # Initialize workflow dependencies initializer = WorkflowInitializer.new(@configuration) initializer.setup @workflow_runner = WorkflowRunner.new(@configuration, ) end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/roast/workflow/configuration_parser.rb', line 6 def configuration @configuration end |
#current_workflow ⇒ Object (readonly)
Returns the value of attribute current_workflow.
6 7 8 |
# File 'lib/roast/workflow/configuration_parser.rb', line 6 def current_workflow @current_workflow end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
6 7 8 |
# File 'lib/roast/workflow/configuration_parser.rb', line 6 def files @files end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/roast/workflow/configuration_parser.rb', line 6 def end |
Instance Method Details
#begin! ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/roast/workflow/configuration_parser.rb', line 22 def begin! start_time = Time.now $stderr.puts "Starting workflow..." $stderr.puts "Workflow: #{configuration.workflow_path}" $stderr.puts "Options: #{options}" ActiveSupport::Notifications.instrument("roast.workflow.start", { workflow_path: configuration.workflow_path, options: , name: configuration.basename, }) if files.any? @workflow_runner.run_for_files(files) elsif configuration.has_target? @workflow_runner.run_for_targets else @workflow_runner.run_targetless end rescue Roast::Errors::ExitEarly $stderr.puts "Exiting workflow early." ensure execution_time = Time.now - start_time ActiveSupport::Notifications.instrument("roast.workflow.complete", { workflow_path: configuration.workflow_path, success: !$ERROR_INFO, execution_time: execution_time, }) end |