Class: Rubycritic::SourceControlSystem
- Inherits:
-
Object
- Object
- Rubycritic::SourceControlSystem
- Defined in:
- lib/rubycritic/source_control_systems/source_control_system.rb
Direct Known Subclasses
Constant Summary collapse
- @@systems =
[]
Class Method Summary collapse
- .create ⇒ Object
- .register_system ⇒ Object
- .supported? ⇒ Boolean
- .system_names ⇒ Object
- .systems ⇒ Object
Instance Method Summary collapse
- #has_revision? ⇒ Boolean
- #head_reference ⇒ Object
- #revisions_count(file) ⇒ Object
- #travel_to_head ⇒ Object
Class Method Details
.create ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 10 def self.create supported_system = systems.detect(&:supported?) if supported_system supported_system.new else raise "Rubycritic requires a #{system_names} repository." end end |
.register_system ⇒ Object
6 7 8 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 6 def self.register_system @@systems << self end |
.supported? ⇒ Boolean
27 28 29 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 27 def self.supported? raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.") end |
.system_names ⇒ Object
23 24 25 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 23 def self.system_names systems.join(", ") end |
.systems ⇒ Object
19 20 21 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 19 def self.systems @@systems end |
Instance Method Details
#has_revision? ⇒ Boolean
31 32 33 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 31 def has_revision? raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.") end |
#head_reference ⇒ Object
35 36 37 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 35 def head_reference raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.") end |
#revisions_count(file) ⇒ Object
43 44 45 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 43 def revisions_count(file) raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.") end |
#travel_to_head ⇒ Object
39 40 41 |
# File 'lib/rubycritic/source_control_systems/source_control_system.rb', line 39 def travel_to_head raise NotImplementedError.new("The #{self.class} class must implement the #{__method__} method.") end |