Sha256: ac002a8a4ff7096c1a32fd2920a56e966745aa5a99ed00b12ee6d060cf00ae4b

Contents?: true

Size: 398 Bytes

Versions: 5

Compression:

Stored size: 398 Bytes

Contents

module Pessimize
  class VersionMapper
    def call(gems, versions, version_constraint)
      gems.each do |gem|
        if versions.has_key? gem.name
          version_parts = versions[gem.name].split('.')
          version = version_constraint == 'minor' ? version_parts.first(2).join('.') : version_parts.join('.')
          gem.version = "~> #{version}"
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
pessimizer-1.0.0 lib/pessimize/version_mapper.rb
pessimize-0.4.0 lib/pessimize/version_mapper.rb
pessimize-0.3.0 lib/pessimize/version_mapper.rb
pessimize-0.2.0 lib/pessimize/version_mapper.rb
pessimize-0.1.0 lib/pessimize/version_mapper.rb