Class: GitHooks::PreCommit::PreventDebugger
- Inherits:
-
Object
- Object
- GitHooks::PreCommit::PreventDebugger
- Defined in:
- lib/git_hooks/pre_commit/prevent_debugger.rb
Instance Attribute Summary collapse
-
#git_repository ⇒ Object
readonly
Returns the value of attribute git_repository.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(git_repository) ⇒ PreventDebugger
constructor
A new instance of PreventDebugger.
- #validate ⇒ Object
Constructor Details
#initialize(git_repository) ⇒ PreventDebugger
Returns a new instance of PreventDebugger.
10 11 12 |
# File 'lib/git_hooks/pre_commit/prevent_debugger.rb', line 10 def initialize(git_repository) @git_repository = git_repository end |
Instance Attribute Details
#git_repository ⇒ Object (readonly)
Returns the value of attribute git_repository.
4 5 6 |
# File 'lib/git_hooks/pre_commit/prevent_debugger.rb', line 4 def git_repository @git_repository end |
Class Method Details
.validate ⇒ Object
6 7 8 |
# File 'lib/git_hooks/pre_commit/prevent_debugger.rb', line 6 def self.validate(*) new(GitHooks.configurations.git_repository).validate end |
Instance Method Details
#validate ⇒ Object
14 15 16 17 18 |
# File 'lib/git_hooks/pre_commit/prevent_debugger.rb', line 14 def validate abort( "Prevented commit with debugger in #{files_with_debugger}" ) if files_with_debugger.any? end |