Class: Latest::MacRuby

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

Constant Summary collapse

SOURCE =
'http://macruby.jp/files/'
AVAILABLE_EXTS =
['.zip']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(retriever) ⇒ MacRuby

Returns a new instance of MacRuby.



9
10
11
12
# File 'lib/latest_ruby/rubies/macruby.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/macruby.rb', line 7

def source
  @source
end

Instance Method Details



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

def link(ext = '.zip')
  if AVAILABLE_EXTS.include?(ext)
    source + 'MacRuby ' + version.to_s + ext
  end
end

#versionObject



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

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