class Capistrano::SCM

Base class for SCM strategy providers.

@abstract

@attr_reader [Rake] context

@author Hartog de Mik

Attributes

context[R]

Public Class Methods

new(context, strategy) click to toggle source

Provide a wrapper for the SCM that loads a strategy for the user.

@param [Rake] context The context in which the strategy should run @param [Module] strategy A module to include into the SCM instance. The

module should provide the abstract methods of Capistrano::SCM
# File lib/capistrano/scm.rb, line 19
def initialize(context, strategy)
  @context = context
  singleton = class << self; self; end
  singleton.send(:include, strategy)
end

Public Instance Methods

check() click to toggle source

@abstract

Your implementation should check if the specified remote-repository is available.

@return [Boolean]

# File lib/capistrano/scm.rb, line 71
def check
  raise NotImplementedError, "Your SCM strategy module should provide a #check method"
end
clone() click to toggle source

@abstract

Create a (new) clone of the remote-repository on the deployment target

@return void

# File lib/capistrano/scm.rb, line 81
def clone
  raise NotImplementedError, "Your SCM strategy module should provide a #clone method"
end
fetch(*args) click to toggle source

Fetch a var from the context @param [Symbol] variable The variable to fetch @param [Object] default The default value if not found

# File lib/capistrano/scm.rb, line 49
def fetch(*args)
  context.fetch(*args)
end
fetch_revision() click to toggle source

@abstract

Identify the SHA of the commit that will be deployed. This will most likely involve SshKit's capture method.

@return void

# File lib/capistrano/scm.rb, line 111
def fetch_revision
  raise NotImplementedError, "Your SCM strategy module should provide a #fetch_revision method"
end
release() click to toggle source

@abstract

Copy the contents of the cache-repository onto the release path

@return void

# File lib/capistrano/scm.rb, line 101
def release
  raise NotImplementedError, "Your SCM strategy module should provide a #release method"
end
release_path() click to toggle source

The release path according to the context

# File lib/capistrano/scm.rb, line 41
def release_path
  context.release_path
end
repo_path() click to toggle source

The repository path according to the context

# File lib/capistrano/scm.rb, line 36
def repo_path
  context.repo_path
end
repo_url() click to toggle source

The repository URL according to the context

# File lib/capistrano/scm.rb, line 31
def repo_url
  context.repo_url
end
test() click to toggle source

@abstract

Your implementation should check the existence of a cache repository on the deployment target

@return [Boolean]

# File lib/capistrano/scm.rb, line 60
def test
  raise NotImplementedError, "Your SCM strategy module should provide a #test method"
end
test!(*args) click to toggle source

Call test in context

# File lib/capistrano/scm.rb, line 26
def test!(*args)
  context.test(*args)
end
update() click to toggle source

@abstract

Update the clone on the deployment target

@return void

# File lib/capistrano/scm.rb, line 91
def update
  raise NotImplementedError, "Your SCM strategy module should provide a #update method"
end