Class: Thrust::AgvTool

Inherits:
Object
  • Object
show all
Defined in:
lib/thrust/agv_tool.rb

Instance Method Summary collapse

Constructor Details

#initialize(thrust_executor = Thrust::Executor.new, git = Thrust::Git.new) ⇒ AgvTool

Returns a new instance of AgvTool.



3
4
5
6
# File 'lib/thrust/agv_tool.rb', line 3

def initialize(thrust_executor = Thrust::Executor.new, git = Thrust::Git.new)
  @thrust_executor = thrust_executor
  @git = git
end

Instance Method Details

#change_build_number(build_number, timestamp = nil, path_to_xcodeproj = nil) ⇒ Object



8
9
10
11
12
# File 'lib/thrust/agv_tool.rb', line 8

def change_build_number(build_number, timestamp = nil, path_to_xcodeproj = nil)
  path_to_xcodeproj = path_to_xcodeproj ? File.dirname(path_to_xcodeproj) : '.'
  @thrust_executor.system_or_exit "cd #{path_to_xcodeproj} && agvtool new-version -all '#{timestamp ? timestamp + '-' : ''}#{build_number}'"
  @git.checkout_file("#{path_to_xcodeproj}/*.xcodeproj")
end