Class: Rubycritic::SourceControlSystem::Mercurial

Inherits:
Base
  • Object
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

Returns:

  • (Boolean)


7
8
9
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 7

def self.supported?
  `hg verify 2>&1` && $?.success?
end

.to_sObject



11
12
13
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 11

def self.to_s
  "Mercurial"
end

Instance Method Details

#date_of_last_commit(path) ⇒ Object



19
20
21
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 19

def date_of_last_commit(path)
  `hg log #{path.shellescape} --template '{date|isodate}' --limit 1`.chomp
end

#revision?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 23

def revision?
  false
end

#revisions_count(path) ⇒ Object



15
16
17
# File 'lib/rubycritic/source_control_systems/mercurial.rb', line 15

def revisions_count(path)
  `hg log #{path.shellescape} --template '1'`.size
end