Class: GitBreeze::Hook
- Inherits:
-
Object
- Object
- GitBreeze::Hook
- Defined in:
- lib/git_breeze/hook.rb
Instance Attribute Summary collapse
-
#hook_file ⇒ Object
readonly
Returns the value of attribute hook_file.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(root) ⇒ Hook
constructor
A new instance of Hook.
- #write ⇒ Object
Constructor Details
Instance Attribute Details
#hook_file ⇒ Object (readonly)
Returns the value of attribute hook_file.
5 6 7 |
# File 'lib/git_breeze/hook.rb', line 5 def hook_file @hook_file end |
Class Method Details
.init ⇒ Object
7 8 9 |
# File 'lib/git_breeze/hook.rb', line 7 def self.init init_at(Repository.root) end |
Instance Method Details
#write ⇒ Object
19 20 21 22 23 24 |
# File 'lib/git_breeze/hook.rb', line 19 def write File.open(hook_file, 'w') do |f| f.write(hook_body) f.chmod(0755) end end |