Class: XcodeInstaller::ReleaseManager
- Inherits:
-
Object
- Object
- XcodeInstaller::ReleaseManager
- Defined in:
- lib/xcode-installer/release-manager.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) ⇒ Object
-
#initialize ⇒ ReleaseManager
constructor
A new instance of ReleaseManager.
Constructor Details
#initialize ⇒ ReleaseManager
Returns a new instance of ReleaseManager.
7 8 9 10 |
# File 'lib/xcode-installer/release-manager.rb', line 7 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.
5 6 7 |
# File 'lib/xcode-installer/release-manager.rb', line 5 def data @data end |
Instance Method Details
#get_all(interface_type) ⇒ Object
12 13 14 15 16 |
# File 'lib/xcode-installer/release-manager.rb', line 12 def get_all(interface_type) interface_type ||= 'gui' list = data[interface_type] return list end |
#get_release(version, include_beta) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/xcode-installer/release-manager.rb', line 18 def get_release(version, include_beta) 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 |