ruport 0.4.23 → 0.4.99

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. data/AUTHORS +16 -8
  2. data/CHANGELOG +30 -1
  3. data/README +144 -114
  4. data/Rakefile +12 -4
  5. data/TODO +4 -7
  6. data/bin/rope +21 -28
  7. data/examples/line_graph.rb +36 -0
  8. data/examples/sample_invoice_report.rb +1 -1
  9. data/examples/simple_graph.rb +8 -0
  10. data/lib/SVG/Graph/Bar.rb +137 -0
  11. data/lib/SVG/Graph/BarBase.rb +140 -0
  12. data/lib/SVG/Graph/BarHorizontal.rb +136 -0
  13. data/lib/SVG/Graph/Graph.rb +977 -0
  14. data/lib/SVG/Graph/Line.rb +444 -0
  15. data/lib/SVG/Graph/Pie.rb +394 -0
  16. data/lib/SVG/Graph/Plot.rb +494 -0
  17. data/lib/SVG/Graph/Schedule.rb +373 -0
  18. data/lib/SVG/Graph/TimeSeries.rb +241 -0
  19. data/lib/ruport.rb +2 -2
  20. data/lib/ruport/config.rb +47 -3
  21. data/lib/ruport/data/collection.rb +17 -1
  22. data/lib/ruport/data/record.rb +101 -8
  23. data/lib/ruport/data/set.rb +81 -2
  24. data/lib/ruport/data/set.rb.rej +147 -0
  25. data/lib/ruport/data/set.rb~ +73 -0
  26. data/lib/ruport/data/table.rb +127 -2
  27. data/lib/ruport/data/taggable.rb +21 -2
  28. data/lib/ruport/format.rb +36 -44
  29. data/lib/ruport/format/engine.rb +21 -1
  30. data/lib/ruport/format/plugin.rb +64 -1
  31. data/lib/ruport/mailer.rb +70 -36
  32. data/lib/ruport/meta_tools.rb +15 -6
  33. data/lib/ruport/query.rb +1 -1
  34. data/lib/ruport/rails/reportable.rb +23 -1
  35. data/lib/ruport/report.rb +11 -11
  36. data/lib/ruport/report/invoice.rb +16 -0
  37. data/lib/ruport/system_extensions.rb +3 -55
  38. data/test/{tc_database.rb → _test_database.rb} +0 -0
  39. data/test/{tc_config.rb → test_config.rb} +0 -0
  40. data/test/{tc_format.rb → test_format.rb} +1 -0
  41. data/test/{tc_format_engine.rb → test_format_engine.rb} +14 -2
  42. data/test/test_graph.rb +101 -0
  43. data/test/{tc_invoice.rb → test_invoice.rb} +7 -1
  44. data/test/test_mailer.rb +108 -0
  45. data/test/test_meta_tools.rb +14 -0
  46. data/test/{tc_plugin.rb → test_plugin.rb} +12 -1
  47. data/test/{tc_query.rb → test_query.rb} +0 -0
  48. data/test/{tc_record.rb → test_record.rb} +9 -0
  49. data/test/{tc_report.rb → test_report.rb} +2 -1
  50. data/test/{tc_ruport.rb → test_ruport.rb} +0 -0
  51. data/test/test_set.rb +118 -0
  52. data/test/test_set.rb.rej +16 -0
  53. data/test/{tc_set.rb → test_set.rb~} +17 -0
  54. data/test/{tc_sql_split.rb → test_sql_split.rb} +0 -0
  55. data/test/{tc_table.rb → test_table.rb} +15 -0
  56. data/test/{tc_taggable.rb → test_taggable.rb} +0 -0
  57. data/test/unit.log +361 -0
  58. metadata +52 -30
  59. data/examples/bar.pdf +0 -193
  60. data/examples/f.log +0 -5
  61. data/examples/foo.pdf +0 -193
  62. data/lib/ruport/format/document.rb +0 -78
  63. data/lib/ruport/format/open_node.rb +0 -38
  64. data/test/tc_data_row.rb +0 -132
  65. data/test/tc_data_set.rb +0 -386
  66. data/test/tc_document.rb +0 -42
  67. data/test/tc_element.rb +0 -18
  68. data/test/tc_page.rb +0 -42
  69. data/test/tc_section.rb +0 -45
  70. data/test/ts_all.rb +0 -12
  71. data/test/ts_format.rb +0 -7
@@ -1,42 +0,0 @@
1
- require "test/unit"
2
- require "ruport"
3
-
4
- class TestDocument < Test::Unit::TestCase
5
-
6
- include Ruport
7
-
8
- def setup
9
- @empty_doc = Format::Document.new :test_doc1
10
- many_pages = [:p1,:p2,:p3,:p4].map { |p| Format::Page.new(p) }
11
- @populated_doc = Format::Document.new :test_doc2, :pages => many_pages
12
- end
13
-
14
- def test_basics
15
- assert_equal(:test_doc1,@empty_doc.name)
16
- assert_equal(:test_doc2,@populated_doc.name)
17
- assert_equal([],@empty_doc.pages)
18
- assert_equal([:p1,:p2,:p3,:p4],@populated_doc.pages.map { |p| p.name })
19
- end
20
-
21
- def test_each
22
- page_names = [:p1,:p2,:p3,:p4]
23
-
24
- @populated_doc.each { |p| assert_equal(page_names.shift,p.name) }
25
- assert_equal([],page_names)
26
-
27
- @populated_doc.pages << Format::Page.new(:p5)
28
- page_names = [:p1,:p2,:p3,:p4,:p5]
29
-
30
- @populated_doc.each { |p| assert_equal(page_names.shift,p.name) }
31
- assert_equal([],page_names)
32
- end
33
-
34
- def test_add_page
35
- @empty_doc.add_page :p1
36
- @populated_doc.add_page :p5, :some_trait => "cool"
37
- assert(@empty_doc.find { |p| p.name.eql?(:p1) })
38
- assert(@populated_doc.find { |p| p.name.eql?(:p5) and
39
- p.some_trait.eql?("cool") })
40
- end
41
-
42
- end
@@ -1,18 +0,0 @@
1
- require "test/unit"
2
- require "ruport"
3
-
4
- class TestElement < Test::Unit::TestCase
5
- include Ruport
6
- def setup
7
- @empty_element = Format::Element.new :test_element
8
- @populated_element = Format::Element.new :test_element2,
9
- :content => "Hello, Element!"
10
- end
11
-
12
- def test_basics
13
- assert_equal(:test_element, @empty_element.name)
14
- assert_equal(:test_element2, @populated_element.name)
15
- assert_equal("Hello, Element!", @populated_element.content)
16
- end
17
-
18
- end
@@ -1,42 +0,0 @@
1
- require "test/unit"
2
- require "ruport"
3
-
4
- class TestPage < Test::Unit::TestCase
5
- include Ruport
6
- def setup
7
- @empty_page = Format::Page.new :test_page1
8
- sections = { :s1 => Format::Section.new(:s1), :s2 => Format::Section.new(:s2) }
9
- @populated_page = Format::Page.new :test_page2,
10
- :sections => sections
11
- end
12
-
13
- def test_basics
14
- assert_equal(:test_page1, @empty_page.name)
15
- assert_equal(:test_page2, @populated_page.name)
16
- assert_equal([],[:s1,:s2]-@populated_page.map { |s| s.name })
17
- assert_equal({},@empty_page.sections)
18
- end
19
-
20
- def test_each
21
- section_names = [:s1,:s2]
22
- @populated_page.each { |s| section_names -= [s.name] }
23
- assert_equal([],section_names)
24
- @populated_page << Format::Section.new(:s3)
25
- section_names = [:s1,:s2,:s3]
26
- @populated_page.each { |s| section_names -= [s.name] }
27
- assert_equal([],section_names)
28
- end
29
-
30
- def test_add_function
31
- @populated_page.add_section :s3
32
- @populated_page.add_section :s4, :content => "Hello from Section!"
33
- assert(@populated_page.find { |s| s.name.eql?(:s3) })
34
- assert(@populated_page.find { |s| s.name.eql?(:s4) and
35
- s.content.eql?("Hello from Section!")} )
36
-
37
- end
38
- def test_brackets
39
- assert_equal(:s1,@populated_page[:s1].name)
40
- assert_equal(:s2,@populated_page[:s2].name)
41
- end
42
- end
@@ -1,45 +0,0 @@
1
- require "test/unit"
2
- require "ruport"
3
-
4
- class TestSection < Test::Unit::TestCase
5
- include Ruport
6
- def setup
7
- elements = { :e1 => Format::Element.new(:e1),
8
- :e2 => Format::Element.new(:e2) }
9
- @empty_section = Format::Section.new :test_section1
10
- @populated_section = Format::Section.new :test_section2,
11
- :elements => elements
12
-
13
- end
14
-
15
- def test_basics
16
- assert_equal( :test_section1, @empty_section.name )
17
- assert_equal( :test_section2, @populated_section.name )
18
- assert_equal( [], [:e1,:e2]-@populated_section.map { |e| e.name } )
19
- end
20
-
21
- def test_each
22
- element_names = [:e1,:e2]
23
- @populated_section.each { |e| element_names -= [e.name] }
24
- assert_equal([],element_names)
25
-
26
- element_names = [:e1, :e2, :e3]
27
- @populated_section << Format::Element.new(:e3)
28
- @populated_section.each { |e| element_names -= [e.name] }
29
- assert_equal([],element_names)
30
- end
31
-
32
- def test_add_element
33
- @empty_section.add_element :e1
34
- @empty_section.add_element :e2, :content => "Hello from Element!"
35
- assert(@empty_section[:e1])
36
- assert(@empty_section[:e2])
37
- assert_equal("Hello from Element!",@empty_section[:e2].content)
38
- end
39
-
40
- def test_brackets
41
- assert_equal(:e1,@populated_section[:e1].name)
42
- assert_equal(:e2,@populated_section[:e2].name)
43
- end
44
-
45
- end
@@ -1,12 +0,0 @@
1
- require "test/unit"
2
- require "test/ts_format"
3
- require "test/tc_ruport"
4
- require "test/tc_sql_split"
5
- require "test/tc_query"
6
- require "test/tc_config"
7
- require "test/tc_report"
8
- require "test/tc_taggable"
9
- require "test/tc_record"
10
- require "test/tc_table"
11
- require "test/tc_set"
12
- require "test/tc_invoice"
@@ -1,7 +0,0 @@
1
- require "test/tc_format"
2
- require "test/tc_document"
3
- require "test/tc_element"
4
- require "test/tc_section"
5
- require "test/tc_page"
6
- require "test/tc_format_engine"
7
- require "test/tc_plugin"