Class: Historian::Git
- Inherits:
-
Object
- Object
- Historian::Git
- Defined in:
- lib/historian/git.rb
Defined Under Namespace
Classes: Hooker
Instance Attribute Summary collapse
-
#history ⇒ Object
readonly
Returns the value of attribute history.
-
#repo_directory ⇒ Object
readonly
Returns the value of attribute repo_directory.
Instance Method Summary collapse
- #bundle_history_file ⇒ Object
-
#initialize(dir, history) ⇒ Git
constructor
A new instance of Git.
- #install_hook(hook) ⇒ Object
- #tag_release ⇒ Object
Constructor Details
#initialize(dir, history) ⇒ Git
Returns a new instance of Git.
96 97 98 99 |
# File 'lib/historian/git.rb', line 96 def initialize(dir, history) @repo_directory = dir @history = history end |
Instance Attribute Details
#history ⇒ Object (readonly)
Returns the value of attribute history.
90 91 92 |
# File 'lib/historian/git.rb', line 90 def history @history end |
#repo_directory ⇒ Object (readonly)
Returns the value of attribute repo_directory.
90 91 92 |
# File 'lib/historian/git.rb', line 90 def repo_directory @repo_directory end |
Instance Method Details
#bundle_history_file ⇒ Object
92 93 94 |
# File 'lib/historian/git.rb', line 92 def bundle_history_file amend_history_changes end |
#install_hook(hook) ⇒ Object
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/historian/git.rb', line 101 def install_hook(hook) hook = Hooker.new(repo_directory, hook) if hook.other_git_hook_exists? hook.preserve_original hook.install :adapted elsif !hook.installed? hook.install :created else hook.update :exists end end |
#tag_release ⇒ Object
116 117 118 119 120 121 122 123 124 |
# File 'lib/historian/git.rb', line 116 def tag_release commit_history_changes if history_dirty? ensure_history_has_release Tempfile.open("historian") do |file| file.puts file.flush git "tag", "-a", tag, "-F", file.path end end |