Class: SourceControl::Mercurial
- Inherits:
-
Base
- Object
- Base
- SourceControl::Mercurial
show all
- Defined in:
- lib/source_control/mercurial.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#get_remote_info, #initialize, #shell
Class Method Details
.covers?(path) ⇒ Boolean
6
7
8
9
10
11
12
|
# File 'lib/source_control/mercurial.rb', line 6
def self.covers?(path)
path_parts = path.split('/')
path_parts.length.downto(1) do |n|
return true if File.exist? path_parts[0...n].join('/') + '/.hg'
end
false
end
|
Instance Method Details
#command ⇒ Object
4
|
# File 'lib/source_control/mercurial.rb', line 4
def command; 'hg' end
|
#commit(options) ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/source_control/mercurial.rb', line 14
def commit(options)
cmd = 'hg commit'
options.each do |key, value|
case key
when :message
cmd << " -m '#{value}'"
end
end
run "#{cmd}"
end
|