Class: SchemaDev::Runner
- Inherits:
-
Object
- Object
- SchemaDev::Runner
- Defined in:
- lib/schema_dev/runner.rb
Instance Method Summary collapse
- #gemfiles ⇒ Object
-
#initialize(config) ⇒ Runner
constructor
A new instance of Runner.
- #run(*args, dry_run: false, quick: false, ruby: nil, rails: nil, db: nil, freshen: true) ⇒ Object
- #travis ⇒ Object
Constructor Details
#initialize(config) ⇒ Runner
Returns a new instance of Runner.
9 10 11 |
# File 'lib/schema_dev/runner.rb', line 9 def initialize(config) @config = config end |
Instance Method Details
#gemfiles ⇒ Object
17 18 19 |
# File 'lib/schema_dev/runner.rb', line 17 def gemfiles Gemfiles.build(@config) and puts "* Created gemfiles" end |
#run(*args, dry_run: false, quick: false, ruby: nil, rails: nil, db: nil, freshen: true) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/schema_dev/runner.rb', line 21 def run(*args, dry_run: false, quick: false, ruby: nil, rails: nil, db: nil, freshen: true) self.travis if freshen matrix = MatrixExecutor.new @config.matrix(quick: quick, ruby: ruby, rails: rails, db: db) return true if matrix.run(Shellwords.join(args.flatten), dry_run: dry_run) puts "\n*** #{matrix.errors.size} failures:\n\t#{matrix.errors.join("\n\t")}" return false end |
#travis ⇒ Object
13 14 15 |
# File 'lib/schema_dev/runner.rb', line 13 def travis Travis.update(@config) and puts "* Updated #{Travis::TRAVIS_FILE}" end |