ruport 0.4.11 → 0.4.13
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.
- data/CHANGELOG +29 -1
- data/README +16 -26
- data/Rakefile +2 -1
- data/TODO +2 -16
- data/examples/report.rb +35 -0
- data/examples/template.rb +15 -0
- data/examples/text_processors.rb +20 -0
- data/lib/ruport.rb +9 -12
- data/lib/ruport/config.rb +2 -2
- data/lib/ruport/data_set.rb +10 -7
- data/lib/ruport/format.rb +58 -36
- data/lib/ruport/format/engine.rb +1 -1
- data/lib/ruport/format/plugin.rb +4 -3
- data/lib/ruport/mailer.rb +10 -9
- data/lib/ruport/query.rb +7 -14
- data/lib/ruport/report.rb +233 -32
- data/test/tc_config.rb +2 -2
- data/test/tc_data_set.rb +0 -1
- data/test/tc_query.rb +5 -0
- data/test/tc_report.rb +36 -1
- data/test/tc_ruport.rb +1 -1
- data/test/unit.log +111 -2506
- metadata +17 -9
- data/examples/create.sql +0 -2
- data/examples/pdf.rb +0 -36
- data/examples/sql_query.rb +0 -19
- data/test/tc_reading.rb +0 -60
metadata
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: ruport
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.4.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.4.13
|
7
|
+
date: 2006-07-09 00:00:00 -04:00
|
8
8
|
summary: A generalized Ruby report generation and templating engine.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -31,12 +31,12 @@ authors:
|
|
31
31
|
files:
|
32
32
|
- examples/fieldless_table.rb
|
33
33
|
- examples/line_plotter.rb
|
34
|
+
- examples/text_processors.rb
|
34
35
|
- examples/new_plugin.rb
|
35
|
-
- examples/pdf.rb
|
36
36
|
- examples/long.txt
|
37
|
+
- examples/report.rb
|
37
38
|
- examples/simple_mail.rb
|
38
|
-
- examples/
|
39
|
-
- examples/create.sql
|
39
|
+
- examples/template.rb
|
40
40
|
- lib/ruport
|
41
41
|
- lib/ruport.rb
|
42
42
|
- lib/uport.rb
|
@@ -45,13 +45,13 @@ files:
|
|
45
45
|
- lib/ruport/rails
|
46
46
|
- lib/ruport/data_row.rb
|
47
47
|
- lib/ruport/data_set.rb
|
48
|
+
- lib/ruport/system_extensions.rb
|
48
49
|
- lib/ruport/config.rb
|
49
50
|
- lib/ruport/query.rb
|
50
51
|
- lib/ruport/format.rb
|
51
52
|
- lib/ruport/mailer.rb
|
52
53
|
- lib/ruport/rails.rb
|
53
54
|
- lib/ruport/report.rb
|
54
|
-
- lib/ruport/system_extensions.rb
|
55
55
|
- lib/ruport/query/sql_split.rb
|
56
56
|
- lib/ruport/format/document.rb
|
57
57
|
- lib/ruport/format/plugin.rb
|
@@ -71,17 +71,16 @@ files:
|
|
71
71
|
- test/tc_query.rb
|
72
72
|
- test/tc_config.rb
|
73
73
|
- test/ts_format.rb
|
74
|
-
- test/tc_reading.rb
|
75
74
|
- test/tc_sql_split.rb
|
76
75
|
- test/tc_report.rb
|
77
76
|
- test/tc_page.rb
|
78
77
|
- test/unit.log
|
79
78
|
- test/tc_document.rb
|
80
79
|
- test/tc_data_set.rb
|
80
|
+
- test/samples/ruport_test.sql
|
81
81
|
- test/samples/test.yaml
|
82
82
|
- test/samples/data.csv
|
83
83
|
- test/samples/stonecodeblog.sql
|
84
|
-
- test/samples/ruport_test.sql
|
85
84
|
- test/samples/addressbook.csv
|
86
85
|
- test/samples/document.xml
|
87
86
|
- test/samples/test.sql
|
@@ -140,3 +139,12 @@ dependencies:
|
|
140
139
|
- !ruby/object:Gem::Version
|
141
140
|
version: 1.1.3
|
142
141
|
version:
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: mailfactory
|
144
|
+
version_requirement:
|
145
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
146
|
+
requirements:
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: 1.2.2
|
150
|
+
version:
|
data/examples/create.sql
DELETED
data/examples/pdf.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "ruport"
|
3
|
-
|
4
|
-
# needs a DSL, but heres a sort of Raw support here.
|
5
|
-
# will improve when linked into the new plugin system
|
6
|
-
|
7
|
-
element = Ruport::Format::Element.new :e,
|
8
|
-
:content => "Hello Ruport PDF rendering!",
|
9
|
-
:top => 2, :left => 4, :right => 4
|
10
|
-
|
11
|
-
element2 = Ruport::Format::Element.new :e2,
|
12
|
-
:content => File.read("examples/long.txt"),
|
13
|
-
:top => 20, :left => 2, :right => 2
|
14
|
-
|
15
|
-
section = Ruport::Format::Section.new :s
|
16
|
-
section << element
|
17
|
-
|
18
|
-
section2 = Ruport::Format::Section.new :s2
|
19
|
-
section2 << element2
|
20
|
-
|
21
|
-
page = Ruport::Format::Section.new :p
|
22
|
-
page << section
|
23
|
-
|
24
|
-
page2 = Ruport::Format::Page.new :p2
|
25
|
-
page2 << section2
|
26
|
-
|
27
|
-
document = Ruport::Format::Document.new :d
|
28
|
-
|
29
|
-
document << page
|
30
|
-
document << page2
|
31
|
-
|
32
|
-
|
33
|
-
pdf_builder = Ruport::Format::Builder.new(document)
|
34
|
-
pdf_builder.format = :pdf_document
|
35
|
-
|
36
|
-
puts pdf_builder.render
|
data/examples/sql_query.rb
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
require "rubygems"
|
2
|
-
require "ruport"
|
3
|
-
Ruport.configure { |c|
|
4
|
-
c.source :default, :dsn => "dbi:mysql:ruport", :user => "root"
|
5
|
-
}
|
6
|
-
|
7
|
-
SQL = <<-EOS
|
8
|
-
drop table if exists people;
|
9
|
-
create table people(
|
10
|
-
id int not null auto_increment,
|
11
|
-
name text,
|
12
|
-
email varchar(50),
|
13
|
-
primary key (id)
|
14
|
-
);
|
15
|
-
insert into people VALUES(NULL, 'gregory', 'g@g.com')
|
16
|
-
EOS
|
17
|
-
|
18
|
-
Ruport::Query.new(SQL).execute
|
19
|
-
p Ruport::Query.new("select * from people").result
|
data/test/tc_reading.rb
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
#!/usr/local/bin/ruby -w
|
2
|
-
|
3
|
-
# tc_reading.rb
|
4
|
-
#
|
5
|
-
# Created by James Edward Gray II on 2005-08-14.
|
6
|
-
# Copyright 2005 Gray Productions. All rights reserved.
|
7
|
-
|
8
|
-
require "test/unit"
|
9
|
-
|
10
|
-
require "ruport/parser"
|
11
|
-
|
12
|
-
class TestReading < Test::Unit::TestCase
|
13
|
-
def test_line_by_line_read
|
14
|
-
path = File.join(File.dirname(__FILE__), "samples/five_lines.txt")
|
15
|
-
lines = File.readlines(path)
|
16
|
-
test = self
|
17
|
-
|
18
|
-
Ruport::Parser.new(path) do
|
19
|
-
read { |line| test.assert_equal(lines.shift, line) }
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def test_paragraph_read
|
24
|
-
path = File.join(File.dirname(__FILE__), "samples/five_paragraphs.txt")
|
25
|
-
paragraphs = File.readlines(path, "")
|
26
|
-
test = self
|
27
|
-
|
28
|
-
Ruport::Parser.new(path, "") do
|
29
|
-
read { |paragraph| test.assert_equal(paragraphs.shift, paragraph) }
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def test_restricted_reading
|
34
|
-
path = File.join(File.dirname(__FILE__), "samples/five_lines.txt")
|
35
|
-
numbers = %w{two three}
|
36
|
-
test = self
|
37
|
-
|
38
|
-
Ruport::Parser.new(path) do
|
39
|
-
read(/ (t\w+)\./) do |number|
|
40
|
-
test.assert_equal("This is line #{numbers.first}.\n", @read)
|
41
|
-
test.assert_equal(numbers.shift, number)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_data_saving_and_retrieving
|
47
|
-
path = File.join(File.dirname(__FILE__), "samples/five_lines.txt")
|
48
|
-
|
49
|
-
data = Ruport::Parser.new( path ) do
|
50
|
-
read(/ (o\w+)\./) { |number| @number = number }
|
51
|
-
read { |line| (@lines ||= Array.new) << line }
|
52
|
-
end
|
53
|
-
|
54
|
-
assert_equal("one", data[:number])
|
55
|
-
assert_equal("one", data.number)
|
56
|
-
assert_equal(path, data.path)
|
57
|
-
assert_equal(5, data.lines.size)
|
58
|
-
assert_equal(File.readlines(path), data.lines)
|
59
|
-
end
|
60
|
-
end
|