Sha256: f08a74b07ea65aa72cd9c5f01a993519a6891aa5cea86a16f060d0311920960a

Contents?: true

Size: 538 Bytes

Versions: 6

Compression:

Stored size: 538 Bytes

Contents

module Rails4Upgrade
  class GemDependency < Struct.new(:name, :requirement)
    RAILS_GEMS = Set.new(
      %w(actionmailer actionpack activemodel activerecord activesupport railties rails)
    ).freeze

    def initialize(name, requirement)
      requirement = requirement.is_a?(::Gem::Requirement) ? requirement : ::Gem::Requirement.new(requirement)
      super
    end

    def rails?
      RAILS_GEMS.include?(name)
    end

    def satisfied_by_rails4?
      requirement.satisfied_by?(::Gem::Version.new("4.0.0"))
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails4_upgrade-0.5.0 lib/rails4_upgrade/gem_dependency.rb
rails4_upgrade-0.0.5 lib/rails4_upgrade/gem_dependency.rb
rails4_upgrade-0.0.4 lib/rails4_upgrade/gem_dependency.rb
rails4_upgrade-0.0.3 lib/rails4_upgrade/gem_dependency.rb
rails4_upgrade-0.0.2 lib/rails4_upgrade/gem_dependency.rb
rails4_upgrade-0.0.1 lib/rails4_upgrade/gem_dependency.rb