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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/crusade_rails/configuration.js.coffee.erb +2 -2
- data/app/controllers/crusade_rails/apns/v1/push_package_controller.rb +1 -1
- data/app/services/crusade_rails/notification_service.rb +1 -1
- data/config/routes.rb +12 -9
- data/lib/crusade_rails/engine.rb +2 -3
- data/lib/crusade_rails/version.rb +1 -1
- data/lib/generators/crusade/install/install_generator.rb +1 -1
- data/lib/generators/crusade/install/templates/{configuration.yml → configuration-apns.yml} +0 -0
- data/lib/generators/crusade/install/templates/initializer.rb +5 -1
- data/test/dummy/config/{crusade.yml → crusade-apns.yml} +3 -3
- data/test/dummy/config/initializers/crusade.rb +5 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- 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
- data/test/dummy/db/schema.rb +1 -10
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +335 -8863
- data/test/dummy/log/test.log +3510 -11658
- data/test/dummy/tmp/cache/assets/development/sprockets/{f3676986bcff0feb06ca29fc36c62054 → 07be86ef00416c18f2f7dd96f4603129} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/116d0ea1f1fccbc5f17329e738b48f32 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{ff6fd5ae68516118b84d0dc0485e4456 → 1c6cab9972997baaf0f7fd1599e62590} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2a4f82e222d708931c0b88831e1bb864 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2fe1114a6234d617f0bb5e464a840942 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{3cde555d17b62d65401cc9272bae6e08 → 39b9141911bd7b575b7e782b8c405a0d} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/3c9d7a4a4511e1418a3f5e9beaac8d0a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{1903ce46cdbce5cbddb3f58cacb00c89 → 45a685d3bc33555e456c32424fd838e8} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{9f6a5c70035131b2862f0cf1b1ffba5f → 576608e546507cd114398639d7f7bd5d} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{732aa0a732c68b36c462c1aa61e9c5db → 57adfe7d0eeb4aca9491ffb75157956e} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{8b4c20d1cbaeadc08407a48823e8c7c3 → 5c7b888c11190fa68628e8fd3212e8fd} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{8674169919e38981b419dbd475a583aa → 5ded1a08ed08028fbe21471a88881d28} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{742719bcba2beaa6ee593b3c6eabe40b → 5e40cea3d1e28179f2a2ad998d1f26f7} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{27cb4afd1625534b2a374a81b9df26de → 618327f5ca738fb1d560cdf13c073bf3} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{24efeb1e9e576159a181fb53b3f114a7 → 6e6652fce2d9f8b871274ccb2af329c7} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{3cc705332293b3c69203db8a96e9d830 → 6f5e75e28ef2f140b52beb6f1b6609b9} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{fcd414d106937117c1f77dafcb48d32d → 7161340e0502d24611730dd49b15e115} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/7d4e507c01e7ef7a4dc9d7f9c5478ca4 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{6f19bfcf39fc6e2ba42b315015e41741 → 803bc12cb782253e6b4191a7346991c5} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8b3d3f72f349b54596b95558be73d55d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{19e13c514bd0c76f667eacd20d91d72c → 97ba61a3e4a7ec32873e08c29a7a6f94} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{76d2c2ca1f8747e7c285677d59d1f9d9 → 9ccfcc3c008514fb5c35aa7b3d7bbc78} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{2e0be385ec13186af8c1ea31b03b96fd → a82b6a43a4be516353a2ac1d89f6b610} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{b116102c65d66d0bac493130339e906f → a92311b92483c1f9472df2622e658768} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{3125a19a8cea48c16b56e8b59a5c5294 → aba15ac42f92b66ff70b0a3e26184263} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{edb1e911142e4ffa330d5f54129ae937 → b75702adcae93ffe045a33824fc40f12} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{3cd8491f62d0bb72dc92a13205463599 → be89d70eb8f19e72ed6ad9481a7c1b9a} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c1d4b2d589a2dc7649e075ffea2d2566 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{b3c46efa2d626eb47c04b3299485ada2 → cd0a1473787729a36454fd789dd86195} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{b0f0a9774bdd9aba74bc3dbaa280abd2 → d03fd0d3629c94a744a70d063d15eb6f} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{9bf8f0dcacf365b365a44fc7acaf5b33 → d572f7956c1b132aba30f71dfb1334d9} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{2969a922d5c2342a65712f8bd9cc99a6 → dc8639471867248d3cfc41c6dad35a43} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{6701d9e3411fdcd8e5e547bdec87cb66 → e113ed0ed8564e75067a161599ed7fc9} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{aa3a6aa3669f27355e35fd070b5ec5cc → e2bd66166c81c25a6fea7aab23cf58cf} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{2de3b3bd851fd121492b6d4ac403e556 → e653b1d89bb66ba5ee551887655e02da} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{28fcfef8d3cf8654ba549bc1761e83e4 → eb5bc1e85d69a5ec7063b599c7f6acf1} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f084f98622288fc6a4d8fdbc755bcb48 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{8d66da576394374d14318805fe809466 → f99eb680da1b65060a9388e0b41f19b0} +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/{dfb8f1f4a35d49c4853bb839dd074b03 → fa3e415ce51e582faa842454baced5a3} +0 -0
- data/test/generators/install_generator_test.rb +3 -3
- data/test/javascripts/support/configuration.js.coffee +4 -0
- data/test/javascripts/support/{safari.coffee → safari.js.coffee} +0 -0
- data/test/javascripts/{test_helper.coffee → test_helper.js.coffee} +0 -0
- data/test/javascripts/unit/{crusade_test.js.coffee → crusade_spec.js.coffee} +0 -0
- data/test/routes/apns_routes_test.rb +14 -0
- data/test/services/notification_service_test.rb +1 -1
- data/test/test_helper.rb +5 -0
- metadata +100 -140
- data/config/initializers/teaspoon.rb +0 -65
- data/lib/crusade_rails/configuration_loader.rb +0 -33
- data/test/dummy/tmp/cache/assets/development/sprockets/0330051201f83b2ff3843e3c6747e79d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0534641409a2140bc6e7ebc3ffb3a54d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/108a4cc5d6041a541455f23f064f718f +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/10b6d318fbf01394655188cb55968932 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/1d295354fabfd91032e5c51cf32fe192 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/2e465486b1a6c8f2d49a4ed114d70396 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/556f3a4cc7bf634157a1bcb26a3d2b6d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/5f268780e6c88d505c5593761755010a +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6b77a9aa8954a56d3da421ee8f0813e8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/72194bfe82d488c5e022c9046c0581c5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/753c20567a3407e94309e3a586ba70c1 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/8770d1f7ac46ca50bf453462671ea0b9 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/9aacc018015dba444d327301c20b63c5 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/b60162f01dfafeaa2fd08552bee0d7b7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ba4082b2576e0439500c1de73f75e722 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/bd98cfe5b883a49d02e51dff15eb2d62 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d0ba95da0d65927f38a86ec70536acfa +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/ddcd3a7d9f01da29b22f5bb8894c9e9d +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f8e371443421803a78fdbe7fb29531b7 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f9b223cb5385faca472d99ad42c60776 +0 -0
- data/test/integration/configuration_loader_test.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1758a05336f3d5d9c4b170811ddb6ab87a12cccf
|
4
|
+
data.tar.gz: 3a303c0367f99bf7ec1ced5188f7022b9fc1d171
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c69c513d634b54a466de60fb9a4afbc5a9a21ff8f4debca5e3d0c662786dc4ef1f7fc5789daa87dd39697bba6157c9f7af61b883cc29c98837acc7ccf84fd639
|
7
|
+
data.tar.gz: f1f7fbf9ab9aa59fede370fb27537c5c82f31edd606b38e58b9bcef04f7b8143c7912ca44cd922500fa5a63c7aa62064fccd39113f8e409fdceb312bba017ce0
|
@@ -1,4 +1,4 @@
|
|
1
1
|
|
2
2
|
window.crusade =
|
3
|
-
pushId: '<%= Rails.application.config.crusade.push_id %>'
|
4
|
-
webserviceUrl: '<%= Rails.application.config.crusade.webservice_url %>'
|
3
|
+
pushId: '<%= Rails.application.config.crusade.apns.push_id %>'
|
4
|
+
webserviceUrl: '<%= Rails.application.config.crusade.apns.webservice_url %>'
|
@@ -5,7 +5,7 @@ module CrusadeRails
|
|
5
5
|
skip_before_action :verify_authenticity_token
|
6
6
|
|
7
7
|
def create
|
8
|
-
generator = Crusade::APNS::PushPackageGenerator.new Rails.application.config.crusade
|
8
|
+
generator = Crusade::APNS::PushPackageGenerator.new Rails.application.config.crusade.apns
|
9
9
|
user_id = json['user']
|
10
10
|
|
11
11
|
Rails.logger.debug "requesting push package for user #{user_id}"
|
data/config/routes.rb
CHANGED
@@ -1,15 +1,18 @@
|
|
1
1
|
CrusadeRails::Engine.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
if Rails.application.config.respond_to?(:crusade) &&
|
3
|
+
Rails.application.config.crusade.respond_to?(:apns)
|
4
|
+
namespace "apns" do
|
5
|
+
namespace "v1" do
|
6
|
+
post "pushPackages/#{Rails.application.config.crusade.apns.push_id}",
|
7
|
+
to: "push_package#create", as: "apns_push_package"
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
post "/devices/:device_token/registrations/#{Rails.application.config.crusade.apns.push_id}",
|
10
|
+
to: "subscription#create", as: "apns_push_registration"
|
11
|
+
delete "/devices/:device_token/registrations/#{Rails.application.config.crusade.apns.push_id}",
|
12
|
+
to: "subscription#delete", as: "apns_push_unregistration"
|
11
13
|
|
12
|
-
|
14
|
+
post "log", to: "log#create", as: "apns_log"
|
15
|
+
end
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
data/lib/crusade_rails/engine.rb
CHANGED
@@ -8,7 +8,7 @@ class Crusade::InstallGenerator < Rails::Generators::Base
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def copy_configuration_file
|
11
|
-
template "configuration.yml", File.join(destination_root, "config", "crusade.yml")
|
11
|
+
template "configuration-apns.yml", File.join(destination_root, "config", "crusade-apns.yml")
|
12
12
|
end
|
13
13
|
|
14
14
|
def update_routes
|
File without changes
|
@@ -1,8 +1,8 @@
|
|
1
1
|
default: &default
|
2
2
|
site_name: Apns config fixture
|
3
3
|
push_id: web.com.example.push.id
|
4
|
-
iconset_dir: lib/icon.iconset
|
5
|
-
certificate: config/certificate.p12
|
4
|
+
iconset_dir: test/dummy/lib/icon.iconset
|
5
|
+
certificate: test/dummy/config/certificate.p12
|
6
6
|
certificate_password: test
|
7
7
|
|
8
8
|
development:
|
@@ -20,4 +20,4 @@ test:
|
|
20
20
|
allowed_domains:
|
21
21
|
- http://localhost
|
22
22
|
- https://localhost
|
23
|
-
certificate_password:
|
23
|
+
certificate_password: test
|
Binary file
|
File without changes
|
data/test/dummy/db/schema.rb
CHANGED
@@ -11,16 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
15
|
-
|
16
|
-
create_table "crusade_rails_engine_user_subscriptions", force: true do |t|
|
17
|
-
t.integer "user_id"
|
18
|
-
t.string "user_token"
|
19
|
-
t.string "device_token"
|
20
|
-
t.boolean "active"
|
21
|
-
t.datetime "created_at"
|
22
|
-
t.datetime "updated_at"
|
23
|
-
end
|
14
|
+
ActiveRecord::Schema.define(version: 20130922190000) do
|
24
15
|
|
25
16
|
create_table "crusade_rails_user_subscriptions", force: true do |t|
|
26
17
|
t.integer "user_id"
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|