ruport 0.5.4 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/AUTHORS +13 -4
  2. data/CHANGELOG +15 -1
  3. data/Rakefile +1 -1
  4. data/bin/rope +5 -1
  5. data/examples/basic_grouping.rb +13 -3
  6. data/examples/latex_table.rb +17 -0
  7. data/examples/line_graph_report.rb +23 -0
  8. data/examples/line_graph_report.rb.rej +15 -0
  9. data/examples/line_graph_report.rb~ +23 -0
  10. data/examples/line_plotter.rb +1 -0
  11. data/examples/sql_erb.rb +20 -0
  12. data/examples/template.rb +1 -1
  13. data/examples/text_processors.rb +3 -9
  14. data/lib/ruport.rb +2 -3
  15. data/lib/ruport.rb~ +69 -0
  16. data/lib/ruport/attempt.rb +63 -0
  17. data/lib/ruport/data.rb +1 -1
  18. data/lib/ruport/data.rb.rej +5 -0
  19. data/lib/ruport/data.rb~ +1 -0
  20. data/lib/ruport/data/groupable.rb +20 -0
  21. data/lib/ruport/data/record.rb +18 -13
  22. data/lib/ruport/data/table.rb +92 -26
  23. data/lib/ruport/data/table.rb~ +329 -0
  24. data/lib/ruport/format.rb +7 -1
  25. data/lib/ruport/format/engine/table.rb +2 -1
  26. data/lib/ruport/format/plugin.rb +8 -8
  27. data/lib/ruport/format/plugin/csv_plugin.rb +5 -1
  28. data/lib/ruport/format/plugin/html_plugin.rb +12 -8
  29. data/lib/ruport/format/plugin/latex_plugin.rb +50 -0
  30. data/lib/ruport/format/plugin/text_plugin.rb +38 -33
  31. data/lib/ruport/meta_tools.rb +3 -3
  32. data/lib/ruport/query.rb +21 -9
  33. data/lib/ruport/report.rb +35 -20
  34. data/lib/ruport/report/graph.rb +14 -0
  35. data/lib/ruport/system_extensions.rb +9 -8
  36. data/test/_test_groupable.rb +0 -0
  37. data/test/samples/data.tsv +3 -0
  38. data/test/samples/erb_test.sql +1 -0
  39. data/test/samples/query_test.sql +1 -0
  40. data/test/test_collection.rb +1 -1
  41. data/test/test_format.rb +1 -1
  42. data/test/test_format_engine.rb +17 -0
  43. data/test/test_groupable.rb +41 -0
  44. data/test/test_invoice.rb +1 -1
  45. data/test/test_latex.rb +20 -0
  46. data/test/test_plugin.rb +59 -29
  47. data/test/test_query.rb +12 -6
  48. data/test/test_record.rb +23 -4
  49. data/test/test_record.rb.rej +46 -0
  50. data/test/test_report.rb +32 -7
  51. data/test/test_table.rb +152 -4
  52. data/test/ts_all.rb +21 -0
  53. data/test/unit.log +61 -154
  54. metadata +32 -12
  55. data/lib/ruport/rails.rb +0 -2
  56. data/lib/ruport/rails/reportable.rb +0 -58
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.4
7
- date: 2006-09-24 00:00:00 -04:00
6
+ version: 0.6.0
7
+ date: 2006-10-23 00:00:00 -04:00
8
8
  summary: A generalized Ruby report generation and templating engine.
9
9
  require_paths:
10
10
  - lib
@@ -32,21 +32,26 @@ files:
32
32
  - examples/fieldless_table.rb
33
33
  - examples/line_plotter.rb
34
34
  - examples/sample_invoice_report.rb
35
+ - examples/line_graph_report.rb
36
+ - examples/latex_table.rb
35
37
  - examples/text_processors.rb
36
38
  - examples/new_plugin.rb
39
+ - examples/sql_erb.rb
37
40
  - examples/line_graph.rb
38
- - examples/report.rb
39
- - examples/long.txt
41
+ - examples/line_graph_report.rb~
40
42
  - examples/basic_grouping.rb
43
+ - examples/long.txt
44
+ - examples/report.rb
41
45
  - examples/simple_mail.rb
42
46
  - examples/template.rb
47
+ - examples/line_graph_report.rb.rej
43
48
  - lib/ruport
44
49
  - lib/ruport.rb
45
50
  - lib/uport.rb
51
+ - lib/ruport.rb~
46
52
  - lib/ruport/query
47
53
  - lib/ruport/format
48
54
  - lib/ruport/data
49
- - lib/ruport/rails
50
55
  - lib/ruport/report
51
56
  - lib/ruport/system_extensions.rb
52
57
  - lib/ruport/config.rb
@@ -55,8 +60,10 @@ files:
55
60
  - lib/ruport/format.rb
56
61
  - lib/ruport/data.rb
57
62
  - lib/ruport/mailer.rb
58
- - lib/ruport/rails.rb
59
63
  - lib/ruport/report.rb
64
+ - lib/ruport/attempt.rb
65
+ - lib/ruport/data.rb~
66
+ - lib/ruport/data.rb.rej
60
67
  - lib/ruport/query/sql_split.rb
61
68
  - lib/ruport/format/engine
62
69
  - lib/ruport/format/plugin
@@ -71,22 +78,26 @@ files:
71
78
  - lib/ruport/format/plugin/text_plugin.rb
72
79
  - lib/ruport/format/plugin/pdf_plugin.rb
73
80
  - lib/ruport/format/plugin/csv_plugin.rb
81
+ - lib/ruport/format/plugin/latex_plugin.rb
74
82
  - lib/ruport/data/collection.rb
75
83
  - lib/ruport/data/record.rb
76
84
  - lib/ruport/data/taggable.rb
77
85
  - lib/ruport/data/table.rb
86
+ - lib/ruport/data/groupable.rb
78
87
  - lib/ruport/data/set.rb
79
- - lib/ruport/rails/reportable.rb
88
+ - lib/ruport/data/table.rb~
80
89
  - lib/ruport/report/invoice.rb
90
+ - lib/ruport/report/graph.rb
81
91
  - test/samples
82
92
  - test/test_collection.rb
83
93
  - test/test_record.rb
94
+ - test/ts_all.rb
84
95
  - test/test_table.rb
85
96
  - test/test_format.rb
86
- - test/test_set.rb
87
97
  - test/test_ruport.rb
88
- - test/_test_database.rb
89
98
  - test/test_invoice.rb
99
+ - test/test_set.rb
100
+ - test/_test_database.rb
90
101
  - test/test_plugin.rb
91
102
  - test/test_graph.rb
92
103
  - test/test_meta_tools.rb
@@ -95,16 +106,23 @@ files:
95
106
  - test/test_sql_split.rb
96
107
  - test/test_taggable.rb
97
108
  - test/test_mailer.rb
98
- - test/unit.log
109
+ - test/test_record.rb.rej
99
110
  - test/test_report.rb
111
+ - test/test_latex.rb
112
+ - test/unit.log
100
113
  - test/test_format_engine.rb
101
- - test/samples/ruport_test.sql
114
+ - test/_test_groupable.rb
115
+ - test/test_groupable.rb
116
+ - test/samples/query_test.sql
102
117
  - test/samples/test.yaml
118
+ - test/samples/erb_test.sql
103
119
  - test/samples/data.csv
104
120
  - test/samples/stonecodeblog.sql
121
+ - test/samples/ruport_test.sql
105
122
  - test/samples/addressbook.csv
106
123
  - test/samples/document.xml
107
124
  - test/samples/test.sql
125
+ - test/samples/data.tsv
108
126
  - bin/rope
109
127
  - Rakefile
110
128
  - setup.rb
@@ -118,9 +136,9 @@ test_files:
118
136
  - test/test_record.rb
119
137
  - test/test_table.rb
120
138
  - test/test_format.rb
121
- - test/test_set.rb
122
139
  - test/test_ruport.rb
123
140
  - test/test_invoice.rb
141
+ - test/test_set.rb
124
142
  - test/test_plugin.rb
125
143
  - test/test_graph.rb
126
144
  - test/test_meta_tools.rb
@@ -130,7 +148,9 @@ test_files:
130
148
  - test/test_taggable.rb
131
149
  - test/test_mailer.rb
132
150
  - test/test_report.rb
151
+ - test/test_latex.rb
133
152
  - test/test_format_engine.rb
153
+ - test/test_groupable.rb
134
154
  rdoc_options:
135
155
  - --title
136
156
  - Ruport Documentation
data/lib/ruport/rails.rb DELETED
@@ -1,2 +0,0 @@
1
- require "ruport"
2
- require "ruport/rails/reportable"
@@ -1,58 +0,0 @@
1
- module Ruport
2
-
3
- # This module is designed to be mixed in with an ActiveRecord model
4
- # to add easy conversion to ruport data structures.
5
- #
6
- # In the ActiveRecord Model you wish to integrate with report, add the
7
- # following line just below the class definition:
8
- #
9
- # acts_as_reportable
10
- #
11
- # This will automatically make all the methods in this module available
12
- # in the model.
13
- module Reportable
14
-
15
- # Converts the models' data into a Ruport::Data::Table, then renders
16
- # it using the requested plugin. If :find is specified as an option
17
- # it is passed directly on to ActiveRecords find method
18
- #
19
- # User.formatted_table(:pdf, :find => "age > 18")
20
- def formatted_table(type,options={})
21
- to_table(:find => options[:find],:columns => options[:columns]).as(type){ |e|
22
- yield(e) if block_given?
23
- }
24
- end
25
-
26
- # Converts the models' data into a Ruport::Data::Table object
27
- # If :find is supplied as an option it is passed directly on to
28
- # the models find method.
29
- #
30
- # data = User.to_table(:find => "age > 18")
31
- def to_table(options={})
32
- options[:columns] ||= column_names
33
- Ruport::Data::Table.new(
34
- :data => find(:all,options[:find]),
35
- :column_names => column_names).reorder(*options[:columns])
36
- end
37
-
38
-
39
- end
40
-
41
- class Data::Table
42
- alias_method :old_append, :<<
43
- def <<( stuff )
44
- stuff = stuff.attributes if stuff.kind_of? ActiveRecord::Base
45
- old_append(stuff)
46
- end
47
- end
48
- end
49
-
50
- # Extend rails ActiveRecord::Base class to add the option of mixing in
51
- # the Ruport::Reportable Module in the standard rails way
52
- class ActiveRecord::Base
53
- def self.acts_as_reportable
54
- extend Ruport::Reportable
55
- end
56
- end
57
-
58
-