Sha256: 80a3d43d8daabf046b8deaf463e32190b00bf787f4f7c96bb9a909de6e08cffc
Contents?: true
Size: 1.07 KB
Versions: 140
Compression:
Stored size: 1.07 KB
Contents
# frozen_string_literal: true require 'avm/version_number' require 'eac_ruby_utils/core_ext' module Avm module EacRubyBase1 class PreferredVersionRequirements enable_simple_cache common_constructor :version do self.version = ::Avm::VersionNumber.new(version) end # @return [Avm::VersionNumber] def prefix_version ::Avm::VersionNumber.new( normalized_version.segments[0..normalized_version.segments.count - 2] ) end # @return [Gem::Requirement] def to_requirement r = ["~> #{prefix_version}"] r << ">= #{normalized_version}" unless normalized_version.segments[-1].zero? ::Gem::Requirement.new(r) end # @return [Array<String>] def to_requirements_list to_requirement.requirements.map { |r| "#{r[0]} #{r[1]}" } end private # @return [Avm::VersionNumber] def normalized_version_uncached r = version r = ::Avm::VersionNumber.new(r.segments + [0]) while r.segments.count < 3 r end end end end
Version data entries
140 entries across 140 versions & 2 rubygems