Module: Enumerable

Defined in:
lib/diff.rb

Overview

changes by DenisMertz

  • main change:

** get the tag soup away

 the tag soup problem was first reported with <p> tags, but it appeared also with
 <li>, <ul> etc... tags 
this version should mostly fix these problems

** added a Builder class to manage the creation of the final htmldiff

  • minor changes:

** use symbols instead of string to represent opcodes ** small fix to html2list

Instance Method Summary collapse

Instance Method Details

#reduce(init) ⇒ Object



28
29
30
31
32
# File 'lib/diff.rb', line 28

def reduce(init)
  result = init
  each { |item| result = yield(result, item) }
  result
end