Class: XcodeInstaller::XcodeVersions::ReleaseManager
- Inherits:
-
Object
- Object
- XcodeInstaller::XcodeVersions::ReleaseManager
- Defined in:
- lib/xcode-installer/xcode-versions.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Instance Method Summary collapse
- #get_all(interface_type) ⇒ Object
- #get_release(version, include_beta, interface_type) ⇒ Object
-
#initialize ⇒ ReleaseManager
constructor
A new instance of ReleaseManager.
Constructor Details
#initialize ⇒ ReleaseManager
Returns a new instance of ReleaseManager.
14 15 16 17 |
# File 'lib/xcode-installer/xcode-versions.rb', line 14 def initialize super @data = YAML::load_file(File.join(File.dirname(File.(__FILE__)), 'xcode-versions.yml')) end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
12 13 14 |
# File 'lib/xcode-installer/xcode-versions.rb', line 12 def data @data end |
Instance Method Details
#get_all(interface_type) ⇒ Object
19 20 21 22 23 |
# File 'lib/xcode-installer/xcode-versions.rb', line 19 def get_all(interface_type) interface_type ||= 'gui' list = data[interface_type] return list end |
#get_release(version, include_beta, interface_type) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/xcode-installer/xcode-versions.rb', line 25 def get_release(version, include_beta, interface_type) version ||= 'latest' include_beta ||= false interface_type ||= 'gui' list = data[interface_type] if version == 'latest' && include_beta version = LATEST_DP elsif version == 'latest' version = LATEST_GA end list.each { |release| if release['version'] == version return release end } end |