Class: Latest::MRI
- Inherits:
-
Object
- Object
- Latest::MRI
- Defined in:
- lib/latest_ruby/rubies/mri.rb
Constant Summary collapse
- SOURCE =
'http://ftp.ruby-lang.org/pub/ruby/'
- AVAILABLE_EXTS =
['.tar.gz', '.zip', '.tar.bz2']
Instance Attribute Summary collapse
-
#short_ver ⇒ Object
readonly
Returns the value of attribute short_ver.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
-
#initialize(short_ver, retriever) ⇒ MRI
constructor
A new instance of MRI.
- #link(ext = '.tar.gz') ⇒ Object
- #version ⇒ Object
Constructor Details
Instance Attribute Details
#short_ver ⇒ Object (readonly)
Returns the value of attribute short_ver.
7 8 9 |
# File 'lib/latest_ruby/rubies/mri.rb', line 7 def short_ver @short_ver end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
7 8 9 |
# File 'lib/latest_ruby/rubies/mri.rb', line 7 def source @source end |
Instance Method Details
#link(ext = '.tar.gz') ⇒ Object
19 20 21 22 23 |
# File 'lib/latest_ruby/rubies/mri.rb', line 19 def link(ext = '.tar.gz') if AVAILABLE_EXTS.include?(ext) source + short_ver + '/ruby-' + version.to_s + ext end end |
#version ⇒ Object
15 16 17 |
# File 'lib/latest_ruby/rubies/mri.rb', line 15 def version @version ||= @retriever.retrieve(self) end |