Class: Flagit::Redactor
- Inherits:
-
Object
- Object
- Flagit::Redactor
- Defined in:
- lib/flagit/redactor.rb
Instance Attribute Summary collapse
-
#lookout ⇒ Object
Returns the value of attribute lookout.
Instance Method Summary collapse
-
#initialize(lookout) ⇒ Redactor
constructor
A new instance of Redactor.
- #write_content(message, options: { add_commit: { url: true, message: true } }) ⇒ Object
Constructor Details
#initialize(lookout) ⇒ Redactor
Returns a new instance of Redactor.
5 6 7 |
# File 'lib/flagit/redactor.rb', line 5 def initialize(lookout) @lookout = lookout end |
Instance Attribute Details
#lookout ⇒ Object
Returns the value of attribute lookout.
3 4 5 |
# File 'lib/flagit/redactor.rb', line 3 def lookout @lookout end |
Instance Method Details
#write_content(message, options: { add_commit: { url: true, message: true } }) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/flagit/redactor.rb', line 9 def write_content(, options: { add_commit: { url: true, message: true } } ) if [:add_commit].nil? last_commit = @lookout.last_commit(branch_name: [:branch]) += " -" += " #{last_commit.}" if ([:add_commit][:message]) commit_url = @lookout.repository.remote.url.gsub('.git',"/commit/#{last_commit.sha}") += " #{commit_url}" if [:add_commit][:url] end |