Class: Capistrano::Deploy::SCM::Git
- Inherits:
-
Object
- Object
- Capistrano::Deploy::SCM::Git
- Defined in:
- lib/locarails/git.rb
Instance Method Summary collapse
- #checkout(revision, destination) ⇒ Object
- #checkout_old ⇒ Object
-
#remote_repository ⇒ Object
force the remote git commands to fetch from the local filesystem instead making a round-trip to itself through ssh.
- #sub_wrapper(method, revision, destination) ⇒ Object
- #sync(revision, destination) ⇒ Object
- #sync_old ⇒ Object
Instance Method Details
#checkout(revision, destination) ⇒ Object
3 4 5 |
# File 'lib/locarails/git.rb', line 3 def checkout(revision, destination) sub_wrapper(:checkout_old, revision, destination) end |
#checkout_old ⇒ Object
2 |
# File 'lib/locarails/git.rb', line 2 alias :checkout_old :checkout |
#remote_repository ⇒ Object
force the remote git commands to fetch from the local filesystem instead making a round-trip to itself through ssh
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/locarails/git.rb', line 26 def remote_repository url = "#{configuration[:user]}@#{configuration[:domain]}:" @remote_repository ||= if configuration[:repository].include?(url) tmp = configuration[:repository].sub(url, "file://") if tmp.include?("~") tmp.sub!("~", "/home/#{configuration[:user]}") end tmp else configuration[:repository] end @remote_repository end |
#sub_wrapper(method, revision, destination) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/locarails/git.rb', line 12 def sub_wrapper(method, revision, destination) execute = send(method, revision, destination) # execute original method # filter the git URL to force it to a local file:// URL execute.collect do |line| if line.include?(configuration[:repository]) line.sub(configuration[:repository], remote_repository) else line end end end |
#sync(revision, destination) ⇒ Object
8 9 10 |
# File 'lib/locarails/git.rb', line 8 def sync(revision, destination) sub_wrapper(:sync_old, revision, destination) end |
#sync_old ⇒ Object
7 |
# File 'lib/locarails/git.rb', line 7 alias :sync_old :sync |