cangaroo 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/Rakefile +13 -11
  4. data/app/controllers/cangaroo/endpoint_controller.rb +24 -4
  5. data/app/interactors/cangaroo/count_json_object.rb +3 -0
  6. data/app/interactors/cangaroo/run_polls.rb +12 -0
  7. data/app/interactors/cangaroo/validate_json_schema.rb +9 -3
  8. data/app/jobs/cangaroo/job.rb +9 -27
  9. data/app/jobs/cangaroo/poll_job.rb +67 -0
  10. data/app/models/cangaroo/connection.rb +10 -2
  11. data/app/models/cangaroo/poll_timestamp.rb +17 -0
  12. data/db/migrate/20151030140821_add_parameters_to_cangaroo_connection.rb +1 -1
  13. data/db/migrate/20160317020230_create_cangaroo_poll_timestamps.rb +12 -0
  14. data/lib/cangaroo.rb +2 -0
  15. data/lib/cangaroo/class_configuration.rb +24 -0
  16. data/lib/cangaroo/engine.rb +2 -0
  17. data/lib/cangaroo/logger.rb +66 -0
  18. data/lib/cangaroo/version.rb +1 -1
  19. data/lib/cangaroo/webhook/client.rb +21 -3
  20. data/lib/tasks/cangaroo_tasks.rake +7 -4
  21. data/spec/controllers/cangaroo/endpoint_controller_spec.rb +75 -35
  22. data/spec/fixtures/json_payload_connection_response.json +1 -0
  23. data/spec/fixtures/json_payload_empty.json +3 -0
  24. data/spec/interactors/cangaroo/perform_jobs_spec.rb +28 -13
  25. data/spec/interactors/cangaroo/run_polls_spec.rb +18 -0
  26. data/spec/interactors/cangaroo/validate_json_schema_spec.rb +8 -0
  27. data/spec/jobs/cangaroo/job_spec.rb +12 -1
  28. data/spec/jobs/cangaroo/poll_job_spec.rb +107 -0
  29. data/spec/lib/cangaroo/webhook/client_spec.rb +38 -0
  30. data/spec/rails_helper.rb +18 -44
  31. data/spec/support/database_cleaner.rb +14 -0
  32. data/spec/support/factory_girl.rb +5 -0
  33. data/spec/support/rails_app.rb +29 -0
  34. data/spec/support/shoulda_matchers.rb +8 -0
  35. data/spec/support/webmock.rb +8 -0
  36. metadata +71 -87
  37. data/spec/dummy/README.rdoc +0 -28
  38. data/spec/dummy/Rakefile +0 -6
  39. data/spec/dummy/app/assets/javascripts/application.js +0 -13
  40. data/spec/dummy/app/assets/stylesheets/application.css +0 -15
  41. data/spec/dummy/app/controllers/application_controller.rb +0 -5
  42. data/spec/dummy/app/helpers/application_helper.rb +0 -2
  43. data/spec/dummy/app/views/layouts/application.html.erb +0 -14
  44. data/spec/dummy/bin/bundle +0 -3
  45. data/spec/dummy/bin/rails +0 -4
  46. data/spec/dummy/bin/rake +0 -4
  47. data/spec/dummy/bin/setup +0 -29
  48. data/spec/dummy/config.ru +0 -4
  49. data/spec/dummy/config/application.rb +0 -31
  50. data/spec/dummy/config/boot.rb +0 -5
  51. data/spec/dummy/config/database.yml +0 -11
  52. data/spec/dummy/config/environment.rb +0 -5
  53. data/spec/dummy/config/environments/development.rb +0 -41
  54. data/spec/dummy/config/environments/production.rb +0 -79
  55. data/spec/dummy/config/environments/test.rb +0 -42
  56. data/spec/dummy/config/initializers/assets.rb +0 -11
  57. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  58. data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
  59. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  60. data/spec/dummy/config/initializers/inflections.rb +0 -16
  61. data/spec/dummy/config/initializers/mime_types.rb +0 -4
  62. data/spec/dummy/config/initializers/session_store.rb +0 -3
  63. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -9
  64. data/spec/dummy/config/locales/en.yml +0 -23
  65. data/spec/dummy/config/routes.rb +0 -4
  66. data/spec/dummy/config/secrets.yml +0 -22
  67. data/spec/dummy/db/development.sqlite3 +0 -0
  68. data/spec/dummy/db/schema.rb +0 -29
  69. data/spec/dummy/db/test.sqlite3 +0 -0
  70. data/spec/dummy/log/cangaroo.log +0 -0
  71. data/spec/dummy/log/development.log +0 -4024
  72. data/spec/dummy/log/test.log +0 -166964
  73. data/spec/dummy/public/404.html +0 -67
  74. data/spec/dummy/public/422.html +0 -67
  75. data/spec/dummy/public/500.html +0 -66
  76. data/spec/dummy/public/favicon.ico +0 -0
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/404.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The page you were looking for doesn't exist.</h1>
62
- <p>You may have mistyped the address or the page may have moved.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,67 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/422.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>The change you wanted was rejected.</h1>
62
- <p>Maybe you tried to change something you didn't have access to.</p>
63
- </div>
64
- <p>If you are the application owner check the logs for more information.</p>
65
- </div>
66
- </body>
67
- </html>
@@ -1,66 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- body {
8
- background-color: #EFEFEF;
9
- color: #2E2F30;
10
- text-align: center;
11
- font-family: arial, sans-serif;
12
- margin: 0;
13
- }
14
-
15
- div.dialog {
16
- width: 95%;
17
- max-width: 33em;
18
- margin: 4em auto 0;
19
- }
20
-
21
- div.dialog > div {
22
- border: 1px solid #CCC;
23
- border-right-color: #999;
24
- border-left-color: #999;
25
- border-bottom-color: #BBB;
26
- border-top: #B00100 solid 4px;
27
- border-top-left-radius: 9px;
28
- border-top-right-radius: 9px;
29
- background-color: white;
30
- padding: 7px 12% 0;
31
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
- }
33
-
34
- h1 {
35
- font-size: 100%;
36
- color: #730E15;
37
- line-height: 1.5em;
38
- }
39
-
40
- div.dialog > p {
41
- margin: 0 0 1em;
42
- padding: 1em;
43
- background-color: #F7F7F7;
44
- border: 1px solid #CCC;
45
- border-right-color: #999;
46
- border-left-color: #999;
47
- border-bottom-color: #999;
48
- border-bottom-left-radius: 4px;
49
- border-bottom-right-radius: 4px;
50
- border-top-color: #DADADA;
51
- color: #666;
52
- box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
- }
54
- </style>
55
- </head>
56
-
57
- <body>
58
- <!-- This file lives in public/500.html -->
59
- <div class="dialog">
60
- <div>
61
- <h1>We're sorry, but something went wrong.</h1>
62
- </div>
63
- <p>If you are the application owner check the logs for more information.</p>
64
- </div>
65
- </body>
66
- </html>
File without changes