Class: XcodeInstall::InstalledXcode
- Inherits:
-
Object
- Object
- XcodeInstall::InstalledXcode
- Defined in:
- lib/xcode/install.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #get_version(xcode_path) ⇒ Object
-
#initialize(path) ⇒ InstalledXcode
constructor
A new instance of InstalledXcode.
Constructor Details
#initialize(path) ⇒ InstalledXcode
Returns a new instance of InstalledXcode.
250 251 252 253 |
# File 'lib/xcode/install.rb', line 250 def initialize(path) @path = Pathname.new(path) @version = get_version(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
247 248 249 |
# File 'lib/xcode/install.rb', line 247 def path @path end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
248 249 250 |
# File 'lib/xcode/install.rb', line 248 def version @version end |
Instance Method Details
#get_version(xcode_path) ⇒ Object
257 258 259 260 |
# File 'lib/xcode/install.rb', line 257 def get_version(xcode_path) output = `DEVELOPER_DIR='' "#{xcode_path}/Contents/Developer/usr/bin/xcodebuild" -version` output.split("\n").first.split(' ')[1] end |