Class: Xcvm::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/xcvm/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ Project

Returns a new instance of Project.



10
11
12
# File 'lib/xcvm/project.rb', line 10

def initialize(file)
	@file = file
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



8
9
10
# File 'lib/xcvm/project.rb', line 8

def file
  @file
end

Instance Method Details

#buildObject



25
26
27
28
29
30
# File 'lib/xcvm/project.rb', line 25

def build
	if @build == nil then
		@build = Xcvm::Build.new(info['CFBundleVersion'].to_i)
	end
	return @build
end

#build=(value) ⇒ Object



32
33
34
# File 'lib/xcvm/project.rb', line 32

def build=(value)
	@build = value
end

#saveObject



36
37
38
39
40
# File 'lib/xcvm/project.rb', line 36

def save
	info['CFBundleShortVersionString'] = version.to_s
	info['CFBundleVersion'] = build.to_s
	File.open(@file, 'w') { |file| file.write(info.to_plist) }
end

#versionObject



14
15
16
17
18
19
# File 'lib/xcvm/project.rb', line 14

def version
	if @version == nil then
		@version = Xcvm::SemanticVersion.new(info['CFBundleShortVersionString'])
	end
	return @version
end

#version=(value) ⇒ Object



21
22
23
# File 'lib/xcvm/project.rb', line 21

def version=(value)
	@version = value
end