Class: Rays::Git

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

Instance Method Summary collapse

Constructor Details

#initialize(path, source_dir) ⇒ Git

Returns a new instance of Git.



56
57
58
59
# File 'lib/rays/services/scm.rb', line 56

def initialize path, source_dir
  @path = path
  @source_dir = source_dir
end

Instance Method Details

#checkout(dir = nil) ⇒ Object



61
62
63
64
65
# File 'lib/rays/services/scm.rb', line 61

def checkout dir = nil
  dir ||= @source_dir
  rays_exec "git clone #{@path} #{dir}"
  @source_dir = dir
end

#updateObject



67
68
69
70
71
# File 'lib/rays/services/scm.rb', line 67

def update
  in_directory(@source_dir) do
    rays_exec "git pull origin"
  end
end