Sha256: 3db998312dde7713bd59e4084de7fea08f5398146472bfc3ab7d306d4cf5573e

Contents?: true

Size: 755 Bytes

Versions: 9

Compression:

Stored size: 755 Bytes

Contents

module Quality
  module Tools
    # Adds 'reek' tool support to quality gem
    module Reek
      def self.included(base)
        base.extend ClassMethods
      end

      private

      def quality_reek
        args = "--single-line #{ruby_files.join(' ')}"
        ratchet_quality_cmd('reek',
                            args: args,
                            emacs_format: true,
                            gives_error_code_on_violations: true) do |line|
          self.class.count_reek_violations(line)
        end
      end

      # See Reek.included
      module ClassMethods
        def count_reek_violations(line)
          if line =~ /^  .* (.*)$/
            1
          else
            0
          end
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
quality-22.0.0 lib/quality/tools/reek.rb
quality-21.0.6 lib/quality/tools/reek.rb
quality-21.0.5 lib/quality/tools/reek.rb
quality-21.0.4 lib/quality/tools/reek.rb
quality-21.0.3 lib/quality/tools/reek.rb
quality-21.0.2 lib/quality/tools/reek.rb
quality-21.0.1 lib/quality/tools/reek.rb
quality-20.1.1 lib/quality/tools/reek.rb
quality-21.0.0 lib/quality/tools/reek.rb