Class: Latest::JRuby

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

Constant Summary collapse

SOURCE =
'http://jruby.org.s3.amazonaws.com/downloads/'
WEB_SOURCE =
'http://jruby.org/download'
AVAILABLE_EXTS =
['.tar.gz', '.zip']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(retriever) ⇒ JRuby

Returns a new instance of JRuby.



10
11
12
13
# File 'lib/latest_ruby/rubies/jruby.rb', line 10

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

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



8
9
10
# File 'lib/latest_ruby/rubies/jruby.rb', line 8

def source
  @source
end

#web_sourceObject (readonly)

Returns the value of attribute web_source.



8
9
10
# File 'lib/latest_ruby/rubies/jruby.rb', line 8

def web_source
  @web_source
end

Instance Method Details



19
20
21
22
23
# File 'lib/latest_ruby/rubies/jruby.rb', line 19

def link(ext = '.tar.gz')
  if AVAILABLE_EXTS.include?(ext)
    SOURCE + '/' + version.to_s + '/jruby-bin-' + version.to_s + ext
  end
end

#versionObject



15
16
17
# File 'lib/latest_ruby/rubies/jruby.rb', line 15

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