odf-report 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,8 @@ module ODFReport
18
18
 
19
19
  def get_collection_from_item(item, collection_field)
20
20
 
21
+ return item[collection_field] if item.is_a?(Hash)
22
+
21
23
  if collection_field.is_a?(Array)
22
24
  tmp = item.dup
23
25
  collection_field.each do |f|
@@ -80,9 +80,7 @@ module ODFReport
80
80
 
81
81
  def find_section_node(doc)
82
82
 
83
- prefix = @parent ? "" : "//"
84
-
85
- sections = doc.xpath("#{prefix}text:section[@text:name='#{@name}']")
83
+ sections = doc.xpath(".//text:section[@text:name='#{@name}']")
86
84
 
87
85
  sections.empty? ? nil : sections.first
88
86
 
@@ -83,9 +83,7 @@ private
83
83
 
84
84
  def find_table_node(doc)
85
85
 
86
- prefix = @parent ? "" : "//"
87
-
88
- tables = doc.xpath("#{prefix}table:table[@table:name='#{@name}']")
86
+ tables = doc.xpath(".//table:table[@table:name='#{@name}']")
89
87
 
90
88
  tables.empty? ? nil : tables.first
91
89
 
data/odf-report.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{odf-report}
5
- s.version = "0.4.1"
5
+ s.version = "0.4.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sandro Duarte"]
9
- s.date = %q{2011-10-03}
9
+ s.date = %q{2011-12-27}
10
10
  s.description = %q{Generates ODF files, given a template (.odt) and data, replacing tags}
11
11
  s.email = %q{sandrods@gmail.com}
12
12
  s.extra_rdoc_files = ["lib/odf-report.rb", "README.textile"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: odf-report
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-03 00:00:00.000000000Z
12
+ date: 2011-12-27 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rubyzip
16
- requirement: &2152768780 !ruby/object:Gem::Requirement
16
+ requirement: &2153027700 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -24,10 +24,10 @@ dependencies:
24
24
  version: 0.9.4
25
25
  type: :runtime
26
26
  prerelease: false
27
- version_requirements: *2152768780
27
+ version_requirements: *2153027700
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: nokogiri
30
- requirement: &2152767820 !ruby/object:Gem::Requirement
30
+ requirement: &2153026760 !ruby/object:Gem::Requirement
31
31
  none: false
32
32
  requirements:
33
33
  - - ! '>='
@@ -38,7 +38,7 @@ dependencies:
38
38
  version: 1.5.0
39
39
  type: :runtime
40
40
  prerelease: false
41
- version_requirements: *2152767820
41
+ version_requirements: *2153026760
42
42
  description: Generates ODF files, given a template (.odt) and data, replacing tags
43
43
  email: sandrods@gmail.com
44
44
  executables: []