Class: QCloudHive::XCodeProject

Inherits:
Object
  • Object
show all
Defined in:
lib/qcloudhive/xcodeproj.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ XCodeProject

Returns a new instance of XCodeProject.



87
88
89
90
91
# File 'lib/qcloudhive/xcodeproj.rb', line 87

def initialize(path)
  @path = path
  @podfile = nil
  @hiveSpecModules = nil
end

Instance Attribute Details

#hiveSpecModulesObject (readonly)

Returns the value of attribute hiveSpecModules.



17
18
19
# File 'lib/qcloudhive/xcodeproj.rb', line 17

def hiveSpecModules
  @hiveSpecModules
end

#pathObject

Returns the value of attribute path.



16
17
18
# File 'lib/qcloudhive/xcodeproj.rb', line 16

def path
  @path
end

Instance Method Details

#podfileObject



18
19
20
21
22
23
# File 'lib/qcloudhive/xcodeproj.rb', line 18

def podfile
  if @podfile.nil?
    @podfile = Pod::Podfile.from_file(Pathname(@path).join("Podfile").to_path)
  end
  @podfile
end

#saveHiveModulesConfigObject



93
94
95
96
97
98
99
100
101
# File 'lib/qcloudhive/xcodeproj.rb', line 93

def saveHiveModulesConfig
  config = ""
  hiveSpecModules.each { |e|
    config += "\n#{e.toConfig}"
  }
  File.open(Pathname.new(@path).join(QCloudHive::HIVE_MODULES_FILE_NAME).to_s, "w") { |f|
     f.write  config
  }
end