ruport-util 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -33,7 +33,7 @@ end
33
33
 
34
34
  spec = Gem::Specification.new do |spec|
35
35
  spec.name = "ruport-util"
36
- spec.version = "0.7.1"
36
+ spec.version = "0.7.2"
37
37
  spec.platform = Gem::Platform::RUBY
38
38
  spec.summary = "A set of tools and helper libs for Ruby Reports"
39
39
  spec.files = Dir.glob("{example,lib,test,bin}/**/**/*") +
@@ -107,7 +107,7 @@ module Ruport
107
107
 
108
108
  # generates a scruffy graph object
109
109
  def initialize
110
- quiet { require 'scruffy' }
110
+ Ruport.quiet { require 'scruffy' }
111
111
 
112
112
  @graph = Scruffy::Graph.new
113
113
  end
@@ -99,11 +99,13 @@ module Ruport
99
99
  # mailer.deliver :from => "gregory.t.brown@gmail.com",
100
100
  # :to => "greg7224@gmail.com"
101
101
  #
102
- def deliver(options={})
102
+ def deliver(options={})
103
+ to = options.delete(:to)
104
+ mail_object.to = Array(to).join(",")
103
105
  options.each { |k,v| send("#{k}=",v) if respond_to? "#{k}=" }
104
106
 
105
107
  Net::SMTP.start(@host,@port,@host,@user,@password,@auth) do |smtp|
106
- smtp.send_message((options[:mail_object] || mail_object).to_s, options[:from], options[:to] )
108
+ smtp.send_message((options[:mail_object] || mail_object).to_s, options[:from], to)
107
109
  end
108
110
  end
109
111
 
@@ -136,10 +138,9 @@ module Ruport
136
138
  def send_to(adds)
137
139
  use_mailer(:default) unless @mailer
138
140
  m = Mailer.new
139
- m.to = adds
140
141
  yield(m)
141
142
  m.send(:select_mailer,@mailer)
142
- m.deliver :from => m.from, :to => m.to
143
+ m.deliver :from => m.from, :to => adds
143
144
  end
144
145
 
145
146
  # Sets the active mailer to the Ruport::Mailer source requested by <tt>label</tt>.
@@ -53,9 +53,6 @@ module Ruport
53
53
  # #from string
54
54
  # result = query "select * from foo"
55
55
  #
56
- # #from file
57
- # result = query "my_query.sql", :origin => :file
58
- #
59
56
  # You can use multistatement SQL:
60
57
  #
61
58
  # # will return the value of the last statement, "select * from foo"
@@ -72,21 +69,14 @@ module Ruport
72
69
  # # will return an Array of DBI::Row objects
73
70
  # result = query "select * from foo", :raw_data => true
74
71
  #
75
- # You can quickly output in a number of formats:
76
- #
77
- # result = query "select * from foo", :as => :csv
78
- # result = query "select * from foo", :as => :html
79
- # result = query "select * from foo", :as => :pdf
80
72
  #
81
73
  # See Ruport::Query for details.
82
74
  #
83
75
  def query(sql, options={})
84
- options[:source] ||= :default
85
- q = options[:query_obj] || Ruport::Query.new(sql, options)
76
+ options[:source] ||= :default
77
+ q = Ruport::Query.new(sql, options)
86
78
  if block_given?
87
79
  q.each { |r| yield(r) }
88
- elsif options[:as]
89
- q.result.as(options[:as])
90
80
  else
91
81
  q.result
92
82
  end
data/lib/ruport/util.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Ruport
2
2
  module Util
3
- VERSION = "0.7.1"
3
+ VERSION = "0.7.2"
4
4
 
5
5
  file = __FILE__
6
6
  file = File.readlink(file) if File.symlink?(file)
@@ -1,6 +1,6 @@
1
1
  require 'test/helper'
2
2
 
3
- quiet { testcase_requires 'scruffy' }
3
+ Ruport.quiet { testcase_requires 'scruffy' }
4
4
 
5
5
  class MockGraphPlugin < Ruport::Formatter
6
6
  renders :mock, :for => Ruport::Renderer::Graph
data/test/test_mailer.rb CHANGED
@@ -24,7 +24,9 @@ describe 'Mailer' do
24
24
 
25
25
  @default_mailer = @mailer.new :default
26
26
  @other_mailer = @mailer.new :other
27
+ end
27
28
 
29
+ before :each do
28
30
  @mail_fields = { :to => 'clyde@example.com',
29
31
  :from => 'sue@example.com',
30
32
  :subject => 'Hello',
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: ruport-util
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.7.1
7
- date: 2007-06-07 00:00:00 -04:00
6
+ version: 0.7.2
7
+ date: 2007-07-05 00:00:00 -04:00
8
8
  summary: A set of tools and helper libs for Ruby Reports
9
9
  require_paths:
10
10
  - lib
@@ -30,50 +30,50 @@ authors:
30
30
  - Gregory Brown
31
31
  files:
32
32
  - example/data
33
+ - example/data/blank.ods
34
+ - example/mailer.rb
33
35
  - example/form.rb
34
- - example/graph_report.rb
36
+ - example/ods.rb
35
37
  - example/invoice_report.rb
36
- - example/mailer.rb
37
38
  - example/managed_report.rb
38
- - example/ods.rb
39
- - example/data/blank.ods
39
+ - example/graph_report.rb
40
40
  - lib/ruport
41
41
  - lib/ruport/util
42
- - lib/ruport/util.rb
43
- - lib/ruport/util/bench.rb
42
+ - lib/ruport/util/pdf
43
+ - lib/ruport/util/pdf/form.rb
44
44
  - lib/ruport/util/generator.rb
45
+ - lib/ruport/util/bench.rb
45
46
  - lib/ruport/util/graph.rb
46
- - lib/ruport/util/invoice.rb
47
- - lib/ruport/util/mailer.rb
48
47
  - lib/ruport/util/ods.rb
49
- - lib/ruport/util/pdf
50
- - lib/ruport/util/report.rb
51
48
  - lib/ruport/util/report_manager.rb
52
- - lib/ruport/util/pdf/form.rb
49
+ - lib/ruport/util/mailer.rb
50
+ - lib/ruport/util/report.rb
51
+ - lib/ruport/util/invoice.rb
52
+ - lib/ruport/util.rb
53
53
  - test/helper
54
- - test/helper.rb
55
- - test/samples
56
- - test/test_format_ods.rb
57
- - test/test_graph_renderer.rb
58
- - test/test_invoice.rb
59
- - test/test_mailer.rb
60
- - test/test_report.rb
61
- - test/test_report_manager.rb
62
54
  - test/helper/layout.rb
63
55
  - test/helper/wrap.rb
56
+ - test/samples
64
57
  - test/samples/data.csv
65
58
  - test/samples/foo.rtxt
59
+ - test/test_mailer.rb
60
+ - test/helper.rb
61
+ - test/test_report_manager.rb
62
+ - test/test_graph_renderer.rb
63
+ - test/test_report.rb
64
+ - test/test_invoice.rb
65
+ - test/test_format_ods.rb
66
66
  - bin/csv2ods
67
67
  - bin/rope
68
68
  - Rakefile
69
69
  - INSTALL
70
70
  test_files:
71
- - test/test_format_ods.rb
72
- - test/test_graph_renderer.rb
73
- - test/test_invoice.rb
74
71
  - test/test_mailer.rb
75
- - test/test_report.rb
76
72
  - test/test_report_manager.rb
73
+ - test/test_graph_renderer.rb
74
+ - test/test_report.rb
75
+ - test/test_invoice.rb
76
+ - test/test_format_ods.rb
77
77
  rdoc_options:
78
78
  - --title
79
79
  - ruport-util Documentation