Class: R10K::Environment::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/r10k/environment/base.rb

Overview

This class defines a common interface for environment implementations.

Since:

  • 1.3.0

Direct Known Subclasses

Git, SVN

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, basedir, dirname, options = {}) ⇒ Base

Initialize the given environment.

Parameters:

  • name (String)

    The unique name describing this environment.

  • basedir (String)

    The base directory where this environment will be created.

  • dirname (String)

    The directory name for this environment.

  • options (Hash) (defaults to: {})

    An additional set of options for this environment. The semantics of this environment may depend on the environment implementation.

Since:

  • 1.3.0



25
26
27
28
29
30
31
32
# File 'lib/r10k/environment/base.rb', line 25

def initialize(name, basedir, dirname, options = {})
  @name    = name
  @basedir = basedir
  @dirname = dirname
  @options = options

  @full_path = File.join(@basedir, @dirname)
end

Instance Attribute Details

#basedirObject (readonly)

Since:

  • 1.3.0



12
13
14
# File 'lib/r10k/environment/base.rb', line 12

def basedir
  @basedir
end

#dirnameObject (readonly)

Since:

  • 1.3.0



16
17
18
# File 'lib/r10k/environment/base.rb', line 16

def dirname
  @dirname
end

#nameObject (readonly)

Since:

  • 1.3.0



8
9
10
# File 'lib/r10k/environment/base.rb', line 8

def name
  @name
end

Instance Method Details

#syncvoid

This method is abstract.

This method returns an undefined value.

Synchronize the given environment.

Raises:

  • (NotImplementedError)

Since:

  • 1.3.0



39
40
41
# File 'lib/r10k/environment/base.rb', line 39

def sync
  raise NotImplementedError, "#{self.class} has not implemented method #{__method__}"
end