dossier 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/dossier/query.rb +1 -1
- data/lib/dossier/version.rb +1 -1
- data/spec/dossier/query_spec.rb +4 -4
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +100 -0
- metadata +7 -7
data/lib/dossier/query.rb
CHANGED
data/lib/dossier/version.rb
CHANGED
data/spec/dossier/query_spec.rb
CHANGED
@@ -17,21 +17,21 @@ describe Dossier::Query do
|
|
17
17
|
context "when the methods return single values" do
|
18
18
|
|
19
19
|
before :each do
|
20
|
-
report.stub(:sql).and_return("SELECT * FROM employees WHERE id = :id OR girth < :girth OR
|
20
|
+
report.stub(:sql).and_return("SELECT * FROM employees WHERE id = :id OR girth < :girth OR hired_on = :hired_on")
|
21
21
|
report.stub(:id).and_return(92)
|
22
22
|
report.stub(:girth).and_return(3.14)
|
23
|
-
report.stub(:
|
23
|
+
report.stub(:hired_on).and_return('2013-03-29')
|
24
24
|
end
|
25
25
|
|
26
26
|
it "escapes the values" do
|
27
27
|
query.should_receive(:escape).with(92)
|
28
28
|
query.should_receive(:escape).with(3.14)
|
29
|
-
query.should_receive(:escape).with('
|
29
|
+
query.should_receive(:escape).with('2013-03-29')
|
30
30
|
query.to_s
|
31
31
|
end
|
32
32
|
|
33
33
|
it "inserts the values" do
|
34
|
-
expect(query.to_s).to eq("SELECT * FROM employees WHERE id = 92 OR girth < 3.14 OR
|
34
|
+
expect(query.to_s).to eq("SELECT * FROM employees WHERE id = 92 OR girth < 3.14 OR hired_on = '2013-03-29'")
|
35
35
|
end
|
36
36
|
|
37
37
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
data/spec/dummy/log/test.log
CHANGED
@@ -2118,3 +2118,103 @@ Processing by Dossier::ReportsController#show as XLS
|
|
2118
2118
|
Completed 200 OK in 5ms (ActiveRecord: 0.4ms)
|
2119
2119
|
[1m[35mEmployeeReport (0.3ms)[0m SELECT * FROM employees WHERE 1=1
|
2120
2120
|
ORDER BY name ASC
|
2121
|
+
Connecting to database specified by database.yml
|
2122
|
+
[1m[36mFACTORY (0.9ms)[0m [1mCREATE DATABASE IF NOT EXISTS `dossier_test`[0m
|
2123
|
+
[1m[35mFACTORY (68.6ms)[0m DROP TABLE IF EXISTS `employees`
|
2124
|
+
[1m[36mFACTORY (28.9ms)[0m [1m CREATE TABLE `employees` (
|
2125
|
+
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
2126
|
+
`name` varchar(255) NOT NULL,
|
2127
|
+
`division` varchar(255) NOT NULL,
|
2128
|
+
`salary` int(11) NOT NULL,
|
2129
|
+
`suspended` tinyint(1) NOT NULL DEFAULT 0,
|
2130
|
+
`hired_on` date NOT NULL,
|
2131
|
+
PRIMARY KEY (`id`)
|
2132
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
2133
|
+
[0m
|
2134
|
+
[1m[35mFACTORY (1.6ms)[0m TRUNCATE `employees`
|
2135
|
+
[1m[36mFACTORY (1.0ms)[0m [1m INSERT INTO
|
2136
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
2137
|
+
VALUES ('Moustafa McMann', '2010-10-02', false, 'Zany Inventions', 30000);
|
2138
|
+
[0m
|
2139
|
+
[1m[35mFACTORY (0.9ms)[0m INSERT INTO
|
2140
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
2141
|
+
VALUES ('Jimmy Jackalope, Jr.', '2013-01-11', true, 'Tedious Toiling', 20000);
|
2142
|
+
|
2143
|
+
[1m[36mFACTORY (0.9ms)[0m [1m INSERT INTO
|
2144
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
2145
|
+
VALUES ('Elise Elderberry', '2013-01-11', false, 'Corporate Malfeasance', 99000);
|
2146
|
+
[0m
|
2147
|
+
[1m[35mFACTORY (8.8ms)[0m DROP TABLE IF EXISTS `employees`
|
2148
|
+
[1m[36mFACTORY (1.0ms)[0m [1m CREATE TABLE `employees` (
|
2149
|
+
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
2150
|
+
`name` TEXT NOT NULL,
|
2151
|
+
`division` TEXT NOT NULL,
|
2152
|
+
`salary` INTEGER NOT NULL,
|
2153
|
+
`suspended` TINYINT NOT NULL DEFAULT 0,
|
2154
|
+
`hired_on` DATE NOT NULL
|
2155
|
+
);
|
2156
|
+
[0m
|
2157
|
+
[1m[35mFACTORY (0.9ms)[0m DELETE FROM `employees`
|
2158
|
+
[1m[36mFACTORY (0.9ms)[0m [1m INSERT INTO
|
2159
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
2160
|
+
VALUES ('MOUSTAFA MCMANN', '2010-10-02', 0, 'Zany Inventions', 30000);
|
2161
|
+
[0m
|
2162
|
+
[1m[35mFACTORY (1.0ms)[0m INSERT INTO
|
2163
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
2164
|
+
VALUES ('JIMMY JACKALOPE, JR.', '2013-01-11', 1, 'Tedious Toiling', 20000);
|
2165
|
+
|
2166
|
+
[1m[36mFACTORY (1.0ms)[0m [1m INSERT INTO
|
2167
|
+
`employees` (`name`, `hired_on`, `suspended`, `division`, `salary`)
|
2168
|
+
VALUES ('ELISE ELDERBERRY', '2013-01-11', 0, 'Corporate Malfeasance', 99000);
|
2169
|
+
[0m
|
2170
|
+
Started GET "/reports/employee_with_custom_client" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2171
|
+
Processing by Dossier::ReportsController#show as HTML
|
2172
|
+
Parameters: {"report"=>"employee_with_custom_client"}
|
2173
|
+
[1m[35mEmployeeWithCustomClientReport (3.0ms)[0m SELECT * FROM `employees`
|
2174
|
+
Rendered /Users/adamhunter/Studio/adamhunter/dossier/app/views/dossier/reports/show.html.haml within layouts/application (7.3ms)
|
2175
|
+
Completed 200 OK in 35ms (Views: 13.2ms | ActiveRecord: 0.0ms)
|
2176
|
+
Started GET "/reports/employee.xls" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2177
|
+
Processing by Dossier::ReportsController#show as XLS
|
2178
|
+
Parameters: {"report"=>"employee"}
|
2179
|
+
[1m[36mEmployeeReport (0.3ms)[0m [1mSELECT * FROM employees WHERE 1=1
|
2180
|
+
ORDER BY name ASC[0m
|
2181
|
+
Completed 200 OK in 31ms (ActiveRecord: 0.3ms)
|
2182
|
+
Started GET "/reports/employee.csv" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2183
|
+
Processing by Dossier::ReportsController#show as CSV
|
2184
|
+
Parameters: {"report"=>"employee"}
|
2185
|
+
[1m[35mEmployeeReport (0.3ms)[0m SELECT * FROM employees WHERE 1=1
|
2186
|
+
ORDER BY name ASC
|
2187
|
+
Completed 200 OK in 5ms (ActiveRecord: 0.3ms)
|
2188
|
+
Started GET "/reports/employee_with_custom_view" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2189
|
+
Processing by Dossier::ReportsController#show as HTML
|
2190
|
+
Parameters: {"report"=>"employee_with_custom_view"}
|
2191
|
+
[1m[36mEmployeeWithCustomViewReport (0.2ms)[0m [1mSELECT * FROM employees WHERE suspended = true[0m
|
2192
|
+
Completed 200 OK in 9ms (Views: 3.9ms | ActiveRecord: 0.2ms)
|
2193
|
+
Started GET "/reports/employee?options[footer]=1" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2194
|
+
Processing by Dossier::ReportsController#show as HTML
|
2195
|
+
Parameters: {"options"=>{"footer"=>"1"}, "report"=>"employee"}
|
2196
|
+
[1m[35mEmployeeReport (0.4ms)[0m SELECT * FROM employees WHERE 1=1
|
2197
|
+
ORDER BY name ASC
|
2198
|
+
Completed 200 OK in 18ms (Views: 12.0ms | ActiveRecord: 0.0ms)
|
2199
|
+
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-05-06 11:38:23 -0400
|
2200
|
+
Processing by Dossier::ReportsController#show as HTML
|
2201
|
+
Parameters: {"options"=>{"salary"=>"true", "order"=>"desc", "names"=>["Jimmy Jackalope", "Moustafa McMann"], "divisions"=>["Tedious Toiling"]}, "report"=>"employee"}
|
2202
|
+
[1m[36mEmployeeReport (0.5ms)[0m [1mSELECT * FROM employees WHERE 1=1
|
2203
|
+
AND division in (('Tedious Toiling'))
|
2204
|
+
AND salary > 10000
|
2205
|
+
AND (name like '%Moustafa McMann%' or name like '%Jimmy Jackalope%')
|
2206
|
+
ORDER BY name DESC[0m
|
2207
|
+
Completed 200 OK in 16ms (Views: 3.6ms | ActiveRecord: 0.0ms)
|
2208
|
+
Started GET "/reports/employee" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2209
|
+
Processing by Dossier::ReportsController#show as HTML
|
2210
|
+
Parameters: {"report"=>"employee"}
|
2211
|
+
[1m[35mEmployeeReport (0.3ms)[0m SELECT * FROM employees WHERE 1=1
|
2212
|
+
ORDER BY name ASC
|
2213
|
+
Completed 200 OK in 10ms (Views: 4.6ms | ActiveRecord: 0.0ms)
|
2214
|
+
Started GET "/employee_report_custom_controller" for 127.0.0.1 at 2013-05-06 11:38:23 -0400
|
2215
|
+
Processing by SiteController#report as HTML
|
2216
|
+
[1m[36mEmployeeReport (0.4ms)[0m [1mSELECT * FROM employees WHERE 1=1
|
2217
|
+
ORDER BY name ASC[0m
|
2218
|
+
Completed 200 OK in 9ms (Views: 4.6ms | ActiveRecord: 0.4ms)
|
2219
|
+
[1m[35mEmployeeReport (0.3ms)[0m SELECT * FROM employees WHERE 1=1
|
2220
|
+
ORDER BY name ASC
|
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.5.
|
4
|
+
version: 2.5.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -98,17 +98,17 @@ dependencies:
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
99
99
|
none: false
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ~>
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 3.1
|
103
|
+
version: '3.1'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
|
-
- -
|
109
|
+
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 3.1
|
111
|
+
version: '3.1'
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: activerecord
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|
@@ -319,7 +319,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
319
319
|
version: '0'
|
320
320
|
segments:
|
321
321
|
- 0
|
322
|
-
hash:
|
322
|
+
hash: 4524173527556927315
|
323
323
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
324
324
|
none: false
|
325
325
|
requirements:
|
@@ -328,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
328
328
|
version: '0'
|
329
329
|
segments:
|
330
330
|
- 0
|
331
|
-
hash:
|
331
|
+
hash: 4524173527556927315
|
332
332
|
requirements: []
|
333
333
|
rubyforge_project:
|
334
334
|
rubygems_version: 1.8.23
|