Class: Gitenv::Config

Inherits:
Object
  • Object
show all
Includes:
Context
Defined in:
lib/gitenv/config.rb

Instance Attribute Summary collapse

Attributes included from Context

#absolute, #from_paths, #to_paths

Instance Method Summary collapse

Methods included from Context

#copy!, #from, #from_path, #to, #to_abs, #to_path

Constructor Details

#initialize(home) ⇒ Config

Returns a new instance of Config.



11
12
13
14
# File 'lib/gitenv/config.rb', line 11

def initialize home
  @home = home
  @actions = []
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



7
8
9
# File 'lib/gitenv/config.rb', line 7

def actions
  @actions
end

#homeObject (readonly)

Returns the value of attribute home.



9
10
11
# File 'lib/gitenv/config.rb', line 9

def home
  @home
end

#repositoryObject

Returns the value of attribute repository.



8
9
10
# File 'lib/gitenv/config.rb', line 8

def repository
  @repository
end

Instance Method Details

#all_filesObject



28
29
30
# File 'lib/gitenv/config.rb', line 28

def all_files
  :all_files
end

#copy(file, options = {}) ⇒ Object



24
25
26
# File 'lib/gitenv/config.rb', line 24

def copy file, options = {}
  Action.new(self, Copy, enumerator(file), options).tap{ |a| @actions << a }
end

#dot_filesObject



32
33
34
# File 'lib/gitenv/config.rb', line 32

def dot_files
  :dot_files
end

#repo(path) ⇒ Object



16
17
18
# File 'lib/gitenv/config.rb', line 16

def repo path
  @repository = File.expand_path path
end


20
21
22
# File 'lib/gitenv/config.rb', line 20

def symlink file, options = {}
  Action.new(self, Symlink, enumerator(file), options).tap{ |a| @actions << a }
end