Sha256: 018e274771307b6f4929096d1d724103c8218ed0beeceab1835886725bae421e

Contents?: true

Size: 503 Bytes

Versions: 7

Compression:

Stored size: 503 Bytes

Contents

# frozen_string_literal: true

module RailsBestPractices
  module Prepares
    # Remember all gems in Gemfile
    class GemfilePrepare < Core::Check
      interesting_files GEMFILE_LOCK

      def initialize
        @gems = Prepares.gems
      end

      def check(_filename, content)
        content.split("\n").each do |line|
          if line =~ /([^ ]+) \((\d.*)\)/
            @gems << Core::Gem.new(Regexp.last_match(1), Regexp.last_match(2))
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rails_best_practices-1.23.2 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.23.1 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.23.0 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.22.1 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.22.0 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.21.0 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.20.1 lib/rails_best_practices/prepares/gemfile_prepare.rb