reportbuilder 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,6 @@
1
+ === 1.2.5 / 2010-04-30
2
+ * Changed dependency on clbustos-rtf to 0.3.0
3
+
1
4
  === 1.2.4 / 2010-04-30
2
5
  * Bug fix on Rtf Builder for tables. Creation of hr generates an error
3
6
 
@@ -22,6 +22,7 @@ lib/reportbuilder/table.rb
22
22
  lib/reportbuilder/table/htmlbuilder.rb
23
23
  lib/reportbuilder/table/rtfbuilder.rb
24
24
  lib/reportbuilder/table/textbuilder.rb
25
+ test/helper_test.rb
25
26
  test/test_html.rb
26
27
  test/test_image.rb
27
28
  test/test_reportbuilder.rb
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ Hoe.spec 'reportbuilder' do
12
12
  self.rubyforge_name = 'ruby-statsample'
13
13
  self.developer('Claudio Bustos', 'clbustos_at_gmail.com')
14
14
  self.url = "http://ruby-statsample.rubyforge.org/reportbuilder/"
15
- self.extra_deps << ["clbustos-rtf","~>0.2.1"] << ['text-table', "~>1.2"]
15
+ self.extra_deps << ["clbustos-rtf","~>0.3.0"] << ['text-table', "~>1.2"]
16
16
  self.extra_dev_deps << ["nokogiri", "~>1.4"]
17
17
  end
18
18
 
@@ -51,7 +51,7 @@ class ReportBuilder
51
51
  # Doesn't print a title if set to true
52
52
  attr_accessor :no_title
53
53
  # ReportBuilder version
54
- VERSION = '1.2.4'
54
+ VERSION = '1.2.5'
55
55
 
56
56
  FormatNotFound=Class.new(Exception)
57
57
  # Available formats
@@ -22,8 +22,8 @@ class ReportBuilder::Image
22
22
  end
23
23
  # Based on http://rubyquiz.com/quiz50.html
24
24
  def report_building_text(builder)
25
- require 'RMagick'
26
-
25
+
26
+ require 'RMagick'
27
27
 
28
28
  img = Magick::Image.read(@filename).first
29
29
 
@@ -0,0 +1,12 @@
1
+ begin
2
+ require 'RMagick'
3
+ $rmagick=true
4
+ rescue LoadError
5
+ $rmagick=false
6
+ end
7
+ $:.unshift(File.dirname(__FILE__)+"/../lib")
8
+ require 'nokogiri'
9
+ require 'minitest/unit'
10
+ require 'tmpdir'
11
+ require "reportbuilder"
12
+ MiniTest::Unit.autorun
@@ -1,11 +1,8 @@
1
- require "minitest/unit"
2
- $:.unshift(File.dirname(__FILE__)+"/../lib")
3
- require "reportbuilder"
1
+ require(File.dirname(__FILE__)+"/helper_test.rb")
4
2
  require 'fileutils'
5
3
  require 'tmpdir'
6
- require 'nokogiri'
7
4
  require 'tempfile'
8
- MiniTest::Unit.autorun
5
+
9
6
  class TestReportbuilderHtml < MiniTest::Unit::TestCase
10
7
  def setup
11
8
  @tmpdir=Dir::mktmpdir
@@ -1,8 +1,5 @@
1
- $:.unshift(File.dirname(__FILE__)+"/../lib")
2
- require 'minitest/unit'
3
- require 'tmpdir'
4
- require "reportbuilder"
5
- MiniTest::Unit.autorun
1
+ require(File.dirname(__FILE__)+"/helper_test.rb")
2
+
6
3
  class TestReportbuilderImage < MiniTest::Unit::TestCase
7
4
  def setup
8
5
  @tmpdir=Dir::mktmpdir
@@ -14,6 +11,7 @@ class TestReportbuilderImage < MiniTest::Unit::TestCase
14
11
  FileUtils.remove_entry_secure @tmpdir
15
12
  end
16
13
  def test_image_text
14
+
17
15
  expected= <<-HERE
18
16
  Test
19
17
  +--------------------------------+
@@ -33,9 +31,13 @@ Test
33
31
  | **#***** |
34
32
  +--------------------------------+
35
33
  HERE
34
+ if $rmagick
36
35
  real=@rp.to_s
37
36
  #expected=expected.gsub(/[^ ]/,'-')
38
37
  assert_match(/[^\s]{12}$/,real)
38
+ else
39
+ skip "Requires RMagick"
40
+ end
39
41
  end
40
42
  def test_image_html
41
43
  assert_match(/img src='images\/sheep.jpg'/, @rp.to_html)
@@ -1,8 +1,4 @@
1
- require "minitest/unit"
2
- $:.unshift(File.dirname(__FILE__)+"/../lib")
3
- require "reportbuilder"
4
- require 'tempfile'
5
- MiniTest::Unit.autorun
1
+ require(File.dirname(__FILE__)+"/helper_test.rb")
6
2
  class TestReportbuilder < MiniTest::Unit::TestCase
7
3
  def setup
8
4
  @datadir=File.dirname(__FILE__)+"/../data"
@@ -43,8 +39,9 @@ class TestReportbuilder < MiniTest::Unit::TestCase
43
39
  g.text "para"
44
40
  g.preformatted "pre"
45
41
  g.table(:header=>%w{th1 th2}) {row([1,2]); row([1,3])}
42
+ if $rmagick
46
43
  g.image @image
47
-
44
+ end
48
45
  }
49
46
  rb.add(a)
50
47
  out=rb.to_text
@@ -56,7 +53,9 @@ class TestReportbuilder < MiniTest::Unit::TestCase
56
53
  g.text "para"
57
54
  g.preformatted "pre"
58
55
  g.table(:header=>%w{th1 th2}) {row([1,2]); row([1,3])}
59
- g.image @image
56
+ if $rmagick
57
+ g.image @image
58
+ end
60
59
  }
61
60
 
62
61
  out=rb.to_text
@@ -1,11 +1,8 @@
1
- require "minitest/unit"
2
- $:.unshift(File.dirname(__FILE__)+"/../lib")
3
- require "reportbuilder"
4
- require 'nokogiri'
5
- MiniTest::Unit.autorun
1
+ require(File.dirname(__FILE__)+"/helper_test.rb")
2
+
6
3
  class TestReportbuilderSection < MiniTest::Unit::TestCase
7
4
  def setup
8
- @name="Test Section"
5
+ @name_section="Test Section"
9
6
  @rp=ReportBuilder.new(:name=>"Test Section")
10
7
  s1=ReportBuilder::Section.new(:name=>"Section 1")
11
8
  @rp.add s1
@@ -20,7 +17,7 @@ class TestReportbuilderSection < MiniTest::Unit::TestCase
20
17
  @rp.add s2
21
18
  end
22
19
  def test_section_generate
23
- text=ReportBuilder.generate(:name=>@name,:format=>:text) {
20
+ text=ReportBuilder.generate(:name=>@name_section,:format=>:text) {
24
21
  section(:name=>"Section 1") {
25
22
  text("Texto 1")
26
23
  text("2")
@@ -1,15 +1,13 @@
1
- require "minitest/unit"
2
- $:.unshift(File.dirname(__FILE__)+"/../lib")
3
- require "reportbuilder"
4
- require 'nokogiri'
1
+ require(File.dirname(__FILE__)+"/helper_test.rb")
2
+
3
+ require 'tempfile'
5
4
 
6
- MiniTest::Unit.autorun
7
5
  class TestReportbuilderTable < MiniTest::Unit::TestCase
8
6
  def setup
9
7
  super
10
- @name="Table Test"
8
+ @name_table="Table Test"
11
9
  @header=%w{a bb ccc dddd eeee fff gggg hh i}
12
- table=ReportBuilder::Table.new(:name=>@name, :header=>@header) do
10
+ table=ReportBuilder::Table.new(:name=>@name_table, :header=>@header) do
13
11
  row(["a","b","c","d","e","f","g","h","i"])
14
12
  row([colspan("a",2),"c",'d',rowspan("e",2),rowspan("f",2),"g",rowspan("h",3),"i"])
15
13
  row([colspan("a",3),'d', "g","i"])
@@ -54,11 +52,11 @@ class TestReportbuilderTable < MiniTest::Unit::TestCase
54
52
  end
55
53
 
56
54
  def test_rtf
55
+ tempfile=Tempfile.new('test.rtf')
57
56
  rb=ReportBuilder.new
58
57
  rb.add(@table)
59
- rb.save_rtf("test.rtf")
60
-
61
-
58
+ rb.save_rtf(tempfile.path)
59
+
62
60
  end
63
61
  def test_table_text
64
62
  tg=ReportBuilder::Table::TextBuilder.new(@mock_generator, @table)
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reportbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 2
8
+ - 5
9
+ version: 1.2.5
5
10
  platform: ruby
6
11
  authors:
7
12
  - Claudio Bustos
@@ -30,59 +35,77 @@ cert_chain:
30
35
  rpP0jjs0
31
36
  -----END CERTIFICATE-----
32
37
 
33
- date: 2010-04-30 00:00:00 -04:00
38
+ date: 2010-05-03 00:00:00 -04:00
34
39
  default_executable:
35
40
  dependencies:
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: clbustos-rtf
38
- type: :runtime
39
- version_requirement:
40
- version_requirements: !ruby/object:Gem::Requirement
43
+ prerelease: false
44
+ requirement: &id001 !ruby/object:Gem::Requirement
41
45
  requirements:
42
46
  - - ~>
43
47
  - !ruby/object:Gem::Version
44
- version: 0.2.1
45
- version:
48
+ segments:
49
+ - 0
50
+ - 3
51
+ - 0
52
+ version: 0.3.0
53
+ type: :runtime
54
+ version_requirements: *id001
46
55
  - !ruby/object:Gem::Dependency
47
56
  name: text-table
48
- type: :runtime
49
- version_requirement:
50
- version_requirements: !ruby/object:Gem::Requirement
57
+ prerelease: false
58
+ requirement: &id002 !ruby/object:Gem::Requirement
51
59
  requirements:
52
60
  - - ~>
53
61
  - !ruby/object:Gem::Version
62
+ segments:
63
+ - 1
64
+ - 2
54
65
  version: "1.2"
55
- version:
66
+ type: :runtime
67
+ version_requirements: *id002
56
68
  - !ruby/object:Gem::Dependency
57
69
  name: rubyforge
58
- type: :development
59
- version_requirement:
60
- version_requirements: !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id003 !ruby/object:Gem::Requirement
61
72
  requirements:
62
73
  - - ">="
63
74
  - !ruby/object:Gem::Version
75
+ segments:
76
+ - 2
77
+ - 0
78
+ - 4
64
79
  version: 2.0.4
65
- version:
80
+ type: :development
81
+ version_requirements: *id003
66
82
  - !ruby/object:Gem::Dependency
67
83
  name: nokogiri
68
- type: :development
69
- version_requirement:
70
- version_requirements: !ruby/object:Gem::Requirement
84
+ prerelease: false
85
+ requirement: &id004 !ruby/object:Gem::Requirement
71
86
  requirements:
72
87
  - - ~>
73
88
  - !ruby/object:Gem::Version
89
+ segments:
90
+ - 1
91
+ - 4
74
92
  version: "1.4"
75
- version:
93
+ type: :development
94
+ version_requirements: *id004
76
95
  - !ruby/object:Gem::Dependency
77
96
  name: hoe
78
- type: :development
79
- version_requirement:
80
- version_requirements: !ruby/object:Gem::Requirement
97
+ prerelease: false
98
+ requirement: &id005 !ruby/object:Gem::Requirement
81
99
  requirements:
82
100
  - - ">="
83
101
  - !ruby/object:Gem::Version
102
+ segments:
103
+ - 2
104
+ - 6
105
+ - 0
84
106
  version: 2.6.0
85
- version:
107
+ type: :development
108
+ version_requirements: *id005
86
109
  description: Report Abstract Interface. Creates text, html and rtf output, based on a common framework.
87
110
  email:
88
111
  - clbustos_at_gmail.com
@@ -119,6 +142,7 @@ files:
119
142
  - lib/reportbuilder/table/htmlbuilder.rb
120
143
  - lib/reportbuilder/table/rtfbuilder.rb
121
144
  - lib/reportbuilder/table/textbuilder.rb
145
+ - test/helper_test.rb
122
146
  - test/test_html.rb
123
147
  - test/test_image.rb
124
148
  - test/test_reportbuilder.rb
@@ -138,18 +162,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
162
  requirements:
139
163
  - - ">="
140
164
  - !ruby/object:Gem::Version
165
+ segments:
166
+ - 0
141
167
  version: "0"
142
- version:
143
168
  required_rubygems_version: !ruby/object:Gem::Requirement
144
169
  requirements:
145
170
  - - ">="
146
171
  - !ruby/object:Gem::Version
172
+ segments:
173
+ - 0
147
174
  version: "0"
148
- version:
149
175
  requirements: []
150
176
 
151
177
  rubyforge_project: ruby-statsample
152
- rubygems_version: 1.3.5
178
+ rubygems_version: 1.3.6
153
179
  signing_key:
154
180
  specification_version: 3
155
181
  summary: Report Abstract Interface
metadata.gz.sig CHANGED
Binary file