Sha256: 207ebd7efe7623e05476d6b559758a54bfd9aa180b9aa8a02d59854ddf0c3a14

Contents?: true

Size: 553 Bytes

Versions: 18

Compression:

Stored size: 553 Bytes

Contents

# encoding: utf-8
module RailsBestPractices
  module Core
    class Gems < Array
      def has_gem?(gem_name)
        self.find { |gem| gem.name == gem_name }
      end

      def gem_version(gem_name)
        self.find { |gem| gem.name == gem_name }.try(:version)
      end
    end

    # Gem info includes gem name and gem version
    class Gem
      attr_reader :name, :version

      def initialize(name, version)
        @name = name
        @version = version
      end

      def to_s
        "#{@name} (#{@version})"
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rails_best_practices-1.19.1 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.19.0 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.18.1 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.18.0 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.17.0 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.16.0 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.15.7 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.15.6 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.15.4 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.15.3 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.15.2 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.15.1 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.14.4 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.14.3 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.14.2 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.14.1 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.14.0 lib/rails_best_practices/core/gems.rb
rails_best_practices-1.13.8 lib/rails_best_practices/core/gems.rb