Sha256: 582118fff669021ecef9c71634c2763f11c8ec87dc027ba92924c5dae48105ab

Contents?: true

Size: 518 Bytes

Versions: 6

Compression:

Stored size: 518 Bytes

Contents

# encoding: utf-8
require 'rails_best_practices/core/check'

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

      def initialize
        @gems = Prepares.gems
      end

      # Check all command nodes to get gem names.
      add_callback :start_command do |node|
        if "gem" == node.message.to_s
          @gems << node.arguments.to_s
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_best_practices-1.13.5 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.13.4 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.13.3 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.13.2 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.13.1 lib/rails_best_practices/prepares/gemfile_prepare.rb
rails_best_practices-1.13.0 lib/rails_best_practices/prepares/gemfile_prepare.rb