Class: RubyCritic::SourceControlSystem::Mercurial
- Inherits:
-
Base
- Object
- Base
- RubyCritic::SourceControlSystem::Mercurial
show all
- Defined in:
- lib/rubycritic/source_control_systems/mercurial.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
connected_system_names, create, register_system, systems
Class Method Details
.supported? ⇒ Boolean
8
9
10
11
|
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 8
def self.supported?
hg_verify = `hg verify 2>&1`
hg_verify && $CHILD_STATUS.success?
end
|
.to_s ⇒ Object
13
14
15
|
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 13
def self.to_s
'Mercurial'
end
|
Instance Method Details
#date_of_last_commit(path) ⇒ Object
21
22
23
|
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 21
def date_of_last_commit(path)
`hg log #{path.shellescape} --template '{date|isodate}' --limit 1`.chomp
end
|
#revision? ⇒ Boolean
25
26
27
|
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 25
def revision?
false
end
|
#revisions_count(path) ⇒ Object
17
18
19
|
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 17
def revisions_count(path)
`hg log #{path.shellescape} --template '1'`.size
end
|