Class: Rays::SCM

Inherits:
Object
  • Object
show all
Defined in:
lib/rays/services/scm.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, username, password, type) ⇒ SCM

Returns a new instance of SCM.



30
31
32
33
34
35
36
37
# File 'lib/rays/services/scm.rb', line 30

def initialize(path, username, password, type)
  raise RaysException "unknown SCM type." if type.nil?
  if type.eql? "svn"
    @instance = SVN.new path, username, password, $rays_config.project_root
  else
    @instance = Git.new path, Rays::Utils::FileUtils.project_root
  end
end

Instance Method Details

#checkoutObject



43
44
45
# File 'lib/rays/services/scm.rb', line 43

def checkout
  @instance.checkout
end

#clean_checkoutObject



47
48
49
# File 'lib/rays/services/scm.rb', line 47

def clean_checkout
  @instance.checkout "/tmp/#{Project.instance.name}"
end

#updateObject



39
40
41
# File 'lib/rays/services/scm.rb', line 39

def update
  @instance.update
end