Class: AnnotateRb::Runner
- Inherits:
-
Object
- Object
- AnnotateRb::Runner
- Defined in:
- lib/annotate_rb/runner.rb
Class Attribute Summary collapse
-
.runner ⇒ Object
readonly
Returns the value of attribute runner.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.runner ⇒ Object
Returns the value of attribute runner.
6 7 8 |
# File 'lib/annotate_rb/runner.rb', line 6 def runner @runner end |
Class Method Details
.run(args, config_file_options: nil) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/annotate_rb/runner.rb', line 16 def run(args, config_file_options: nil) self.runner = new runner.run(args, config_file_options: ) self.runner = nil end |
.run_after_migration ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/annotate_rb/runner.rb', line 8 def run_after_migration = ConfigLoader.load_config = Options.from() commands = ["models", *([:auto_annotate_routes_after_migrate] ? ["routes"] : [])] commands.each { |cmd| run([cmd], config_file_options: ) } end |
.running? ⇒ Boolean
24 25 26 |
# File 'lib/annotate_rb/runner.rb', line 24 def running? !!runner end |
Instance Method Details
#run(args, config_file_options: nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/annotate_rb/runner.rb', line 33 def run(args, config_file_options: nil) parser = Parser.new(args, {}) = parser.parse remaining_args = parser.remaining_args AnnotateRb::ConfigFinder.config_path = [:config_path] if [:config_path] = ConfigLoader.load_config if .nil? = .merge() @options = Options.from(, {working_args: remaining_args}) AnnotateRb::RakeBootstrapper.call raise "Didn't specify a command" unless @options[:command] @options[:command].call(@options) # TODO end |