reportbuilder 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,6 @@
1
+ === 1.2.3 / 2010-04-13
2
+ * Source code repository moved to http://github.com/clbustos/reportbuilder
3
+
1
4
  === 1.2.2 / 2010-04-06
2
5
  * Bug fix: Table should be parsed with #preformatted, not #text on Text output
3
6
 
data/README.txt CHANGED
@@ -21,16 +21,16 @@ Report Abstract Interface. Creates text, html and rtf output, based on a common
21
21
  * report_building or
22
22
  * to_s
23
23
 
24
- require "reportbuilder"
25
- rb=ReportBuilder.new
26
- rb.add(2) # Int#to_s used
27
- table=ReportBuilder::Table.new(:name=>"Table", :header=>%w{id name})
28
- table.row([1,"John"])
29
- rb.add(table) # table have a #report_building method
30
- rb.add("Another text") # used directly
31
- rb.name="Text output"
32
- puts rb.to_text
33
- rb.save_rtf("test.rtf") # You could save files, too
24
+ require "reportbuilder"
25
+ rb=ReportBuilder.new
26
+ rb.add(2) # Int#to_s used
27
+ table=ReportBuilder::Table.new(:name=>"Table", :header=>%w{id name})
28
+ table.row([1,"John"])
29
+ rb.add(table) # table have a #report_building method
30
+ rb.add("Another text") # used directly
31
+ rb.name="Text output"
32
+ puts rb.to_text
33
+ rb.save_rtf("test.rtf") # You could save files, too
34
34
 
35
35
  * Using a block, you can control directly the generator
36
36
 
@@ -53,6 +53,10 @@ If you want to give support to your class, create a method called #report_buildi
53
53
 
54
54
  See ReportBuilder::Builder for API and ReportBuilder::Table, ReportBuilder::Image and ReportBuilder::Section for examples of implementation. Also, Statsample package object uses report_building on almost every class.
55
55
 
56
+ Source code could be retrieved from
57
+ http://github.com/clbustos/reportbuilder
58
+
59
+
56
60
  == REQUIREMENTS:
57
61
 
58
62
  * RMagick, only to generate text output of images (see examples/image.rb)
data/Rakefile CHANGED
@@ -16,12 +16,11 @@ Hoe.spec 'reportbuilder' do
16
16
  self.extra_dev_deps << ["nokogiri", "~>1.4"]
17
17
  end
18
18
 
19
- task :release => [:tag] do
20
- end
21
-
22
- task :tag do
23
- sh %(svn commit -m "Version bump: #{ReportBuilder::VERSION}")
24
- sh %(svn cp https://ruby-statsample.googlecode.com/svn/reportbuilder/trunk https://ruby-statsample.googlecode.com/svn/reportbuilder/tags/v#{ReportBuilder::VERSION} -m "ReportBuilder #{ReportBuilder::VERSION} tagged")
19
+ task :release do
20
+ version="v#{ReportBuilder::VERSION}"
21
+ sh %(git commit -a -m "Release #{version}")
22
+ sh %(git tag "#{version}")
23
+ sh %(git push origin --tags)
25
24
  end
26
25
 
27
26
  # vim: syntax=ruby
data/lib/reportbuilder.rb CHANGED
@@ -8,8 +8,7 @@ require 'reportbuilder/image'
8
8
  #
9
9
  # == Use
10
10
  #
11
- #
12
- # * Using generic ReportBuilder#add, every object will be parsed using #report_building_FORMAT, #report_building or #to_s
11
+ # 1) Using generic ReportBuilder#add, every object will be parsed using methods report_building_FORMAT, #report_building or #to_s
13
12
  #
14
13
  # require "reportbuilder"
15
14
  # rb=ReportBuilder.new
@@ -19,7 +18,6 @@ require 'reportbuilder/image'
19
18
  # table.row([1,"John"])
20
19
  # table.hr
21
20
  # table.row([2,"Peter"])
22
- #
23
21
  # section.add(table) # Section is a container for other methods
24
22
  # rb.add(section) # table have a #report_building method
25
23
  # rb.add("Another text") # used directly
@@ -28,7 +26,7 @@ require 'reportbuilder/image'
28
26
  # rb.name="Html output"
29
27
  # puts rb.to_html
30
28
  #
31
- # * Using a block, you can control directly the builder
29
+ # 2) Using a block, you can control directly the builder
32
30
  #
33
31
  # require "reportbuilder"
34
32
  # rb=ReportBuilder.new do
@@ -53,7 +51,7 @@ class ReportBuilder
53
51
  # Doesn't print a title if set to true
54
52
  attr_accessor :no_title
55
53
  # ReportBuilder version
56
- VERSION = '1.2.2'
54
+ VERSION = '1.2.3'
57
55
 
58
56
  FormatNotFound=Class.new(Exception)
59
57
  # Available formats
@@ -1,4 +1,3 @@
1
-
2
1
  class ReportBuilder
3
2
  # Creates a table.
4
3
  # Use:
@@ -21,9 +21,8 @@ class ReportBuilder
21
21
  @table[0][i] << th
22
22
  end
23
23
  end
24
- row_i=1
25
24
  next_with_hr=false
26
- @t.rows.each_with_index{|row,row_i|
25
+ @t.rows.each_with_index{|row, row_i|
27
26
  if row==:hr
28
27
  next_with_hr=true
29
28
  # Nothing
@@ -7,7 +7,6 @@ class ReportBuilder
7
7
 
8
8
  class TextBuilder < ElementBuilder
9
9
  def generate()
10
-
11
10
  t=@element
12
11
  @rowspans=[]
13
12
  @builder.text(t.name)
data/test/test_table.rb CHANGED
@@ -23,22 +23,22 @@ class TestReportbuilderTable < MiniTest::Unit::TestCase
23
23
  @mock_generator = ""
24
24
  class << @mock_generator
25
25
  def preformatted(t)
26
- @first_pre||=true
27
- self << "\n" unless @first_pre
26
+ @first||=:true
27
+ self << "\n" unless @first==:true
28
28
  self << t
29
29
  @first=false
30
30
  end
31
31
  def text(t)
32
- @first_text||=:true
33
- self << "\n" unless @first_text==:true
32
+ @first||=:true
33
+ self << "\n" unless @first==:true
34
34
  self << t
35
- @first_text=:false
35
+ @first=:false
36
36
  end
37
37
  def table_entry(t)
38
38
  "MOCK"
39
39
  end
40
40
  def html(t)
41
- @first_html||=true
41
+ @first_html||=:true
42
42
  self << "\n" unless @first_html
43
43
  self << t
44
44
  @first=false
metadata CHANGED
@@ -1,12 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reportbuilder
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 1
7
- - 2
8
- - 2
9
- version: 1.2.2
4
+ version: 1.2.3
10
5
  platform: ruby
11
6
  authors:
12
7
  - Claudio Bustos
@@ -35,77 +30,59 @@ cert_chain:
35
30
  rpP0jjs0
36
31
  -----END CERTIFICATE-----
37
32
 
38
- date: 2010-04-06 00:00:00 -04:00
33
+ date: 2010-04-13 00:00:00 -04:00
39
34
  default_executable:
40
35
  dependencies:
41
36
  - !ruby/object:Gem::Dependency
42
37
  name: clbustos-rtf
43
- prerelease: false
44
- requirement: &id001 !ruby/object:Gem::Requirement
38
+ type: :runtime
39
+ version_requirement:
40
+ version_requirements: !ruby/object:Gem::Requirement
45
41
  requirements:
46
42
  - - ~>
47
43
  - !ruby/object:Gem::Version
48
- segments:
49
- - 0
50
- - 2
51
- - 1
52
44
  version: 0.2.1
53
- type: :runtime
54
- version_requirements: *id001
45
+ version:
55
46
  - !ruby/object:Gem::Dependency
56
47
  name: text-table
57
- prerelease: false
58
- requirement: &id002 !ruby/object:Gem::Requirement
48
+ type: :runtime
49
+ version_requirement:
50
+ version_requirements: !ruby/object:Gem::Requirement
59
51
  requirements:
60
52
  - - ~>
61
53
  - !ruby/object:Gem::Version
62
- segments:
63
- - 1
64
- - 2
65
54
  version: "1.2"
66
- type: :runtime
67
- version_requirements: *id002
55
+ version:
68
56
  - !ruby/object:Gem::Dependency
69
57
  name: rubyforge
70
- prerelease: false
71
- requirement: &id003 !ruby/object:Gem::Requirement
58
+ type: :development
59
+ version_requirement:
60
+ version_requirements: !ruby/object:Gem::Requirement
72
61
  requirements:
73
62
  - - ">="
74
63
  - !ruby/object:Gem::Version
75
- segments:
76
- - 2
77
- - 0
78
- - 4
79
64
  version: 2.0.4
80
- type: :development
81
- version_requirements: *id003
65
+ version:
82
66
  - !ruby/object:Gem::Dependency
83
67
  name: nokogiri
84
- prerelease: false
85
- requirement: &id004 !ruby/object:Gem::Requirement
68
+ type: :development
69
+ version_requirement:
70
+ version_requirements: !ruby/object:Gem::Requirement
86
71
  requirements:
87
72
  - - ~>
88
73
  - !ruby/object:Gem::Version
89
- segments:
90
- - 1
91
- - 4
92
74
  version: "1.4"
93
- type: :development
94
- version_requirements: *id004
75
+ version:
95
76
  - !ruby/object:Gem::Dependency
96
77
  name: hoe
97
- prerelease: false
98
- requirement: &id005 !ruby/object:Gem::Requirement
78
+ type: :development
79
+ version_requirement:
80
+ version_requirements: !ruby/object:Gem::Requirement
99
81
  requirements:
100
82
  - - ">="
101
83
  - !ruby/object:Gem::Version
102
- segments:
103
- - 2
104
- - 6
105
- - 0
106
84
  version: 2.6.0
107
- type: :development
108
- version_requirements: *id005
85
+ version:
109
86
  description: Report Abstract Interface. Creates text, html and rtf output, based on a common framework.
110
87
  email:
111
88
  - clbustos_at_gmail.com
@@ -161,20 +138,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
138
  requirements:
162
139
  - - ">="
163
140
  - !ruby/object:Gem::Version
164
- segments:
165
- - 0
166
141
  version: "0"
142
+ version:
167
143
  required_rubygems_version: !ruby/object:Gem::Requirement
168
144
  requirements:
169
145
  - - ">="
170
146
  - !ruby/object:Gem::Version
171
- segments:
172
- - 0
173
147
  version: "0"
148
+ version:
174
149
  requirements: []
175
150
 
176
151
  rubyforge_project: ruby-statsample
177
- rubygems_version: 1.3.6
152
+ rubygems_version: 1.3.5
178
153
  signing_key:
179
154
  specification_version: 3
180
155
  summary: Report Abstract Interface
metadata.gz.sig CHANGED
Binary file