Sha256: dfcad52e7a19e311b1ab7cfe948497d983d0943ea37bcf3bc70f1836c7db71d4

Contents?: true

Size: 820 Bytes

Versions: 2

Compression:

Stored size: 820 Bytes

Contents

require 'koality/version'
require 'koality/options'
require 'koality/reporter/base'
require 'koality/reporter/cane'
require 'koality/reporter/rails_best_practices'
require 'koality/runner/cane'
require 'koality/runner/rails_best_practices'

module Koality

  class << self
    def run
      setup_environment

      run_rails_bp if options.rails_bp_enabled?

      success = run_cane
      abort if options[:abort_on_failure] && !success
    end

    def run_rails_bp
      rails_bp = Koality::Runner::RailsBestPractices.new(options)
      rails_bp.run
    end

    def run_cane
      cane = Koality::Runner::Cane.new(options)
      cane.run
    end

    def options
      @options ||= Koality::Options.new
    end

    private

    def setup_environment
      options.ensure_output_directory_exists
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
koality-1.0.1 lib/koality.rb
koality-1.0.0 lib/koality.rb