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 +0 -0
- data/History.txt +3 -0
- data/README.txt +14 -10
- data/Rakefile +5 -6
- data/lib/reportbuilder.rb +3 -5
- data/lib/reportbuilder/table.rb +0 -1
- data/lib/reportbuilder/table/rtfbuilder.rb +1 -2
- data/lib/reportbuilder/table/textbuilder.rb +0 -1
- data/test/test_table.rb +6 -6
- metadata +25 -50
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
sh %(
|
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
|
-
#
|
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.
|
54
|
+
VERSION = '1.2.3'
|
57
55
|
|
58
56
|
FormatNotFound=Class.new(Exception)
|
59
57
|
# Available formats
|
data/lib/reportbuilder/table.rb
CHANGED
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
|
-
@
|
27
|
-
self << "\n" unless @
|
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
|
-
@
|
33
|
-
self << "\n" unless @
|
32
|
+
@first||=:true
|
33
|
+
self << "\n" unless @first==:true
|
34
34
|
self << t
|
35
|
-
@
|
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
|
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
|
-
|
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-
|
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
|
-
|
44
|
-
|
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
|
-
|
54
|
-
version_requirements: *id001
|
45
|
+
version:
|
55
46
|
- !ruby/object:Gem::Dependency
|
56
47
|
name: text-table
|
57
|
-
|
58
|
-
|
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
|
-
|
67
|
-
version_requirements: *id002
|
55
|
+
version:
|
68
56
|
- !ruby/object:Gem::Dependency
|
69
57
|
name: rubyforge
|
70
|
-
|
71
|
-
|
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
|
-
|
81
|
-
version_requirements: *id003
|
65
|
+
version:
|
82
66
|
- !ruby/object:Gem::Dependency
|
83
67
|
name: nokogiri
|
84
|
-
|
85
|
-
|
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
|
-
|
94
|
-
version_requirements: *id004
|
75
|
+
version:
|
95
76
|
- !ruby/object:Gem::Dependency
|
96
77
|
name: hoe
|
97
|
-
|
98
|
-
|
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
|
-
|
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.
|
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
|