Sha256: 1deb54f154477a0f5a50e0d789ea798ad0885c0f04bfe26becacf7eaeb91aaac

Contents?: true

Size: 953 Bytes

Versions: 8

Compression:

Stored size: 953 Bytes

Contents

# frozen_string_literal: true

require 'shellwords'

module RubyCritic
  module SourceControlSystem
    class Base
      @@systems = []

      def self.register_system
        @@systems << self
      end

      def self.systems
        @@systems
      end

      def self.create
        supported_system = systems.find(&:supported?)
        if supported_system
          supported_system.new
        else
          puts 'RubyCritic can provide more feedback if you use '\
               "a #{connected_system_names} repository. "\
               'Churn will not be calculated.'
          Double.new
        end
      end

      def self.connected_system_names
        "#{systems[0...-1].join(', ')} or #{systems[-1]}"
      end
    end
  end
end

require 'rubycritic/source_control_systems/double'
require 'rubycritic/source_control_systems/git'
require 'rubycritic/source_control_systems/mercurial'
require 'rubycritic/source_control_systems/perforce'

Version data entries

8 entries across 8 versions & 1 rubygems

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