crusade_rails 0.0.1 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/crusade_rails/configuration.js.coffee.erb +2 -2
  3. data/app/controllers/crusade_rails/apns/v1/push_package_controller.rb +1 -1
  4. data/app/services/crusade_rails/notification_service.rb +1 -1
  5. data/config/routes.rb +12 -9
  6. data/lib/crusade_rails/engine.rb +2 -3
  7. data/lib/crusade_rails/version.rb +1 -1
  8. data/lib/generators/crusade/install/install_generator.rb +1 -1
  9. data/lib/generators/crusade/install/templates/{configuration.yml → configuration-apns.yml} +0 -0
  10. data/lib/generators/crusade/install/templates/initializer.rb +5 -1
  11. data/test/dummy/config/{crusade.yml → crusade-apns.yml} +3 -3
  12. data/test/dummy/config/initializers/crusade.rb +5 -1
  13. data/test/dummy/db/development.sqlite3 +0 -0
  14. data/test/dummy/db/migrate/{20130921092524_create_crusade_rails_user_subscriptions.crusade_rails.rb → 20130922190000_create_crusade_rails_user_subscriptions.crusade_rails.rb} +0 -0
  15. data/test/dummy/db/schema.rb +1 -10
  16. data/test/dummy/db/test.sqlite3 +0 -0
  17. data/test/dummy/log/development.log +335 -8863
  18. data/test/dummy/log/test.log +3510 -11658
  19. data/test/dummy/tmp/cache/assets/development/sprockets/{f3676986bcff0feb06ca29fc36c62054 → 07be86ef00416c18f2f7dd96f4603129} +0 -0
  20. data/test/dummy/tmp/cache/assets/development/sprockets/116d0ea1f1fccbc5f17329e738b48f32 +0 -0
  21. data/test/dummy/tmp/cache/assets/development/sprockets/{ff6fd5ae68516118b84d0dc0485e4456 → 1c6cab9972997baaf0f7fd1599e62590} +0 -0
  22. data/test/dummy/tmp/cache/assets/development/sprockets/2a4f82e222d708931c0b88831e1bb864 +0 -0
  23. data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  24. data/test/dummy/tmp/cache/assets/development/sprockets/2fe1114a6234d617f0bb5e464a840942 +0 -0
  25. data/test/dummy/tmp/cache/assets/development/sprockets/{3cde555d17b62d65401cc9272bae6e08 → 39b9141911bd7b575b7e782b8c405a0d} +0 -0
  26. data/test/dummy/tmp/cache/assets/development/sprockets/3c9d7a4a4511e1418a3f5e9beaac8d0a +0 -0
  27. data/test/dummy/tmp/cache/assets/development/sprockets/{1903ce46cdbce5cbddb3f58cacb00c89 → 45a685d3bc33555e456c32424fd838e8} +0 -0
  28. data/test/dummy/tmp/cache/assets/development/sprockets/{9f6a5c70035131b2862f0cf1b1ffba5f → 576608e546507cd114398639d7f7bd5d} +0 -0
  29. data/test/dummy/tmp/cache/assets/development/sprockets/{732aa0a732c68b36c462c1aa61e9c5db → 57adfe7d0eeb4aca9491ffb75157956e} +0 -0
  30. data/test/dummy/tmp/cache/assets/development/sprockets/{8b4c20d1cbaeadc08407a48823e8c7c3 → 5c7b888c11190fa68628e8fd3212e8fd} +0 -0
  31. data/test/dummy/tmp/cache/assets/development/sprockets/{8674169919e38981b419dbd475a583aa → 5ded1a08ed08028fbe21471a88881d28} +0 -0
  32. data/test/dummy/tmp/cache/assets/development/sprockets/{742719bcba2beaa6ee593b3c6eabe40b → 5e40cea3d1e28179f2a2ad998d1f26f7} +0 -0
  33. data/test/dummy/tmp/cache/assets/development/sprockets/{27cb4afd1625534b2a374a81b9df26de → 618327f5ca738fb1d560cdf13c073bf3} +0 -0
  34. data/test/dummy/tmp/cache/assets/development/sprockets/{24efeb1e9e576159a181fb53b3f114a7 → 6e6652fce2d9f8b871274ccb2af329c7} +0 -0
  35. data/test/dummy/tmp/cache/assets/development/sprockets/{3cc705332293b3c69203db8a96e9d830 → 6f5e75e28ef2f140b52beb6f1b6609b9} +0 -0
  36. data/test/dummy/tmp/cache/assets/development/sprockets/{fcd414d106937117c1f77dafcb48d32d → 7161340e0502d24611730dd49b15e115} +0 -0
  37. data/test/dummy/tmp/cache/assets/development/sprockets/7d4e507c01e7ef7a4dc9d7f9c5478ca4 +0 -0
  38. data/test/dummy/tmp/cache/assets/development/sprockets/{6f19bfcf39fc6e2ba42b315015e41741 → 803bc12cb782253e6b4191a7346991c5} +0 -0
  39. data/test/dummy/tmp/cache/assets/development/sprockets/8b3d3f72f349b54596b95558be73d55d +0 -0
  40. data/test/dummy/tmp/cache/assets/development/sprockets/{19e13c514bd0c76f667eacd20d91d72c → 97ba61a3e4a7ec32873e08c29a7a6f94} +0 -0
  41. data/test/dummy/tmp/cache/assets/development/sprockets/{76d2c2ca1f8747e7c285677d59d1f9d9 → 9ccfcc3c008514fb5c35aa7b3d7bbc78} +0 -0
  42. data/test/dummy/tmp/cache/assets/development/sprockets/{2e0be385ec13186af8c1ea31b03b96fd → a82b6a43a4be516353a2ac1d89f6b610} +0 -0
  43. data/test/dummy/tmp/cache/assets/development/sprockets/{b116102c65d66d0bac493130339e906f → a92311b92483c1f9472df2622e658768} +0 -0
  44. data/test/dummy/tmp/cache/assets/development/sprockets/{3125a19a8cea48c16b56e8b59a5c5294 → aba15ac42f92b66ff70b0a3e26184263} +0 -0
  45. data/test/dummy/tmp/cache/assets/development/sprockets/{edb1e911142e4ffa330d5f54129ae937 → b75702adcae93ffe045a33824fc40f12} +0 -0
  46. data/test/dummy/tmp/cache/assets/development/sprockets/{3cd8491f62d0bb72dc92a13205463599 → be89d70eb8f19e72ed6ad9481a7c1b9a} +0 -0
  47. data/test/dummy/tmp/cache/assets/development/sprockets/c1d4b2d589a2dc7649e075ffea2d2566 +0 -0
  48. data/test/dummy/tmp/cache/assets/development/sprockets/{b3c46efa2d626eb47c04b3299485ada2 → cd0a1473787729a36454fd789dd86195} +0 -0
  49. data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  50. data/test/dummy/tmp/cache/assets/development/sprockets/{b0f0a9774bdd9aba74bc3dbaa280abd2 → d03fd0d3629c94a744a70d063d15eb6f} +0 -0
  51. data/test/dummy/tmp/cache/assets/development/sprockets/{9bf8f0dcacf365b365a44fc7acaf5b33 → d572f7956c1b132aba30f71dfb1334d9} +0 -0
  52. data/test/dummy/tmp/cache/assets/development/sprockets/{2969a922d5c2342a65712f8bd9cc99a6 → dc8639471867248d3cfc41c6dad35a43} +0 -0
  53. data/test/dummy/tmp/cache/assets/development/sprockets/{6701d9e3411fdcd8e5e547bdec87cb66 → e113ed0ed8564e75067a161599ed7fc9} +0 -0
  54. data/test/dummy/tmp/cache/assets/development/sprockets/{aa3a6aa3669f27355e35fd070b5ec5cc → e2bd66166c81c25a6fea7aab23cf58cf} +0 -0
  55. data/test/dummy/tmp/cache/assets/development/sprockets/{2de3b3bd851fd121492b6d4ac403e556 → e653b1d89bb66ba5ee551887655e02da} +0 -0
  56. data/test/dummy/tmp/cache/assets/development/sprockets/{28fcfef8d3cf8654ba549bc1761e83e4 → eb5bc1e85d69a5ec7063b599c7f6acf1} +0 -0
  57. data/test/dummy/tmp/cache/assets/development/sprockets/f084f98622288fc6a4d8fdbc755bcb48 +0 -0
  58. data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  59. data/test/dummy/tmp/cache/assets/development/sprockets/{8d66da576394374d14318805fe809466 → f99eb680da1b65060a9388e0b41f19b0} +0 -0
  60. data/test/dummy/tmp/cache/assets/development/sprockets/{dfb8f1f4a35d49c4853bb839dd074b03 → fa3e415ce51e582faa842454baced5a3} +0 -0
  61. data/test/generators/install_generator_test.rb +3 -3
  62. data/test/javascripts/support/configuration.js.coffee +4 -0
  63. data/test/javascripts/support/{safari.coffee → safari.js.coffee} +0 -0
  64. data/test/javascripts/{test_helper.coffee → test_helper.js.coffee} +0 -0
  65. data/test/javascripts/unit/{crusade_test.js.coffee → crusade_spec.js.coffee} +0 -0
  66. data/test/routes/apns_routes_test.rb +14 -0
  67. data/test/services/notification_service_test.rb +1 -1
  68. data/test/test_helper.rb +5 -0
  69. metadata +100 -140
  70. data/config/initializers/teaspoon.rb +0 -65
  71. data/lib/crusade_rails/configuration_loader.rb +0 -33
  72. data/test/dummy/tmp/cache/assets/development/sprockets/0330051201f83b2ff3843e3c6747e79d +0 -0
  73. data/test/dummy/tmp/cache/assets/development/sprockets/0534641409a2140bc6e7ebc3ffb3a54d +0 -0
  74. data/test/dummy/tmp/cache/assets/development/sprockets/108a4cc5d6041a541455f23f064f718f +0 -0
  75. data/test/dummy/tmp/cache/assets/development/sprockets/10b6d318fbf01394655188cb55968932 +0 -0
  76. data/test/dummy/tmp/cache/assets/development/sprockets/1d295354fabfd91032e5c51cf32fe192 +0 -0
  77. data/test/dummy/tmp/cache/assets/development/sprockets/2e465486b1a6c8f2d49a4ed114d70396 +0 -0
  78. data/test/dummy/tmp/cache/assets/development/sprockets/556f3a4cc7bf634157a1bcb26a3d2b6d +0 -0
  79. data/test/dummy/tmp/cache/assets/development/sprockets/5f268780e6c88d505c5593761755010a +0 -0
  80. data/test/dummy/tmp/cache/assets/development/sprockets/6b77a9aa8954a56d3da421ee8f0813e8 +0 -0
  81. data/test/dummy/tmp/cache/assets/development/sprockets/72194bfe82d488c5e022c9046c0581c5 +0 -0
  82. data/test/dummy/tmp/cache/assets/development/sprockets/753c20567a3407e94309e3a586ba70c1 +0 -0
  83. data/test/dummy/tmp/cache/assets/development/sprockets/8770d1f7ac46ca50bf453462671ea0b9 +0 -0
  84. data/test/dummy/tmp/cache/assets/development/sprockets/9aacc018015dba444d327301c20b63c5 +0 -0
  85. data/test/dummy/tmp/cache/assets/development/sprockets/b60162f01dfafeaa2fd08552bee0d7b7 +0 -0
  86. data/test/dummy/tmp/cache/assets/development/sprockets/ba4082b2576e0439500c1de73f75e722 +0 -0
  87. data/test/dummy/tmp/cache/assets/development/sprockets/bd98cfe5b883a49d02e51dff15eb2d62 +0 -0
  88. data/test/dummy/tmp/cache/assets/development/sprockets/d0ba95da0d65927f38a86ec70536acfa +0 -0
  89. data/test/dummy/tmp/cache/assets/development/sprockets/ddcd3a7d9f01da29b22f5bb8894c9e9d +0 -0
  90. data/test/dummy/tmp/cache/assets/development/sprockets/f8e371443421803a78fdbe7fb29531b7 +0 -0
  91. data/test/dummy/tmp/cache/assets/development/sprockets/f9b223cb5385faca472d99ad42c60776 +0 -0
  92. data/test/integration/configuration_loader_test.rb +0 -56
@@ -1,65 +0,0 @@
1
- Teaspoon.setup do |config|
2
- require 'coffee_script'
3
-
4
- # This determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
5
- # http://localhost:3000/jasmine to run your specs.
6
- config.mount_at = "/teaspoon"
7
-
8
- # This defaults to Rails.root if left nil. If you're testing an engine using a dummy application it can be useful to
9
- # set this to your engines root.. E.g. `Teaspoon::Engine.root`
10
- config.root = CrusadeRails::Engine.root
11
-
12
- # These paths are appended to the Rails assets paths (relative to config.root), and by default is an array that you
13
- # can replace or add to.
14
- config.asset_paths = ["test/javascripts", "test/javascripts/stylesheets"]
15
-
16
- # Fixtures are rendered through a standard controller. This means you can use things like HAML or RABL/JBuilder, etc.
17
- # to generate fixtures within this path.
18
- config.fixture_path = "test/javascripts/fixtures"
19
-
20
- # You can modify the default suite configuration and create new suites here. Suites can be isolated from one another.
21
- # When defining a suite you can provide a name and a block. If the name is left blank, :default is assumed. You can
22
- # omit various directives and the defaults will be used.
23
- #
24
- # To run a specific suite
25
- # - in the browser: http://localhost/teaspoon/[suite_name]
26
- # - from the command line: rake teaspoon suite=[suite_name]
27
- config.suite do |suite|
28
-
29
- # You can specify a file matcher and all matching files will be loaded when the suite is run. It's important that
30
- # these files are serve-able from sprockets.
31
- #
32
- # Note: Can also be set to nil.
33
- suite.matcher = "{test/javascripts,app/assets}/**/*.{js,js.coffee,coffee}"
34
-
35
- # Each suite can load a different helper, which can in turn require additional files. This file is loaded before
36
- # your specs are loaded, and can be used as a manifest.
37
- suite.helper = "test_helper"
38
-
39
- # These are the core Teaspoon javascripts. It's strongly encouraged to include only the base files here. You can
40
- # require other support libraries in your spec helper, which allows you to change them without having to restart the
41
- # server.
42
- #
43
- # Available frameworks: teaspoon-jasmine, teaspoon-mocha, teaspoon-qunit
44
- #
45
- # Note: To use the CoffeeScript source files use `"teaspoon/jasmine"` etc.
46
- suite.javascripts = ["teaspoon-jasmine"]
47
-
48
- # If you want to change how Teaspoon looks, or include your own stylesheets you can do that here. The default is the
49
- # stylesheet for the HTML reporter.
50
- suite.stylesheets = ["teaspoon"]
51
-
52
- # When running coverage reports, you probably want to exclude libraries that you're not testing.
53
- # Accepts an array of filenames or regular expressions. The default is to exclude assets from vendors or gems.
54
- suite.no_coverage = [%r{/lib/ruby/gems/}, %r{/vendor/assets/}, %r{/support/}, %r{/(.+)_helper.}]
55
- # suite.no_coverage << "jquery.min.js" # excludes jquery from coverage reports
56
-
57
- end
58
-
59
- # Example suite. Since we're just filtering to files already within the root test/javascripts, these files will also
60
- # be run in the default suite -- but can be focused into a more specific suite.
61
- #config.suite :targeted do |suite|
62
- # suite.matcher = "spec/javascripts/targeted/*_test.{js,js.coffee,coffee}"
63
- #end
64
-
65
- end if defined?(Teaspoon) && Teaspoon.respond_to?(:setup) # let Teaspoon be undefined outside of development/test/asset groups
@@ -1,33 +0,0 @@
1
- require 'pathname'
2
-
3
- module CrusadeRails
4
- def load_configuration!(configuration_file = default_configuration_file)
5
- configuration = load_configuration_file configuration_file
6
- configuration = preappend_absolute_path(configuration)
7
- Rails.application.config.crusade = configuration
8
- configuration
9
- end
10
-
11
- extend self
12
-
13
- private
14
-
15
- def load_configuration_file(config_file)
16
- Crusade::APNS::Configuration.load config_file
17
- end
18
-
19
- def default_configuration_file
20
- File.join Rails.root, "config", "crusade.yml"
21
- end
22
-
23
- def preappend_absolute_path(config)
24
- config.iconset_dir = change_path config.iconset_dir
25
- config.certificate = change_path config.certificate
26
- config
27
- end
28
-
29
- def change_path(path)
30
- pathname = Pathname.new path
31
- pathname.absolute? ? path : File.join(Rails.root, path)
32
- end
33
- end
@@ -1,56 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe CrusadeRails do
4
-
5
- describe 'initializer' do
6
- it 'loads the configuration' do
7
- Rails.application.config.crusade.wont_be_nil
8
- end
9
- end
10
-
11
- describe 'load_configuration' do
12
- let(:configuration) { CrusadeRails::load_configuration! }
13
-
14
- it 'loads the configuration in the config directory' do
15
- configuration.webservice_url.must_equal 'https://www.example.com/push'
16
- end
17
-
18
- it 'sets the config into the rails application configuration' do
19
- config = Rails.application.config.crusade
20
-
21
- config.webservice_url.must_equal 'https://www.example.com/push'
22
- end
23
-
24
- describe 'relative paths' do
25
- it 'prefixes the iconset.dir by the Rails.root' do
26
- configuration.iconset_dir.must_equal File.join Rails.root, 'lib/icon.iconset'
27
- end
28
-
29
- it 'prefixes the certificate by the Rails.root' do
30
- configuration.certificate.must_equal File.join Rails.root, 'config/certificate.p12'
31
- end
32
-
33
- end
34
-
35
- describe 'absolute paths' do
36
- let(:absolute_file) { "#{Rails.root}/config/crusade_absolute.yml" }
37
- let(:configuration) { CrusadeRails::load_configuration! absolute_file }
38
-
39
- it 'keeps the iconset.dir' do
40
- configuration.iconset_dir.must_equal '/tmp/lib/icon.iconset'
41
- end
42
-
43
- it 'keeps the certificate' do
44
- configuration.certificate.must_equal '/tmp/config/certificate.p12'
45
- end
46
- end
47
-
48
- it 'does not memoizes the configuration' do
49
- config = Rails.application.config.crusade
50
-
51
- CrusadeRails::load_configuration!
52
-
53
- config.wont_be_same_as Rails.application.config.crusade
54
- end
55
- end
56
- end