Sha256: 863c915041533d6fe3e99ff3daee55ba3f84daf1551c60abc4e4f97c6801f342

Contents?: true

Size: 546 Bytes

Versions: 8

Compression:

Stored size: 546 Bytes

Contents

# frozen_string_literal: true

module RubyCritic
  module SourceControlSystem
    class Mercurial < Base
      register_system

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

      def self.to_s
        'Mercurial'
      end

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

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

      def revision?
        false
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rubycritic-3.5.2 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.5.1 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.5.0 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.4.0 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.3.0 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.2.3 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.2.2 lib/rubycritic/source_control_systems/mercurial.rb
rubycritic-3.2.1 lib/rubycritic/source_control_systems/mercurial.rb