lib/rubycritic/source_control_systems/base.rb in rubycritic-1.1.1 vs lib/rubycritic/source_control_systems/base.rb in rubycritic-1.2.0
- old
+ new
@@ -8,53 +8,30 @@
def self.register_system
@@systems << self
end
+ def self.systems
+ @@systems
+ end
+
def self.create
- supported_system = systems.detect(&:supported?)
+ supported_system = systems.find(&:supported?)
if supported_system
supported_system.new
else
- puts "Rubycritic requires a #{system_names} repository."
+ puts "RubyCritic can provide more feedback if you use a #{connected_system_names} repository."
Double.new
end
end
- def self.systems
- @@systems
+ def self.connected_system_names
+ "#{systems[0...-1].join(', ')} or #{systems[-1]}"
end
-
- def self.system_names
- systems.join(", ")
- end
-
- def self.supported?
- raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
- end
-
- def has_revision?
- raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
- end
-
- def head_reference
- raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
- end
-
- def travel_to_head
- raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
- end
-
- def revisions_count(path)
- raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
- end
-
- def date_of_last_commit(path)
- raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.")
- end
end
end
end
require "rubycritic/source_control_systems/double"
require "rubycritic/source_control_systems/git"
+require "rubycritic/source_control_systems/mercurial"