xhtml_report_generator 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48ae4d4398c29c3d7247de4083690331f3620746
4
- data.tar.gz: d5b9f44706620a3971fb40c5abb36a3f6e3669e5
3
+ metadata.gz: 8be9f999ed4d1ead1cef830e239d46b804d90637
4
+ data.tar.gz: 4cc7489305ec224f61475e3df988ec3b5e51edb0
5
5
  SHA512:
6
- metadata.gz: 5661a84d5a1339b1bc8449bf3444024d0786139549fab12d38caed768b3e1355316f8539abd4e2e9836c8cc578aaa10274d90997810ec92888c87451a9417136
7
- data.tar.gz: 6fbbaa60ecbe16c6993fcc051b68272fa50fe5f4d603763bb8fd3bc153fe8daf17b1628c5c3592b8e848b4ce6ee71b05d5de9776086466613f381b79dff8acbd
6
+ metadata.gz: 2c0ab9f13b5419145b8aefaf88691f913e5740d81ac19e6a23cf094298fe169b47215a8586846ede0cefbed5ad9940a00b96ab18f34ff9f602d4fa9906d39de4
7
+ data.tar.gz: 002c248c1732f2c5a43010a44b14c96f56758544272d946d281f27180485c232bbf41e2d944537ea5010bbabffc9fabe618030bb2ed91651cccd7bfa39cdb81f
@@ -180,7 +180,7 @@ module Custom
180
180
  for i in arr do
181
181
  # detach from current
182
182
  i.parent = nil
183
- if i.class.to_s() == "REXML::Text"
183
+ if i.is_a?(REXML::Text)
184
184
  # in general a text looks as follows:
185
185
  # .*(matchstring|.*)*
186
186
 
@@ -201,7 +201,7 @@ module Custom
201
201
  # for non-text nodes we recurse into it and finally reattach to our parent to preserve ordering
202
202
  num_matches += highlight_captures(regex, color, i)
203
203
  el.add(i)
204
- end # if i.class.to_s() == "REXML::Text"
204
+ end # if i.is_a?(REXML::Text)
205
205
  end # for i in arr do
206
206
  return num_matches
207
207
  end
@@ -226,7 +226,7 @@ module Custom
226
226
  # detach from current
227
227
  i.parent = nil
228
228
  #puts i.class.to_s()
229
- if i.class.to_s() == "REXML::Text"
229
+ if i.is_a?(REXML::Text)
230
230
  # in general a text looks as follows:
231
231
  # .*(matchstring|.*)*
232
232
 
@@ -242,7 +242,7 @@ module Custom
242
242
  # puts "recurse"
243
243
  num_matches += highlight(regex, color, i)
244
244
  el.add(i)
245
- end # if i.class.to_s() == "REXML::Text"
245
+ end # if i.is_a?(REXML::Text)
246
246
  end # for i in arr do
247
247
  return num_matches
248
248
  end
@@ -338,8 +338,8 @@ module Custom
338
338
  # some <span>arbitrary</span>
339
339
  # text child content
340
340
  # </test>
341
- # @param element [REXML::Element] the element in whose text tags will be added at the specified indices of @index_length_array
342
- # @param parent [REXML::Element] the parent to which @element should be attached after parsing
341
+ # @param parent [REXML::Element] the parent to which "element" should be attached after parsing, e.g. <test>
342
+ # @param element [REXML::Element] the Text element, into which tags will be added at the specified indices of @index_length_array, e.g. the REXML::Text children of <test> in the example
343
343
  # @param tagname [String] the tag that will be introduced as <tagname> at the indices specified
344
344
  # @param attribs [Hash] Attributes that will be added to the inserted tag e.g. <tagname attrib="test">
345
345
  # @param index_length_array [Array] Array of the form [[index, lenght], [index, lenght], ...] that specifies
@@ -352,8 +352,10 @@ module Custom
352
352
  for j in index_length_array do
353
353
  # reattach normal (unmatched) text
354
354
  if j[0] > last_end
355
- text = REXML::Text.new(element.value()[ last_end, j[0] - last_end ])
356
- parent.add_text(text)
355
+ # text = REXML::Text.new(element.value()[ last_end, j[0] - last_end ])
356
+ # parent.add_text(text)
357
+ # add text without creating a textnode, textnode screws up formatting (e.g. all whitespace are condensed into one)
358
+ parent.add_text( element.value()[ last_end, j[0] - last_end ] )
357
359
  end
358
360
  #create the tag node with attributes and add the text to it
359
361
  tag = parent.add_element(REXML::Element.new(tagname), attribs)
@@ -363,8 +365,10 @@ module Custom
363
365
  # in the last round check for any remaining text
364
366
  if index == index_length_array.length - 1
365
367
  if last_end < element.value().length
366
- text = REXML::Text.new(element.value()[ last_end, element.value().length - last_end ])
367
- parent.add(text)
368
+ # text = REXML::Text.new(element.value()[ last_end, element.value().length - last_end ])
369
+ # parent.add(text)
370
+ # add text without creating a textnode, textnode screws up formatting (e.g. all whitespace are condensed into one)
371
+ parent.add_text( element.value()[ last_end, element.value().length - last_end ] )
368
372
  end
369
373
  end
370
374
  index += 1
@@ -1,5 +1,5 @@
1
1
  module XhtmlReportGenerator
2
- VERSION = '3.0.1'
2
+ VERSION = '3.0.2'
3
3
  end
4
4
 
5
5
  # puts XhtmlReportGenerator::VERSION
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xhtml_report_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manuel Widmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-21 00:00:00.000000000 Z
11
+ date: 2016-08-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: "The generator can be used to create html or xhtml files. It comes with
14
14
  many utility functions.\n \nThe javascript to render the table of contents, the
@@ -51,9 +51,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  version: '0'
52
52
  requirements: []
53
53
  rubyforge_project:
54
- rubygems_version: 2.4.5.1
54
+ rubygems_version: 2.6.2
55
55
  signing_key:
56
56
  specification_version: 4
57
57
  summary: A simple html or xhtml generator or logger to create human readable reports
58
58
  and logs
59
59
  test_files: []
60
+ has_rdoc: