dossier 2.7.1 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/{README.markdown → README.md} +10 -5
- data/Rakefile +1 -0
- data/app/controllers/dossier/reports_controller.rb +9 -38
- data/app/helpers/dossier/application_helper.rb +7 -1
- data/app/views/dossier/layouts/application.html.haml +6 -0
- data/app/views/dossier/reports/multi.html.haml +8 -3
- data/app/views/dossier/reports/show.html.haml +4 -2
- data/config/routes.rb +2 -2
- data/lib/dossier.rb +4 -8
- data/lib/dossier/adapter/active_record.rb +1 -1
- data/lib/dossier/formatter.rb +20 -3
- data/lib/dossier/multi_report.rb +17 -9
- data/lib/dossier/naming.rb +51 -0
- data/lib/dossier/renderer.rb +63 -0
- data/lib/dossier/report.rb +22 -7
- data/lib/dossier/responder.rb +34 -0
- data/lib/dossier/result.rb +5 -7
- data/lib/dossier/stream_csv.rb +10 -3
- data/lib/dossier/version.rb +1 -1
- data/lib/dossier/view_context_with_report_formatter.rb +7 -0
- data/lib/dossier/xls.rb +2 -2
- data/lib/generators/dossier/views/templates/show.html.haml +5 -3
- data/spec/dossier/adapter/active_record_spec.rb +1 -1
- data/spec/dossier/formatter_spec.rb +38 -3
- data/spec/dossier/multi_report_spec.rb +18 -1
- data/spec/dossier/naming_spec.rb +29 -0
- data/spec/dossier/renderer_spec.rb +57 -0
- data/spec/dossier/report_spec.rb +23 -2
- data/spec/dossier/responder_spec.rb +59 -0
- data/spec/dossier/result_spec.rb +4 -0
- data/spec/dossier/stream_csv_spec.rb +75 -0
- data/spec/dossier_spec.rb +0 -13
- data/spec/dummy/app/controllers/site_controller.rb +0 -4
- data/spec/dummy/app/reports/cats/are/super_fun_report.rb +9 -0
- data/spec/dummy/app/reports/combination_report.rb +9 -0
- data/spec/{support → dummy/app}/reports/employee_report.rb +0 -0
- data/spec/{support → dummy/app}/reports/employee_with_custom_client_report.rb +0 -0
- data/spec/dummy/app/reports/employee_with_custom_view_report.rb +27 -0
- data/spec/dummy/app/reports/hello_my_friends_report.rb +2 -0
- data/spec/{support → dummy/app}/reports/test_report.rb +0 -0
- data/spec/dummy/app/views/dossier/reports/combination/_options.html.haml +4 -0
- data/spec/dummy/app/views/dossier/reports/employee_with_custom_view.html.haml +5 -1
- data/spec/dummy/app/views/dossier/reports/employee_with_custom_view/_options.html.haml +6 -0
- data/spec/dummy/config/database.yml.travis +5 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +3865 -0
- data/spec/dummy/log/test.log +44084 -0
- data/spec/dummy/tmp/cache/assets/CEA/5A0/sprockets%2Fc0534884cbc43494a05d9e957ea1298d +0 -0
- data/spec/dummy/tmp/cache/assets/D40/0D0/sprockets%2F15a6bb0a1346b6d7fe859c14bf729a49 +0 -0
- data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/spec/dummy/tmp/cache/assets/D51/510/sprockets%2Fca0353abc266080173bbc3c13efa935a +0 -0
- data/spec/dummy/tmp/cache/assets/D6C/400/sprockets%2F7fa180a6e05c7ca4346ef58c54bb30f8 +0 -0
- data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/spec/dummy/{dossier_test → tmp/restart.txt} +0 -0
- data/spec/features/combination_report_spec.rb +13 -10
- data/spec/features/employee_spec.rb +76 -0
- data/spec/{requests → features}/employee_with_custom_client_spec.rb +3 -2
- data/spec/{requests → features}/employee_with_custom_controller_spec.rb +3 -2
- data/spec/features/namespaced_report_spec.rb +15 -0
- data/spec/fixtures/db/mysql2.yml.travis +4 -0
- data/spec/fixtures/db/sqlite3.yml.travis +2 -0
- data/spec/helpers/dossier/application_helper_spec.rb +24 -0
- data/spec/spec_helper.rb +11 -0
- metadata +99 -92
- data/spec/fixtures/reports/employee.html +0 -54
- data/spec/fixtures/reports/employee_with_custom_client.html +0 -54
- data/spec/fixtures/reports/employee_with_custom_view.html +0 -15
- data/spec/fixtures/reports/employee_with_footer.html +0 -56
- data/spec/fixtures/reports/employee_with_parameters.html +0 -38
- data/spec/requests/employee_spec.rb +0 -61
- data/spec/support/reports/combination_report.rb +0 -8
- data/spec/support/reports/employee_with_custom_view_report.rb +0 -8
- data/spec/support/reports/hello_my_friends_report.rb +0 -6
@@ -1,54 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<h1>Employee Report</h1>
|
12
|
-
<a href="/reports/employee.csv?" class="download-csv">Download CSV</a>
|
13
|
-
<table>
|
14
|
-
<thead>
|
15
|
-
<tr>
|
16
|
-
<th>Id</th>
|
17
|
-
<th>Name</th>
|
18
|
-
<th>Division</th>
|
19
|
-
<th>Salary</th>
|
20
|
-
<th>Suspended</th>
|
21
|
-
<th>Hired On</th>
|
22
|
-
</tr>
|
23
|
-
</thead>
|
24
|
-
<tbody>
|
25
|
-
<tr>
|
26
|
-
<td>3</td>
|
27
|
-
<td>Employee Elise Elderberry</td>
|
28
|
-
<td>Corporate Malfeasance</td>
|
29
|
-
<td>Who's Asking?</td>
|
30
|
-
<td>No</td>
|
31
|
-
<td>2013-01-11</td>
|
32
|
-
</tr>
|
33
|
-
<tr>
|
34
|
-
<td>2</td>
|
35
|
-
<td>Employee Jimmy Jackalope, Jr.</td>
|
36
|
-
<td>Tedious Toiling</td>
|
37
|
-
<td>$20,000.00</td>
|
38
|
-
<td>Yes</td>
|
39
|
-
<td>2013-01-11</td>
|
40
|
-
</tr>
|
41
|
-
<tr>
|
42
|
-
<td>1</td>
|
43
|
-
<td>Employee Moustafa McMann</td>
|
44
|
-
<td>Zany Inventions</td>
|
45
|
-
<td>$30,000.00</td>
|
46
|
-
<td>No</td>
|
47
|
-
<td>2010-10-02</td>
|
48
|
-
</tr>
|
49
|
-
</tbody>
|
50
|
-
</table>
|
51
|
-
|
52
|
-
|
53
|
-
</body>
|
54
|
-
</html>
|
@@ -1,54 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<h1>Employee With Custom Client Report</h1>
|
12
|
-
<a href="/reports/employee_with_custom_client.csv?" class="download-csv">Download CSV</a>
|
13
|
-
<table>
|
14
|
-
<thead>
|
15
|
-
<tr>
|
16
|
-
<th>Id</th>
|
17
|
-
<th>Name</th>
|
18
|
-
<th>Division</th>
|
19
|
-
<th>Salary</th>
|
20
|
-
<th>Suspended</th>
|
21
|
-
<th>Hired On</th>
|
22
|
-
</tr>
|
23
|
-
</thead>
|
24
|
-
<tbody>
|
25
|
-
<tr>
|
26
|
-
<td>1</td>
|
27
|
-
<td>MOUSTAFA MCMANN</td>
|
28
|
-
<td>Zany Inventions</td>
|
29
|
-
<td>30000</td>
|
30
|
-
<td>0</td>
|
31
|
-
<td>2010-10-02</td>
|
32
|
-
</tr>
|
33
|
-
<tr>
|
34
|
-
<td>2</td>
|
35
|
-
<td>JIMMY JACKALOPE, JR.</td>
|
36
|
-
<td>Tedious Toiling</td>
|
37
|
-
<td>20000</td>
|
38
|
-
<td>1</td>
|
39
|
-
<td>2013-01-11</td>
|
40
|
-
</tr>
|
41
|
-
<tr>
|
42
|
-
<td>3</td>
|
43
|
-
<td>ELISE ELDERBERRY</td>
|
44
|
-
<td>Corporate Malfeasance</td>
|
45
|
-
<td>99000</td>
|
46
|
-
<td>0</td>
|
47
|
-
<td>2013-01-11</td>
|
48
|
-
</tr>
|
49
|
-
</tbody>
|
50
|
-
</table>
|
51
|
-
|
52
|
-
|
53
|
-
</body>
|
54
|
-
</html>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<h1>Yeah. Did you get that memo?</h1>
|
12
|
-
|
13
|
-
|
14
|
-
</body>
|
15
|
-
</html>
|
@@ -1,56 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<h1>Employee Report</h1>
|
12
|
-
<a href="/reports/employee.csv?options%5Bfooter%5D=1" class="download-csv">Download CSV</a>
|
13
|
-
<table>
|
14
|
-
<thead>
|
15
|
-
<tr>
|
16
|
-
<th>Id</th>
|
17
|
-
<th>Name</th>
|
18
|
-
<th>Division</th>
|
19
|
-
<th>Salary</th>
|
20
|
-
<th>Suspended</th>
|
21
|
-
<th>Hired On</th>
|
22
|
-
</tr>
|
23
|
-
</thead>
|
24
|
-
<tbody>
|
25
|
-
<tr>
|
26
|
-
<td>3</td>
|
27
|
-
<td>Employee Elise Elderberry</td>
|
28
|
-
<td>Corporate Malfeasance</td>
|
29
|
-
<td>Who's Asking?</td>
|
30
|
-
<td>No</td>
|
31
|
-
<td>2013-01-11</td>
|
32
|
-
</tr>
|
33
|
-
<tr>
|
34
|
-
<td>2</td>
|
35
|
-
<td>Employee Jimmy Jackalope, Jr.</td>
|
36
|
-
<td>Tedious Toiling</td>
|
37
|
-
<td>$20,000.00</td>
|
38
|
-
<td>Yes</td>
|
39
|
-
<td>2013-01-11</td>
|
40
|
-
</tr>
|
41
|
-
</tbody>
|
42
|
-
<tfoot>
|
43
|
-
<tr>
|
44
|
-
<th>1</th>
|
45
|
-
<th>Employee Moustafa McMann</th>
|
46
|
-
<th>Zany Inventions</th>
|
47
|
-
<th>$30,000.00</th>
|
48
|
-
<th>No</th>
|
49
|
-
<th>2010-10-02</th>
|
50
|
-
</tr>
|
51
|
-
</tfoot>
|
52
|
-
</table>
|
53
|
-
|
54
|
-
|
55
|
-
</body>
|
56
|
-
</html>
|
@@ -1,38 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>Dummy</title>
|
5
|
-
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
-
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
-
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<h1>Employee Report</h1>
|
12
|
-
<a href="/reports/employee.csv?options%5Bdivisions%5D%5B%5D=Tedious+Toiling&options%5Bnames%5D%5B%5D=Jimmy+Jackalope&options%5Bnames%5D%5B%5D=Moustafa+McMann&options%5Border%5D=desc&options%5Bsalary%5D=true" class="download-csv">Download CSV</a>
|
13
|
-
<table>
|
14
|
-
<thead>
|
15
|
-
<tr>
|
16
|
-
<th>Id</th>
|
17
|
-
<th>Name</th>
|
18
|
-
<th>Division</th>
|
19
|
-
<th>Salary</th>
|
20
|
-
<th>Suspended</th>
|
21
|
-
<th>Hired On</th>
|
22
|
-
</tr>
|
23
|
-
</thead>
|
24
|
-
<tbody>
|
25
|
-
<tr>
|
26
|
-
<td>2</td>
|
27
|
-
<td>Employee Jimmy Jackalope, Jr.</td>
|
28
|
-
<td>Tedious Toiling</td>
|
29
|
-
<td>$20,000.00</td>
|
30
|
-
<td>Yes</td>
|
31
|
-
<td>2013-01-11</td>
|
32
|
-
</tr>
|
33
|
-
</tbody>
|
34
|
-
</table>
|
35
|
-
|
36
|
-
|
37
|
-
</body>
|
38
|
-
</html>
|
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe "employee report" do
|
4
|
-
|
5
|
-
describe "rendering HTML" do
|
6
|
-
|
7
|
-
context "when a custom view exists for the report" do
|
8
|
-
|
9
|
-
it "uses the custom view" do
|
10
|
-
get '/reports/employee_with_custom_view'
|
11
|
-
expect(response.body).to eq(File.read('spec/fixtures/reports/employee_with_custom_view.html'))
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
context "when no custom view exists for the report" do
|
17
|
-
|
18
|
-
it "creates an HTML report using its standard 'show' view" do
|
19
|
-
get '/reports/employee'
|
20
|
-
expect(response.body).to eq(File.read('spec/fixtures/reports/employee.html'))
|
21
|
-
end
|
22
|
-
|
23
|
-
it "uses any options provided" do
|
24
|
-
get '/reports/employee', options: {
|
25
|
-
salary: true, order: 'desc',
|
26
|
-
names: ['Jimmy Jackalope', 'Moustafa McMann'],
|
27
|
-
divisions: ['Tedious Toiling']
|
28
|
-
}
|
29
|
-
expect(response.body).to eq(File.read('spec/fixtures/reports/employee_with_parameters.html'))
|
30
|
-
end
|
31
|
-
|
32
|
-
it "moves the specified number of rows into the footer" do
|
33
|
-
get '/reports/employee', options: {
|
34
|
-
footer: 1
|
35
|
-
}
|
36
|
-
expect(response.body).to eq(File.read('spec/fixtures/reports/employee_with_footer.html'))
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
|
43
|
-
describe "rendering CSV" do
|
44
|
-
|
45
|
-
it "creates a standard CSV report" do
|
46
|
-
get '/reports/employee.csv'
|
47
|
-
expect(response.body).to eq(File.read('spec/fixtures/reports/employee.csv'))
|
48
|
-
end
|
49
|
-
|
50
|
-
end
|
51
|
-
|
52
|
-
describe "rendering XLS" do
|
53
|
-
|
54
|
-
it "creates a standard XLS report" do
|
55
|
-
get '/reports/employee.xls'
|
56
|
-
expect(response.body).to eq(File.read('spec/fixtures/reports/employee.xls'))
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|