ruport 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: ruport
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.5.1
7
- date: 2006-09-02 00:00:00 -04:00
6
+ version: 0.5.2
7
+ date: 2006-09-03 00:00:00 -04:00
8
8
  summary: A generalized Ruby report generation and templating engine.
9
9
  require_paths:
10
10
  - lib
@@ -29,84 +29,78 @@ post_install_message:
29
29
  authors:
30
30
  - Gregory Brown
31
31
  files:
32
- - examples/sample_invoice_report.rb
33
32
  - examples/fieldless_table.rb
34
33
  - examples/line_plotter.rb
34
+ - examples/sample_invoice_report.rb
35
35
  - examples/text_processors.rb
36
36
  - examples/new_plugin.rb
37
- - examples/long.txt
37
+ - examples/line_graph.rb
38
38
  - examples/report.rb
39
+ - examples/long.txt
39
40
  - examples/simple_mail.rb
40
41
  - examples/template.rb
41
- - examples/line_graph.rb
42
42
  - lib/ruport
43
43
  - lib/ruport.rb
44
44
  - lib/uport.rb
45
45
  - lib/ruport/query
46
46
  - lib/ruport/format
47
- - lib/ruport/rails
48
47
  - lib/ruport/data
48
+ - lib/ruport/rails
49
49
  - lib/ruport/report
50
- - lib/ruport/system_extensions.rb.rej
51
50
  - lib/ruport/system_extensions.rb
52
51
  - lib/ruport/config.rb
53
52
  - lib/ruport/query.rb
53
+ - lib/ruport/meta_tools.rb
54
54
  - lib/ruport/format.rb
55
+ - lib/ruport/data.rb
55
56
  - lib/ruport/mailer.rb
56
57
  - lib/ruport/rails.rb
57
58
  - lib/ruport/report.rb
58
- - lib/ruport/data.rb
59
- - lib/ruport/meta_tools.rb
60
59
  - lib/ruport/query/sql_split.rb
61
- - lib/ruport/format/plugin.rb
62
- - lib/ruport/format/engine.rb
63
60
  - lib/ruport/format/engine
64
61
  - lib/ruport/format/plugin
62
+ - lib/ruport/format/plugin.rb
63
+ - lib/ruport/format/engine.rb
65
64
  - lib/ruport/format/engine/document.rb
66
65
  - lib/ruport/format/engine/graph.rb
67
- - lib/ruport/format/engine/invoice.rb
68
66
  - lib/ruport/format/engine/table.rb
69
- - lib/ruport/format/plugin/csv_plugin.rb
70
- - lib/ruport/format/plugin/html_plugin.rb
71
- - lib/ruport/format/plugin/pdf_plugin.rb
67
+ - lib/ruport/format/engine/invoice.rb
72
68
  - lib/ruport/format/plugin/svg_plugin.rb
69
+ - lib/ruport/format/plugin/html_plugin.rb
73
70
  - lib/ruport/format/plugin/text_plugin.rb
74
- - lib/ruport/rails/reportable.rb
75
- - lib/ruport/data/taggable.rb
76
- - lib/ruport/data/table.rb
71
+ - lib/ruport/format/plugin/pdf_plugin.rb
72
+ - lib/ruport/format/plugin/csv_plugin.rb
77
73
  - lib/ruport/data/collection.rb
78
74
  - lib/ruport/data/record.rb
79
- - lib/ruport/data/set.rb~
80
- - lib/ruport/data/set.rb.rej
75
+ - lib/ruport/data/taggable.rb
76
+ - lib/ruport/data/table.rb
81
77
  - lib/ruport/data/set.rb
78
+ - lib/ruport/rails/reportable.rb
82
79
  - lib/ruport/report/invoice.rb
83
80
  - test/samples
84
- - test/_test_database.rb
85
- - test/test_set.rb.rej
81
+ - test/test_collection.rb
86
82
  - test/test_record.rb
87
- - test/test_set.rb
88
83
  - test/test_table.rb
89
84
  - test/test_format.rb
90
- - test/test_config.rb
85
+ - test/test_set.rb
91
86
  - test/test_ruport.rb
87
+ - test/_test_database.rb
92
88
  - test/test_invoice.rb
93
89
  - test/test_plugin.rb
94
- - test/test_set.rb~
95
- - test/test_sql_split.rb
96
90
  - test/test_graph.rb
97
- - test/unit.log
98
91
  - test/test_meta_tools.rb
99
- - test/test_mailer.rb
100
92
  - test/test_query.rb
93
+ - test/test_config.rb
94
+ - test/test_sql_split.rb
101
95
  - test/test_taggable.rb
96
+ - test/test_mailer.rb
97
+ - test/unit.log
102
98
  - test/test_report.rb
103
- - test/test_plugin.rb.rej
104
99
  - test/test_format_engine.rb
105
- - test/test_collection.rb
106
- - test/samples/stonecodeblog.sql
107
100
  - test/samples/ruport_test.sql
108
101
  - test/samples/test.yaml
109
102
  - test/samples/data.csv
103
+ - test/samples/stonecodeblog.sql
110
104
  - test/samples/addressbook.csv
111
105
  - test/samples/document.xml
112
106
  - test/samples/test.sql
@@ -119,23 +113,23 @@ files:
119
113
  - AUTHORS
120
114
  - CHANGELOG
121
115
  test_files:
116
+ - test/test_collection.rb
122
117
  - test/test_record.rb
123
- - test/test_set.rb
124
118
  - test/test_table.rb
125
119
  - test/test_format.rb
126
- - test/test_config.rb
120
+ - test/test_set.rb
127
121
  - test/test_ruport.rb
128
122
  - test/test_invoice.rb
129
123
  - test/test_plugin.rb
130
- - test/test_sql_split.rb
131
124
  - test/test_graph.rb
132
125
  - test/test_meta_tools.rb
133
- - test/test_mailer.rb
134
126
  - test/test_query.rb
127
+ - test/test_config.rb
128
+ - test/test_sql_split.rb
135
129
  - test/test_taggable.rb
130
+ - test/test_mailer.rb
136
131
  - test/test_report.rb
137
132
  - test/test_format_engine.rb
138
- - test/test_collection.rb
139
133
  rdoc_options:
140
134
  - --title
141
135
  - Ruport Documentation
@@ -1,147 +0,0 @@
1
- ***************
2
- *** 8,27 ****
3
- module Ruport::Data
4
- class Set < Collection
5
-
6
- def initialize(options={})
7
- @data = ::Set.new
8
- options[:data].each {|e| self << e} if options[:data]
9
- end
10
-
11
- - def <<(other)
12
- case other
13
- when Record
14
- @data << other
15
- when Array
16
- @data << Record.new(other)
17
- end
18
- end
19
-
20
- def dup
21
- a = self.class.new(:data=>@data)
22
- a.tags = tags.dup
23
- --- 8,42 ----
24
- module Ruport::Data
25
- class Set < Collection
26
-
27
- + # Creates a new set containing the elements of options[:data].
28
- + #
29
- + # Set.new :data => [%w[one two three] %w[1 2 3] %w[I II III]]
30
- def initialize(options={})
31
- @data = ::Set.new
32
- options[:data].each {|e| self << e} if options[:data]
33
- end
34
-
35
- + # Adds the given object to the set and returns self.
36
- + # set = Set.new :data => [%w[one two three]]
37
- + # set << [5,6,7]
38
- + def add(other)
39
- case other
40
- when Record
41
- @data << other
42
- when Array
43
- @data << Record.new(other)
44
- end
45
- + self
46
- end
47
- + alias_method :<<, :add
48
-
49
- + # Produces a shallow copy of the set: the same data is referenced by both
50
- + # the old and new sets.
51
- + # set = Set.new :data => [%w[one two three]]
52
- + # set2 = set.dup
53
- + # set == set2 => true
54
- + # set << [8,9,10]
55
- + # set == set2 => false
56
- def dup
57
- a = self.class.new(:data=>@data)
58
- a.tags = tags.dup
59
- ***************
60
- *** 29,53 ****
61
- end
62
- alias_method :clone, :dup
63
-
64
- def ==(other)
65
- @data == other.data
66
- end
67
-
68
- def |(other)
69
- Set.new :data => (@data | other.data)
70
- end
71
- alias_method :union, :|
72
-
73
- def &(other)
74
- Set.new :data => (@data & other.data)
75
- end
76
- alias_method :intersection, :&
77
-
78
- - # Set difference
79
- def -(other)
80
- Set.new :data => (@data - other.data)
81
- end
82
- alias_method :difference, :-
83
-
84
- def_delegators :@data, :each
85
- end
86
- --- 44,104 ----
87
- end
88
- alias_method :clone, :dup
89
-
90
- + # Equality. Two sets are equal if they contain the same set of objects.
91
- + # s1 = Set.new :data => [[1,2,3]]
92
- + # s2 = Set.new :data => [[1,2,3]]
93
- + # s1 == s2 => true
94
- def ==(other)
95
- @data == other.data
96
- end
97
-
98
- + # Union. Returns a new set containing the union of the objects contained in
99
- + # the two sets.
100
- + # s1 = Set.new :data => [[1,2,3]]
101
- + # s2 = Set.new :data => [[4,5,6]]
102
- + # s3 = s1 | s2
103
- + # s4 = Set.new :data => [[1,2,3], [4,5,6]]
104
- + # s3 == s4 => true
105
- def |(other)
106
- Set.new :data => (@data | other.data)
107
- end
108
- alias_method :union, :|
109
- + alias_method :+, :|
110
-
111
- + # Intersection. Returns a new set containing the objects common to the two
112
- + # sets.
113
- + # s1 = Set.new :data => [%w[a b c],[1,2,3]]
114
- + # s2 = Set.new :data => [%w[a b c],[4,5,6]]
115
- + # s3 = s1 | s2
116
- + # s4 = Set.new :data => [%w[a b c]]
117
- + # s3 == s4 => true
118
- def &(other)
119
- Set.new :data => (@data & other.data)
120
- end
121
- alias_method :intersection, :&
122
-
123
- + # Difference. Returns a new set containing those objects present in this
124
- + # set but not the other.
125
- + # s1 = Set.new :data => [%w[a b c],[1,2,3]]
126
- + # s2 = Set.new :data => [%w[a b c],[4,5,6]]
127
- + # s3 = s1 | s2
128
- + # s4 = Set.new :data => [[1, 2, 3]]
129
- + # s3 == s4 => true
130
- def -(other)
131
- Set.new :data => (@data - other.data)
132
- end
133
- alias_method :difference, :-
134
- +
135
- + # Exclusion. Returns a new set containing those objects in this set or the
136
- + # other set but not in both.
137
- + # s1 = Set.new :data => [%w[a b c],[1,2,3]]
138
- + # s2 = Set.new :data => [%w[a b c],[4,5,6]]
139
- + # s3 = s1 | s2
140
- + # s4 = Set.new :data => [[1, 2, 3],[4,5,6]]
141
- + # s3 == s4 => true
142
- + def ^(other)
143
- + Set.new :data => (@data ^ other.data)
144
- + end
145
-
146
- def_delegators :@data, :each
147
- end
@@ -1,73 +0,0 @@
1
- # The Ruport Data Collections.
2
- # Authors: Gregory Brown / Dudley Flanders
3
- #
4
- # This is Free Software. For details, see LICENSE and COPYING
5
- # Copyright 2006 by respective content owners, all rights reserved.
6
- require 'set'
7
-
8
- module Ruport::Data
9
- class Set < Collection
10
-
11
- # Creates a new set containing the elements of options[:data].
12
- def initialize(options={})
13
- @data = ::Set.new
14
- options[:data].each {|e| self << e} if options[:data]
15
- end
16
-
17
- # Adds the given object to the set and returns self.
18
- def add(other)
19
- case other
20
- when Record
21
- @data << other
22
- when Array
23
- @data << Record.new(other)
24
- end
25
- self
26
- end
27
- alias_method :<<, :add
28
-
29
- # Produces a shallow copy of the set: the same data is referenced by both
30
- # the old and new sets.
31
- def dup
32
- a = self.class.new(:data=>@data)
33
- a.tags = tags.dup
34
- return a
35
- end
36
- alias_method :clone, :dup
37
-
38
- # Equality. Two sets are equal if they contain the same set of objects.
39
- def ==(other)
40
- @data == other.data
41
- end
42
-
43
- # Union. Returns a new set containing the union of the objects contained in
44
- # the two sets.
45
- def |(other)
46
- Set.new :data => (@data | other.data)
47
- end
48
- alias_method :union, :|
49
- alias_method :+, :|
50
-
51
- # Intersection. Returns a new set containing the objects common to the two
52
- # sets.
53
- def &(other)
54
- Set.new :data => (@data & other.data)
55
- end
56
- alias_method :intersection, :&
57
-
58
- # Difference. Returns a new set containing those objects present in this
59
- # set but not the other.
60
- def -(other)
61
- Set.new :data => (@data - other.data)
62
- end
63
- alias_method :difference, :-
64
-
65
- # Exclusion. Returns a new set containing those objects in this set or the
66
- # other set but not in both.
67
- def ^(other)
68
- Set.new :data => (@data ^ other.data)
69
- end
70
-
71
- def_delegators :@data, :each
72
- end
73
- end
@@ -1,32 +0,0 @@
1
- ***************
2
- *** 60,74 ****
3
- `stty size`.split.map { |x| x.to_i }.reverse
4
- end
5
-
6
- - end
7
- -
8
- - def terminal_width
9
- - terminal_size.first
10
- - end
11
- -
12
- - def terminal_height
13
- - terminal_size.last
14
- - end
15
-
16
- end
17
- end
18
- --- 60,73 ----
19
- `stty size`.split.map { |x| x.to_i }.reverse
20
- end
21
-
22
- + def terminal_width
23
- + terminal_size.first
24
- + end
25
-
26
- + def terminal_height
27
- + terminal_size.last
28
- + end
29
- +
30
- + end
31
- end
32
- end
@@ -1,50 +0,0 @@
1
- ***************
2
- *** 18,53 ****
3
- FasterCSV.generate(:col_sep => "\t") { |csv| data.each { |r| csv << r } }
4
- end
5
-
6
- - helper(:foo, :engine => :table_engine) { }
7
- - helper(:bar, :engines => [:table_engine,:invoice_engine]) { }
8
- - helper(:baz) {}
9
- -
10
- plugin_name :tsv
11
- - register_on :table_engine
12
- -
13
- - # wont work, just for helper tests
14
- - register_on :invoice_engine
15
- - register_on :document_engine
16
-
17
- end
18
-
19
- - class TestPlugin < Test::Unit::TestCase
20
- - def test_helper
21
- - t = Ruport::Format.table_object :data => [[1,2]], :plugin => :tsv
22
- - i = Ruport::Format.invoice_object :data => [[1,2]].to_table(%w[a b]), :plugin => :tsv
23
- - d = Ruport::Format.document_object :data => "foo", :plugin => :tsv
24
- - assert_nothing_raised { t.foo }
25
- - assert_nothing_raised { t.bar }
26
- - assert_nothing_raised { t.baz }
27
- - assert_nothing_raised { i.bar }
28
- - assert_nothing_raised { i.baz }
29
- - assert_nothing_raised { d.baz }
30
- - assert_raise(NoMethodError) { i.foo }
31
- - assert_raise(NoMethodError) { d.foo }
32
- - assert_raise(NoMethodError) { d.bar }
33
- - end
34
- - end
35
- -
36
- class CSVPluginTest < Test::Unit::TestCase
37
-
38
- def test_basic
39
- --- 18,28 ----
40
- FasterCSV.generate(:col_sep => "\t") { |csv| data.each { |r| csv << r } }
41
- end
42
-
43
- plugin_name :tsv
44
- + register_on Format::Engine::Table
45
-
46
- end
47
-
48
- class CSVPluginTest < Test::Unit::TestCase
49
-
50
- def test_basic