Class: GitCommitNotifier::ResultProcessor
- Inherits:
-
Object
- Object
- GitCommitNotifier::ResultProcessor
- Includes:
- EscapeHelper
- Defined in:
- lib/git_commit_notifier/result_processor.rb
Overview
Processes diff result input (loaded in @diff) is an array having Hash elements: { :action => action, :token => string } action can be :discard_a, :discard_b or :match output: two formatted html strings, one for the removals and one for the additions
Instance Method Summary collapse
-
#length_in_chars(diff) ⇒ FixNum
Gets length of tokenized diff in characters.
- #results ⇒ Object
Methods included from EscapeHelper
#decode_escaped_filename, #escape_content, #expand_tabs
Instance Method Details
#length_in_chars(diff) ⇒ FixNum
Gets length of tokenized diff in characters.
22 23 24 25 26 27 28 |
# File 'lib/git_commit_notifier/result_processor.rb', line 22 def length_in_chars(diff) diff.inject(0) do |length, s| token = s[:token] token_length = token.respond_to?(:jlength) ? token.jlength : token.length length + token_length end end |
#results ⇒ Object
15 16 17 18 |
# File 'lib/git_commit_notifier/result_processor.rb', line 15 def results # close last tag [array_of_lines(@result[:removal]), array_of_lines(@result[:addition])] end |