Class: BuildMaster::CvsDriver

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cvs_info, working_directory) ⇒ CvsDriver

Returns a new instance of CvsDriver.



23
24
25
26
27
# File 'lib/buildmaster/project/cvs_driver.rb', line 23

def initialize(cvs_info, working_directory)
  @cvs_info = cvs_info
  @working_directory = working_directory
  @cotta = @working_directory.cotta
end

Class Method Details

.from_path(working_directory) ⇒ Object



19
20
21
# File 'lib/buildmaster/project/cvs_driver.rb', line 19

def CvsDriver.from_path(working_directory)
  return CvsDriver.new(CvsInfo.load("#{working_directory}/CVS"), working_directory)
end

Instance Method Details

#checkoutObject



33
34
35
# File 'lib/buildmaster/project/cvs_driver.rb', line 33

def checkout()
  @cotta.shell("cvs -d #{@cvs_info.root} co -d #{@working_directory.path} #{@cvs_info.repository}")
end

#command(command) ⇒ Object



29
30
31
# File 'lib/buildmaster/project/cvs_driver.rb', line 29

def command(command)
  @cotta.shell "cvs -d #{@cvs_info.root} #{command} #{@working_directory.path}"
end

#commit(comment) ⇒ Object



48
49
50
# File 'lib/buildmaster/project/cvs_driver.rb', line 48

def commit(comment)
  command("commit -m \"#{comment}\"")
end

#tag(name) ⇒ Object



44
45
46
# File 'lib/buildmaster/project/cvs_driver.rb', line 44

def tag(name)
  command("tag #{name}")
end

#update(option = '') ⇒ Object



37
38
39
40
41
42
# File 'lib/buildmaster/project/cvs_driver.rb', line 37

def update(option='')
  if (option.length > 0)
    option = ' ' + option
  end
  command("update#{option}")
end