Class: Latest::MagLev

Inherits:
Object
  • Object
show all
Defined in:
lib/latest_ruby/rubies/maglev.rb

Constant Summary collapse

SOURCE =
'http://glass-downloads.gemstone.com/maglev/'
AVAILABLE_EXTS =
['.tar.gz']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(retriever) ⇒ MagLev

Returns a new instance of MagLev.



9
10
11
12
# File 'lib/latest_ruby/rubies/maglev.rb', line 9

def initialize(retriever)
  @retriever = retriever
  @source = SOURCE
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



7
8
9
# File 'lib/latest_ruby/rubies/maglev.rb', line 7

def source
  @source
end

Instance Method Details



18
19
20
21
22
# File 'lib/latest_ruby/rubies/maglev.rb', line 18

def link(ext = '.tar.gz')
  if AVAILABLE_EXTS.include?(ext)
    source + 'MagLev-' + version.to_s + ext
  end
end

#versionObject



14
15
16
# File 'lib/latest_ruby/rubies/maglev.rb', line 14

def version
  @version ||= @retriever.retrieve(self)
end