qreport 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,7 @@
1
+ 2013-09-24 Kurt A. Stephens <ks.github@kurtstephens.com>
2
+ * v0.0.9: New Version: Bug fixes.
3
+ * Use Connection.verbose_stream.
4
+
1
5
  2013-09-24 Kurt A. Stephens <ks.github@kurtstephens.com>
2
6
  * v0.0.8: Bug fixes, performance improvements, new features.
3
7
  * Correctly handle other Float column types.
@@ -314,7 +314,7 @@ module Qreport
314
314
  @error = nil
315
315
  sql = @sql_prepared = prepare_sql self.sql
316
316
  if conn.verbose || options[:verbose]
317
- out = verbose_stream
317
+ out = conn.verbose_stream
318
318
  out.puts "\n-- =================================================================== --"
319
319
  out.puts sql
320
320
  out.puts "-- ==== --"
@@ -356,7 +356,7 @@ module Qreport
356
356
  unless optional && val.nil?
357
357
  val = conn.escape_value(val)
358
358
  end
359
- verbose_stream.puts " #{name} => #{val}" if options[:verbose_arguments]
359
+ conn.verbose_stream.puts " #{name} => #{val}" if options[:verbose_arguments]
360
360
  val
361
361
  else
362
362
  $1
@@ -1,3 +1,3 @@
1
1
  module Qreport
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -1,7 +1,8 @@
1
1
  require 'spec_helper'
2
+ require 'stringio'
2
3
 
3
4
  describe Qreport::ReportRunner do
4
- attr :reports, :now
5
+ attr :reports, :now, :verbose
5
6
 
6
7
  it "should generate reports" do
7
8
  # conn.verbose = conn.verbose_result = true
@@ -106,6 +107,22 @@ END
106
107
  report_run.error.should == nil
107
108
  end
108
109
 
110
+ it "should support #verbose, #verbose_stream." do
111
+ conn.verbose = true
112
+ conn.verbose_stream = StringIO.new('')
113
+
114
+ run_reports!
115
+
116
+ str = conn.verbose_stream.string
117
+ str.should =~ /BEGIN/
118
+ str.should =~ /DROP SEQUENCE IF EXISTS/
119
+ str.should =~ /CREATE TEMPORARY SEQUENCE/
120
+ str.should =~ /INSERT INTO users_with_articles/
121
+ str.should =~ /INSERT INTO qr_report_runs/
122
+ str.should =~ /UPDATE qr_report_runs/
123
+ str.should =~ /COMMIT/
124
+ end
125
+
109
126
  def run_reports!
110
127
  @reports = { }
111
128
 
@@ -121,6 +138,7 @@ END
121
138
 
122
139
  [ '1 days', '2 days', '30 days', '60 days' ].each do | interval |
123
140
  report_run = Qreport::ReportRun.new(:name => :users_with_articles, :description => interval, :variant => interval)
141
+ report_run.verbose = verbose
124
142
  report_run.arguments = {
125
143
  :now => now,
126
144
  :interval => interval,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qreport
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -164,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  version: '0'
165
165
  segments:
166
166
  - 0
167
- hash: 3423526995074197651
167
+ hash: 3795772995723267023
168
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  none: false
170
170
  requirements:
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  segments:
175
175
  - 0
176
- hash: 3423526995074197651
176
+ hash: 3795772995723267023
177
177
  requirements: []
178
178
  rubyforge_project:
179
179
  rubygems_version: 1.8.25