Class: GitPlus::Parsers::Commits::Unsaved::History
- Inherits:
-
Object
- Object
- GitPlus::Parsers::Commits::Unsaved::History
- Defined in:
- lib/git_plus/parsers/commits/unsaved/history.rb
Overview
Parses unsaved commit history into commit objects.
Instance Method Summary collapse
- #call(path) ⇒ Object
-
#initialize(entry: Entry) ⇒ History
constructor
A new instance of History.
Constructor Details
#initialize(entry: Entry) ⇒ History
Returns a new instance of History.
9 10 11 |
# File 'lib/git_plus/parsers/commits/unsaved/history.rb', line 9 def initialize entry: Entry @entry = entry end |
Instance Method Details
#call(path) ⇒ Object
13 14 15 16 17 |
# File 'lib/git_plus/parsers/commits/unsaved/history.rb', line 13 def call path fail Error, %(Invalid commit message path: "#{path}".) unless path.exist? path.read.scrub("?").then { || entry.call } end |