Class: Lintrunner::Runner::Base
- Inherits:
-
Object
- Object
- Lintrunner::Runner::Base
- Includes:
- GitHelpers
- Defined in:
- lib/lintrunner/runner/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#executor ⇒ Object
Returns the value of attribute executor.
-
#git ⇒ Object
Returns the value of attribute git.
-
#match ⇒ Object
Returns the value of attribute match.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path:, match:, executor:) ⇒ Base
constructor
A new instance of Base.
- #run(reporter = nil) ⇒ Object
Methods included from GitHelpers
#git_changeset, #git_common_ancestor
Constructor Details
#initialize(path:, match:, executor:) ⇒ Base
Returns a new instance of Base.
8 9 10 11 12 13 |
# File 'lib/lintrunner/runner/base.rb', line 8 def initialize(path:, match:, executor:) self.path = path self.executor = executor self.match = Regexp.new(Regexp.escape(match)) self.git = Rugged::Repository.new(path) end |
Instance Attribute Details
#executor ⇒ Object
Returns the value of attribute executor.
6 7 8 |
# File 'lib/lintrunner/runner/base.rb', line 6 def executor @executor end |
#git ⇒ Object
Returns the value of attribute git.
6 7 8 |
# File 'lib/lintrunner/runner/base.rb', line 6 def git @git end |
#match ⇒ Object
Returns the value of attribute match.
6 7 8 |
# File 'lib/lintrunner/runner/base.rb', line 6 def match @match end |
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/lintrunner/runner/base.rb', line 6 def path @path end |
Instance Method Details
#run(reporter = nil) ⇒ Object
15 16 17 |
# File 'lib/lintrunner/runner/base.rb', line 15 def run(reporter = nil) raise "Runner must implement #run method" end |