dossier 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -0
- data/lib/dossier/stream_csv.rb +7 -3
- data/lib/dossier/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +88 -0
- metadata +5 -5
data/README.markdown
CHANGED
@@ -208,3 +208,4 @@ Note: when you run the tests, Dossier will **make and/or truncate** some tables
|
|
208
208
|
- To other reports
|
209
209
|
- To other formats
|
210
210
|
- Extending the formatter
|
211
|
+
- Show how to do "crosstab" reports (preliminary query to determine columns, then build SQL case statements?)
|
data/lib/dossier/stream_csv.rb
CHANGED
@@ -14,9 +14,13 @@ module Dossier
|
|
14
14
|
yield record.to_csv
|
15
15
|
end
|
16
16
|
rescue => e
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
if Rails.application.config.consider_all_requests_local
|
18
|
+
yield e.message
|
19
|
+
e.backtrace.each do |line|
|
20
|
+
yield "#{line}\n"
|
21
|
+
end
|
22
|
+
else
|
23
|
+
yield "We're sorry, but something went wrong."
|
20
24
|
end
|
21
25
|
end
|
22
26
|
|
data/lib/dossier/version.rb
CHANGED
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/log/test.log
CHANGED
@@ -26554,3 +26554,91 @@ Processing by Dossier::ReportsController#show as HTML
|
|
26554
26554
|
Completed 200 OK in 5ms (Views: 2.6ms | ActiveRecord: 0.0ms)
|
26555
26555
|
[1m[35mEmployeeReport (0.2ms)[0m SELECT * FROM employees WHERE 1=1
|
26556
26556
|
ORDER BY name ASC
|
26557
|
+
Connecting to database specified by database.yml
|
26558
|
+
[1m[36mFACTORY (0.2ms)[0m [1mCREATE DATABASE IF NOT EXISTS `dossier_test`[0m
|
26559
|
+
[1m[35mFACTORY (1.6ms)[0m DROP TABLE IF EXISTS `employees`
|
26560
|
+
[1m[36mFACTORY (63.0ms)[0m [1m CREATE TABLE `employees` (
|
26561
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
26562
|
+
`name` varchar(255) NOT NULL,
|
26563
|
+
`division` varchar(255) NOT NULL,
|
26564
|
+
`salary` int(11) NOT NULL,
|
26565
|
+
`suspended` tinyint(1) NOT NULL DEFAULT 0,
|
26566
|
+
`hired_on` date NOT NULL,
|
26567
|
+
PRIMARY KEY (`id`)
|
26568
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
26569
|
+
[0m
|
26570
|
+
[1m[35mFACTORY (0.9ms)[0m TRUNCATE `employees`
|
26571
|
+
[1m[36mFACTORY (0.4ms)[0m [1m INSERT INTO
|
26572
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
26573
|
+
VALUES ('Moustafa McMann', '2010-10-02', false, 'Zany Inventions', 30000);
|
26574
|
+
[0m
|
26575
|
+
[1m[35mFACTORY (0.3ms)[0m INSERT INTO
|
26576
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
26577
|
+
VALUES ('Jimmy Jackalope, Jr.', '2013-01-11', true, 'Tedious Toiling', 20000);
|
26578
|
+
|
26579
|
+
[1m[36mFACTORY (0.3ms)[0m [1m INSERT INTO
|
26580
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
26581
|
+
VALUES ('Elise Elderberry', '2013-01-11', false, 'Corporate Malfeasance', 99000);
|
26582
|
+
[0m
|
26583
|
+
[1m[35mFACTORY (2.7ms)[0m DROP TABLE IF EXISTS `employees`
|
26584
|
+
[1m[36mFACTORY (1.1ms)[0m [1m CREATE TABLE `employees` (
|
26585
|
+
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
26586
|
+
`name` TEXT NOT NULL,
|
26587
|
+
`division` TEXT NOT NULL,
|
26588
|
+
`salary` INTEGER NOT NULL,
|
26589
|
+
`suspended` TINYINT NOT NULL DEFAULT 0,
|
26590
|
+
`hired_on` DATE NOT NULL
|
26591
|
+
);
|
26592
|
+
[0m
|
26593
|
+
[1m[35mFACTORY (0.9ms)[0m DELETE FROM `employees`
|
26594
|
+
[1m[36mFACTORY (0.9ms)[0m [1m INSERT INTO
|
26595
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
26596
|
+
VALUES ('MOUSTAFA MCMANN', '2010-10-02', 0, 'Zany Inventions', 30000);
|
26597
|
+
[0m
|
26598
|
+
[1m[35mFACTORY (0.9ms)[0m INSERT INTO
|
26599
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
26600
|
+
VALUES ('JIMMY JACKALOPE, JR.', '2013-01-11', 1, 'Tedious Toiling', 20000);
|
26601
|
+
|
26602
|
+
[1m[36mFACTORY (1.2ms)[0m [1m INSERT INTO
|
26603
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
26604
|
+
VALUES ('ELISE ELDERBERRY', '2013-01-11', 0, 'Corporate Malfeasance', 99000);
|
26605
|
+
[0m
|
26606
|
+
[1m[35mEmployeeReport (0.3ms)[0m SELECT * FROM employees WHERE 1=1
|
26607
|
+
ORDER BY name ASC
|
26608
|
+
Started GET "/reports/employee.csv" for 127.0.0.1 at 2013-01-23 17:01:04 -0500
|
26609
|
+
Processing by Dossier::ReportsController#show as CSV
|
26610
|
+
Parameters: {"report"=>"employee"}
|
26611
|
+
[1m[36mEmployeeReport (0.2ms)[0m [1mSELECT * FROM employees WHERE 1=1
|
26612
|
+
ORDER BY name ASC[0m
|
26613
|
+
Completed 200 OK in 4ms (ActiveRecord: 0.2ms)
|
26614
|
+
Started GET "/reports/employee?options[footer]=1" for 127.0.0.1 at 2013-01-23 17:01:04 -0500
|
26615
|
+
Processing by Dossier::ReportsController#show as HTML
|
26616
|
+
Parameters: {"options"=>{"footer"=>"1"}, "report"=>"employee"}
|
26617
|
+
[1m[35mEmployeeReport (0.2ms)[0m SELECT * FROM employees WHERE 1=1
|
26618
|
+
ORDER BY name ASC
|
26619
|
+
Completed 200 OK in 68ms (Views: 19.0ms | ActiveRecord: 0.0ms)
|
26620
|
+
Started GET "/reports/employee?options[salary]=true&options[order]=desc&options[names][]=Jimmy+Jackalope&options[names][]=Moustafa+McMann&options[divisions][]=Tedious+Toiling" for 127.0.0.1 at 2013-01-23 17:01:04 -0500
|
26621
|
+
Processing by Dossier::ReportsController#show as HTML
|
26622
|
+
Parameters: {"options"=>{"salary"=>"true", "order"=>"desc", "names"=>["Jimmy Jackalope", "Moustafa McMann"], "divisions"=>["Tedious Toiling"]}, "report"=>"employee"}
|
26623
|
+
[1m[36mEmployeeReport (0.3ms)[0m [1mSELECT * FROM employees WHERE 1=1
|
26624
|
+
AND division in (('Tedious Toiling'))
|
26625
|
+
AND salary > 10000
|
26626
|
+
AND (name like '%Moustafa McMann%' or name like '%Jimmy Jackalope%')
|
26627
|
+
ORDER BY name DESC[0m
|
26628
|
+
Completed 200 OK in 7ms (Views: 2.7ms | ActiveRecord: 0.0ms)
|
26629
|
+
Started GET "/reports/employee" for 127.0.0.1 at 2013-01-23 17:01:04 -0500
|
26630
|
+
Processing by Dossier::ReportsController#show as HTML
|
26631
|
+
Parameters: {"report"=>"employee"}
|
26632
|
+
[1m[35mEmployeeReport (0.2ms)[0m SELECT * FROM employees WHERE 1=1
|
26633
|
+
ORDER BY name ASC
|
26634
|
+
Completed 200 OK in 7ms (Views: 2.8ms | ActiveRecord: 0.0ms)
|
26635
|
+
Started GET "/reports/employee_with_custom_view" for 127.0.0.1 at 2013-01-23 17:01:04 -0500
|
26636
|
+
Processing by Dossier::ReportsController#show as HTML
|
26637
|
+
Parameters: {"report"=>"employee_with_custom_view"}
|
26638
|
+
[1m[36mEmployeeWithCustomViewReport (0.2ms)[0m [1mSELECT * FROM employees WHERE suspended = true[0m
|
26639
|
+
Completed 200 OK in 6ms (Views: 2.6ms | ActiveRecord: 0.2ms)
|
26640
|
+
Started GET "/reports/employee_with_custom_client" for 127.0.0.1 at 2013-01-23 17:01:04 -0500
|
26641
|
+
Processing by Dossier::ReportsController#show as HTML
|
26642
|
+
Parameters: {"report"=>"employee_with_custom_client"}
|
26643
|
+
[1m[35mEmployeeWithCustomClientReport (0.3ms)[0m SELECT * FROM `employees`
|
26644
|
+
Completed 200 OK in 5ms (Views: 2.5ms | ActiveRecord: 0.0ms)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dossier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-01-
|
14
|
+
date: 2013-01-23 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: arel
|
@@ -271,7 +271,7 @@ files:
|
|
271
271
|
- spec/support/reports/employee_with_custom_client.rb
|
272
272
|
- spec/support/reports/employee_with_custom_view.rb
|
273
273
|
- spec/support/reports/test.rb
|
274
|
-
homepage:
|
274
|
+
homepage: https://github.com/adamhunter/dossier
|
275
275
|
licenses: []
|
276
276
|
post_install_message:
|
277
277
|
rdoc_options: []
|
@@ -285,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
285
285
|
version: '0'
|
286
286
|
segments:
|
287
287
|
- 0
|
288
|
-
hash: -
|
288
|
+
hash: -3523931774450190994
|
289
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
290
|
none: false
|
291
291
|
requirements:
|
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
294
|
version: '0'
|
295
295
|
segments:
|
296
296
|
- 0
|
297
|
-
hash: -
|
297
|
+
hash: -3523931774450190994
|
298
298
|
requirements: []
|
299
299
|
rubyforge_project:
|
300
300
|
rubygems_version: 1.8.24
|