rambulance 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +24 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +21 -0
  5. data/Appraisals +28 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +114 -0
  9. data/Rakefile +25 -0
  10. data/gemfiles/rails_32.gemfile +9 -0
  11. data/gemfiles/rails_40.gemfile +9 -0
  12. data/gemfiles/rails_41.gemfile +9 -0
  13. data/gemfiles/rails_edge.gemfile +14 -0
  14. data/lib/generators/rambulance/exceptions_app_generator.rb +20 -0
  15. data/lib/generators/rambulance/install_generator.rb +47 -0
  16. data/lib/generators/rambulance/templates/exceptions_app.rb +13 -0
  17. data/lib/generators/rambulance/templates/rambulance.rb +43 -0
  18. data/lib/generators/rambulance/templates/views/bad_request.html.erb +58 -0
  19. data/lib/generators/rambulance/templates/views/bad_request.html.haml +54 -0
  20. data/lib/generators/rambulance/templates/views/bad_request.json.jbuilder +1 -0
  21. data/lib/generators/rambulance/templates/views/forbidden.html.erb +58 -0
  22. data/lib/generators/rambulance/templates/views/forbidden.html.haml +54 -0
  23. data/lib/generators/rambulance/templates/views/forbidden.json.jbuilder +1 -0
  24. data/lib/generators/rambulance/templates/views/internal_server_error.html.erb +58 -0
  25. data/lib/generators/rambulance/templates/views/internal_server_error.html.haml +54 -0
  26. data/lib/generators/rambulance/templates/views/internal_server_error.json.jbuilder +1 -0
  27. data/lib/generators/rambulance/templates/views/not_found.html.erb +59 -0
  28. data/lib/generators/rambulance/templates/views/not_found.html.haml +55 -0
  29. data/lib/generators/rambulance/templates/views/not_found.json.jbuilder +1 -0
  30. data/lib/generators/rambulance/templates/views/unprocessable_entity.html.erb +59 -0
  31. data/lib/generators/rambulance/templates/views/unprocessable_entity.html.haml +55 -0
  32. data/lib/generators/rambulance/templates/views/unprocessable_entity.json.jbuilder +1 -0
  33. data/lib/rambulance.rb +26 -0
  34. data/lib/rambulance/exceptions_app.rb +56 -0
  35. data/lib/rambulance/railtie.rb +26 -0
  36. data/lib/rambulance/version.rb +3 -0
  37. data/rambulance.gemspec +33 -0
  38. data/spec/fake_app/app/views/errors/internal_server_error.html.erb +1 -0
  39. data/spec/fake_app/app/views/errors/internal_server_error.json.jbuilder +1 -0
  40. data/spec/fake_app/app/views/errors/not_found.html.erb +1 -0
  41. data/spec/fake_app/app/views/errors/not_found.json.jbuilder +1 -0
  42. data/spec/fake_app/app/views/layouts/error.html.erb +10 -0
  43. data/spec/fake_app/lib/exceptions_app.rb +12 -0
  44. data/spec/fake_app/rails_app.rb +59 -0
  45. data/spec/requests/error_json_spec.rb +40 -0
  46. data/spec/requests/error_page_spec.rb +53 -0
  47. data/spec/spec_helper.rb +19 -0
  48. metadata +255 -0
@@ -0,0 +1,54 @@
1
+ :css
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ / This file lives in app/views/errors/bad_request.html.erb
51
+ .dialog
52
+ %div
53
+ %h1 Bad request
54
+ %p The service received a incomplete request.
@@ -0,0 +1 @@
1
+ json.error_message "The service received a incomplete request."
@@ -0,0 +1,58 @@
1
+ <style>
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ </style>
51
+
52
+ <!-- This file lives in app/views/errors/forbidden.html.erb -->
53
+ <div class="dialog">
54
+ <div>
55
+ <h1>Forbidden.</h1>
56
+ </div>
57
+ <p>You are not authorized to access this page.</p>
58
+ </div>
@@ -0,0 +1,54 @@
1
+ :css
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ / This file lives in app/views/errors/forbidden.html.erb
51
+ .dialog
52
+ %div
53
+ %h1 Forbidden.
54
+ %p You are not authorized to access this page.
@@ -0,0 +1 @@
1
+ json.error_message "You are not authorized to access this page."
@@ -0,0 +1,58 @@
1
+ <style>
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ </style>
51
+
52
+ <!-- This file lives in app/views/errors/internal_server_error.html.erb -->
53
+ <div class="dialog">
54
+ <div>
55
+ <h1>We're sorry, but something went wrong.</h1>
56
+ </div>
57
+ <p>If you are the application owner check the logs for more information.</p>
58
+ </div>
@@ -0,0 +1,54 @@
1
+ :css
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ / This file lives in app/views/errors/internal_server_error.html.erb
51
+ .dialog
52
+ %div
53
+ %h1 We're sorry, but something went wrong.
54
+ %p If you are the application owner check the logs for more information.
@@ -0,0 +1 @@
1
+ json.error_message "We're sorry, but something went wrong."
@@ -0,0 +1,59 @@
1
+ <style>
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ </style>
51
+
52
+ <!-- This file lives in app/views/errors/not_found.html.erb -->
53
+ <div class="dialog">
54
+ <div>
55
+ <h1>The page you were looking for doesn't exist.</h1>
56
+ <p>You may have mistyped the address or the page may have moved.</p>
57
+ </div>
58
+ <p>If you are the application owner check the logs for more information.</p>
59
+ </div>
@@ -0,0 +1,55 @@
1
+ :css
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ / This file lives in app/views/errors/not_found.html.erb
51
+ .dialog
52
+ %div
53
+ %h1 The page you were looking for doesn't exist.
54
+ %p You may have mistyped the address or the page may have moved.
55
+ %p If you are the application owner check the logs for more information.
@@ -0,0 +1 @@
1
+ json.error_message "The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved."
@@ -0,0 +1,59 @@
1
+ <style>
2
+ div.dialog {
3
+ color: #2E2F30;
4
+ text-align: center;
5
+ font-family: arial, sans-serif;
6
+ margin: 0;
7
+ width: 95%;
8
+ max-width: 33em;
9
+ margin: 4em auto;
10
+ }
11
+
12
+ div.dialog > div {
13
+ border: 1px solid #CCC;
14
+ border-right-color: #999;
15
+ border-left-color: #999;
16
+ border-bottom-color: #BBB;
17
+ border-top: #B00100 solid 4px;
18
+ border-top-left-radius: 9px;
19
+ border-top-right-radius: 9px;
20
+ background-color: white;
21
+ padding: 7px 12% 0;
22
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
23
+ }
24
+
25
+ h1 {
26
+ font-size: 100%;
27
+ color: #730E15;
28
+ line-height: 1.5em;
29
+ margin: 10px 0;
30
+ }
31
+
32
+ div.dialog p {
33
+ margin: 16px 0;
34
+ }
35
+
36
+ div.dialog > p {
37
+ margin: 0 0 1em;
38
+ padding: 1em;
39
+ background-color: #F7F7F7;
40
+ border: 1px solid #CCC;
41
+ border-right-color: #999;
42
+ border-left-color: #999;
43
+ border-bottom-color: #999;
44
+ border-bottom-left-radius: 4px;
45
+ border-bottom-right-radius: 4px;
46
+ border-top-color: #DADADA;
47
+ color: #666;
48
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
49
+ }
50
+ </style>
51
+
52
+ <!-- This file lives in app/views/errors/unprocessable_entity.html.erb -->
53
+ <div class="dialog">
54
+ <div>
55
+ <h1>The change you wanted was rejected.</h1>
56
+ <p>Maybe you tried to change something you didn't have access to.</p>
57
+ </div>
58
+ <p>If you are the application owner check the logs for more information.</p>
59
+ </div>