Class: Avm::Ruby::Gems::Generator::VersionBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/ruby/gems/generator.rb

Instance Method Summary collapse

Instance Method Details

#three_segmentsObject



141
142
143
# File 'lib/avm/ruby/gems/generator.rb', line 141

def three_segments
  segments.first(3).join('.')
end

#to_sObject



126
127
128
129
130
# File 'lib/avm/ruby/gems/generator.rb', line 126

def to_s
  r = "'~> #{two_segments}'"
  r += ", '>= #{three_segments}'" if segments.count >= 3 && segments[2].positive?
  r
end

#two_segmentsObject



137
138
139
# File 'lib/avm/ruby/gems/generator.rb', line 137

def two_segments
  segments.first(2).join('.')
end

#versionGem::Version

Returns:

  • (Gem::Version)


133
134
135
# File 'lib/avm/ruby/gems/generator.rb', line 133

def version
  (options_version || default_version)
end