Sha256: f6cdec09bea654504424c8748f43dde8faa76df4c4418e1b85f7f865fbac6196

Contents?: true

Size: 758 Bytes

Versions: 1

Compression:

Stored size: 758 Bytes

Contents

module Hexx
  module Suit
    module Metrics

      # Prepares and runs rubocop environment from '.hexx-suit.yml'
      class Rubocop < Base

        # @!scope class
        # Sets ENV variables for rubocop rake tasks
        #
        # @return [self]
        def load
          ENV["RUBOCOP_FORMAT"] = options["format"]
          ENV["RUBOCOP_OUTPUT"] = options["output"]

          super
        end

        private

        # rubocop metric definitions

        def name
          :rubocop
        end

        def default_options
          { "format" => "html", "output" => "tmp/rubocop/index.html" }
        end

        # helpers

        def options
          @options ||= default_options.merge settings.to_h
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hexx-suit-0.1.0 lib/hexx/suit/metrics/rubocop.rb