Sha256: b809d4e6f460d4bc742e0179b138948699aa8fb539d2213b3cbfb6b5a5570d67

Contents?: true

Size: 697 Bytes

Versions: 22

Compression:

Stored size: 697 Bytes

Contents

module Quality
  module Tools
    # Adds 'rubocop' tool support to quality gem
    module RailsBestPractices
      private

      def quality_rails_best_practices
        ratchet_quality_cmd('rails_best_practices',
                            gives_error_code_on_violations: true) do |line|
          self.class.count_rails_best_practices_violations(line)
        end
      end

      def self.included(base)
        base.extend ClassMethods
      end

      # See Rubocop.included
      module ClassMethods
        def count_rails_best_practices_violations(line)
          if line =~ /.*:[0-9]* - /
            1
          else
            0
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
quality-15.0.1 lib/quality/tools/rails_best_practices.rb
quality-15.0.0 lib/quality/tools/rails_best_practices.rb