Class: Gitenv::Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  @context = Context.new self
  @repos, @actions = [], []
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



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

def actions
  @actions
end

#reposObject (readonly)

Returns the value of attribute repos.



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

def repos
  @repos
end

Instance Method Details

#all_files(options = {}) ⇒ Object



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

def all_files options = {}
  matcher :all_files, options
end

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



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

def copy file, options = {}
  raise "You must specify a repository or a source directory to copy from" unless @context.from
  Copy::Action.new(@context.dup, matcher(file), options).tap{ |a| @actions << a }
end

#dot_files(options = {}) ⇒ Object



35
36
37
# File 'lib/gitenv/config.rb', line 35

def dot_files options = {}
  matcher :dot_files, options
end

#ignoresObject



46
47
48
# File 'lib/gitenv/config.rb', line 46

def ignores
  @context.ignores
end

#repo(path, &block) ⇒ Object



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

def repo path, &block
  @repos << Repository.new(path)
  @context.from path, &block
  self
end


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

def symlink file, options = {}
  raise "You must specify a repository or a source directory to symlink from" unless @context.from
  Symlink::Action.new(@context.dup, matcher(file), options).tap{ |a| @actions << a }
end