Sha256: a30c154e9b94c631dffe74f54e6039f254857759d46716a694a94d04619147cc

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

require 'thor'
require 'hashie'
require 'roo_on_rails/checks/environment'

module RooOnRails
  class Harness
    include Thor::Shell

    def initialize(try_fix: false, context: nil)
      @try_fix = try_fix
      @context = context || Hashie::Mash.new
    end

    def run
      [
        Checks::Environment.new(env: 'staging',    fix: @try_fix, context: @context),
        Checks::Environment.new(env: 'production', fix: @try_fix, context: @context),
      ].each(&:run)
      self
    rescue Shell::CommandFailed
      say 'A command failed to run, aborting', %i[bold red]
      exit 2
    rescue Checks::Failure
      say 'A check failed, exiting', %i[bold red]
      exit 1
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roo_on_rails-1.2.0 lib/roo_on_rails/harness.rb
roo_on_rails-1.1.0 lib/roo_on_rails/harness.rb