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