Class: Ed
- Inherits:
-
Object
show all
- Includes:
- Observe
- Defined in:
- lib/ed.rb,
lib/ed/version.rb
Defined Under Namespace
Modules: Config, Env
Classes: Delegator, Repository, RepositoryCopy
Constant Summary
collapse
- VERSION =
"0.8.2"
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(path) {|_self| ... } ⇒ Ed
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/ed.rb', line 43
def initialize path, &block
if Ed::Repository.remote?(path) || Ed::Config.copy_repository?
@repo = Ed::RepositoryCopy.new(path)
else
@repo = Ed::Repository.new(path)
end
if block_given?
if block.arity == 1
yield self
else
delegator = Ed::Delegator.new(self)
delegator.instance_eval(&block)
end
end
end
|
Class Method Details
27
28
29
|
# File 'lib/ed.rb', line 27
def self.configure &block
Ed::Config.change(&block)
end
|
Instance Method Details
#commit(commit, &block) {|path| ... } ⇒ void
Also known as:
tag, branch
This method returns an undefined value.
85
86
87
88
89
90
91
92
93
94
95
|
# File 'lib/ed.rb', line 85
def commit commit, &block
if Ed::Config.should_fork?
pid = fork do
switch(commit, &block)
end
Process.wait(pid)
else
switch(commit, &block)
end
end
|
#setup(&block) {|path| ... } ⇒ void
This method returns an undefined value.
69
70
71
|
# File 'lib/ed.rb', line 69
def setup &block
add_observer(:setup_block, &block)
end
|