Class: Luffa::XcodeInstall

Inherits:
Object
  • Object
show all
Defined in:
lib/luffa/ios/xcode.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ XcodeInstall

Returns a new instance of XcodeInstall.



6
7
8
9
10
11
12
13
14
15
# File 'lib/luffa/ios/xcode.rb', line 6

def initialize(path)
  Luffa::Xcode.with_developer_dir(path) do
    @version = lambda {
      xcode_build_output = `xcrun xcodebuild -version`.split(/\s/)[1]
      Luffa::Version.new(xcode_build_output)
    }.call

    @path = path
  end
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/luffa/ios/xcode.rb', line 4

def path
  @path
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/luffa/ios/xcode.rb', line 3

def version
  @version
end

Instance Method Details

#==(other) ⇒ Object



21
22
23
# File 'lib/luffa/ios/xcode.rb', line 21

def == (other)
  other.path == path && other.version == version
end

#version_stringObject



17
18
19
# File 'lib/luffa/ios/xcode.rb', line 17

def version_string
  version.to_s
end