Sha256: 30a1a2d4a1f0a82b1eafc4c6f0008a68506c6f3fcd368f1b6badf67a70d0c8db

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

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."
          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'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rubycritic-2.9.3 lib/rubycritic/source_control_systems/base.rb