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-20.1.0 lib/quality/tools/rails_best_practices.rb
quality-20.0.3 lib/quality/tools/rails_best_practices.rb
quality-20.0.2 lib/quality/tools/rails_best_practices.rb
quality-20.0.1 lib/quality/tools/rails_best_practices.rb
quality-20.0.0 lib/quality/tools/rails_best_practices.rb
quality-19.2.1 lib/quality/tools/rails_best_practices.rb
quality-19.2.0 lib/quality/tools/rails_best_practices.rb
quality-19.1.3 lib/quality/tools/rails_best_practices.rb
quality-19.1.2 lib/quality/tools/rails_best_practices.rb
quality-19.1.1 lib/quality/tools/rails_best_practices.rb
quality-19.1.0 lib/quality/tools/rails_best_practices.rb
quality-19.0.0 lib/quality/tools/rails_best_practices.rb
quality-18.0.1 lib/quality/tools/rails_best_practices.rb
quality-18.0.0 lib/quality/tools/rails_best_practices.rb
quality-17.2.0 lib/quality/tools/rails_best_practices.rb
quality-17.1.1 lib/quality/tools/rails_best_practices.rb
quality-17.1.0 lib/quality/tools/rails_best_practices.rb
quality-17.0.0 lib/quality/tools/rails_best_practices.rb
quality-16.0.1 lib/quality/tools/rails_best_practices.rb
quality-16.0.0 lib/quality/tools/rails_best_practices.rb