Class: Nbuild::TFS

Inherits:
Object
  • Object
show all
Defined in:
lib/nbuild/tf.rb

Instance Method Summary collapse

Constructor Details

#initializeTFS

Returns a new instance of TFS.



5
6
7
# File 'lib/nbuild/tf.rb', line 5

def initialize
  @dir = ENV['TF_HOME'] || 'C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE'
end

Instance Method Details

#label(params) ⇒ Object



19
20
21
22
# File 'lib/nbuild/tf.rb', line 19

def label params
  info = repository_info
  tf("label \"#{params[:name]}\" . /version:\"W#{info.workspace_name};#{info.workspace_owner}\" /comment:\"#{params[:comment]}\" /recursive")
end

#repository_infoObject



9
10
11
12
13
14
15
16
17
# File 'lib/nbuild/tf.rb', line 9

def repository_info
  repo = OpenStruct.new
  lines = tf('workfold .')
  ignore, repo.workspace_name, repo.workspace_owner = lines[1].split
  repo.workspace_owner = repo.workspace_owner.slice(1..-2)
  ignore, repo.server_host = lines[2].split(':').map{|s|s.strip}
  repo.server_path, repo.local_path = lines[3].split(': ').map{|s|s.strip}
  repo
end