rack-push-notification 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +17 -17
- data/README.md +2 -4
- data/lib/rack/push-notification.rb +3 -4
- data/rack-push-notification.gemspec +4 -5
- metadata +22 -38
- data/rack-push-notification-0.3.0.gem +0 -0
- data/rack-push-notification-0.3.1.gem +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7158118a325fbe97b553fdba39b6601aead4e759
|
4
|
+
data.tar.gz: 4d815d1b54ea558d42d335117e3716b7e24511af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf1cb846d483542c6274fb32c7013b4fbba693685dc38ca0bd9997ff36bd52a1dcbaf65f2a053382b48f30f40901ba7f2943b6bdd973180e5e3ee6cf6f1ff766
|
7
|
+
data.tar.gz: b23dbd8e6747006446209c7cc2c5eb9294e97ee0b68eeb7fa177248ef33e69b2d7975fed702f88df1e0911ab487ee2e61775b6e808cb9148fc023161264ce8ae
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rack-push-notification (0.4.
|
5
|
-
houston (~> 0.1.1)
|
4
|
+
rack-push-notification (0.4.1)
|
6
5
|
rack (~> 1.4)
|
7
6
|
rack-contrib (~> 1.1)
|
8
7
|
sequel (~> 3.37)
|
@@ -12,33 +11,34 @@ PATH
|
|
12
11
|
GEM
|
13
12
|
remote: https://rubygems.org/
|
14
13
|
specs:
|
15
|
-
|
16
|
-
highline (~> 1.6.11)
|
17
|
-
highline (1.6.16)
|
18
|
-
houston (0.1.1)
|
19
|
-
commander (~> 4.1.2)
|
20
|
-
json (~> 1.7.3)
|
21
|
-
json (1.7.7)
|
14
|
+
diff-lcs (1.2.4)
|
22
15
|
rack (1.5.2)
|
23
16
|
rack-contrib (1.1.0)
|
24
17
|
rack (>= 0.9.1)
|
25
18
|
rack-protection (1.5.0)
|
26
19
|
rack
|
27
|
-
rake (0.
|
28
|
-
rspec (
|
29
|
-
|
30
|
-
|
20
|
+
rake (10.0.4)
|
21
|
+
rspec (2.13.0)
|
22
|
+
rspec-core (~> 2.13.0)
|
23
|
+
rspec-expectations (~> 2.13.0)
|
24
|
+
rspec-mocks (~> 2.13.0)
|
25
|
+
rspec-core (2.13.1)
|
26
|
+
rspec-expectations (2.13.0)
|
27
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
28
|
+
rspec-mocks (2.13.1)
|
29
|
+
sequel (3.46.0)
|
30
|
+
sinatra (1.4.2)
|
31
31
|
rack (~> 1.5, >= 1.5.2)
|
32
32
|
rack-protection (~> 1.4)
|
33
33
|
tilt (~> 1.3, >= 1.3.4)
|
34
|
-
sinatra-param (0.1.
|
34
|
+
sinatra-param (0.1.3)
|
35
35
|
sinatra (~> 1.3)
|
36
|
-
tilt (1.3.
|
36
|
+
tilt (1.3.7)
|
37
37
|
|
38
38
|
PLATFORMS
|
39
39
|
ruby
|
40
40
|
|
41
41
|
DEPENDENCIES
|
42
42
|
rack-push-notification!
|
43
|
-
rake
|
44
|
-
rspec
|
43
|
+
rake
|
44
|
+
rspec
|
data/README.md
CHANGED
@@ -2,9 +2,7 @@ Rack::PushNotification
|
|
2
2
|
======================
|
3
3
|
**A Rack-mountable webservice for managing push notifications**
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
`Rack::PushNotification` generates API endpoints that can be consumed by iOS apps to register and unregister for push notifications. Along with the registration API, `Rack::PushNotification` spawns an admin console that gives you a convenient interface to manage device tokens and compose targeted push notification messages.
|
5
|
+
`Rack::PushNotification` generates API endpoints that can be consumed by iOS apps to register and unregister for push notifications.
|
8
6
|
|
9
7
|
## Example Record
|
10
8
|
|
@@ -29,7 +27,7 @@ A device's `locale` & `language` can be used to localize outgoing communications
|
|
29
27
|
|
30
28
|
## Example Usage
|
31
29
|
|
32
|
-
Rack::PushNotification can be run as Rack middleware or as a single web application. All that is required is a connection to a Postgres database.
|
30
|
+
Rack::PushNotification can be run as Rack middleware or as a single web application. All that is required is a connection to a Postgres database. You must define this with the environment variable `DATABASE_URL`. For rails, use the `rails-database-url` to define this from the `database.yml`.
|
33
31
|
|
34
32
|
### config.ru
|
35
33
|
|
@@ -8,8 +8,6 @@ require 'sequel'
|
|
8
8
|
|
9
9
|
module Rack
|
10
10
|
class PushNotification < Sinatra::Base
|
11
|
-
VERSION = '0.4.0'
|
12
|
-
|
13
11
|
use Rack::PostBodyContentTypeParser
|
14
12
|
helpers Sinatra::Param
|
15
13
|
|
@@ -22,6 +20,7 @@ module Rack
|
|
22
20
|
Sequel.extension :pg_array, :migration
|
23
21
|
|
24
22
|
DB = Sequel.connect(ENV['DATABASE_URL'])
|
23
|
+
DB.extend Sequel::Postgres::PGArray::DatabaseMethods
|
25
24
|
Sequel::Migrator.run(DB, ::File.join(::File.dirname(__FILE__), 'push-notification/migrations'), table: 'push_notification_schema_info')
|
26
25
|
end
|
27
26
|
end
|
@@ -43,7 +42,7 @@ module Rack
|
|
43
42
|
status code
|
44
43
|
{device: record}.to_json
|
45
44
|
else
|
46
|
-
status
|
45
|
+
status 400
|
47
46
|
{errors: record.errors}.to_json
|
48
47
|
end
|
49
48
|
end
|
@@ -54,7 +53,7 @@ module Rack
|
|
54
53
|
if record.destroy
|
55
54
|
status 200
|
56
55
|
else
|
57
|
-
status
|
56
|
+
status 400
|
58
57
|
{errors: record.errors}.to_json
|
59
58
|
end
|
60
59
|
end
|
@@ -1,25 +1,24 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "rack/push-notification"
|
4
3
|
|
5
4
|
Gem::Specification.new do |s|
|
6
5
|
s.name = "rack-push-notification"
|
7
6
|
s.authors = ["Mattt Thompson"]
|
8
7
|
s.email = "m@mattt.me"
|
9
8
|
s.homepage = "http://mattt.me"
|
10
|
-
s.version =
|
9
|
+
s.version = "0.4.1"
|
11
10
|
s.platform = Gem::Platform::RUBY
|
12
11
|
s.summary = "Rack::PushNotification"
|
13
12
|
s.description = "Generate a REST API for registering and querying push notification device tokens."
|
14
|
-
s.add_development_dependency "rspec", "~> 0.6"
|
15
|
-
s.add_development_dependency "rake", "~> 0.9"
|
16
13
|
|
17
14
|
s.add_dependency "rack", "~> 1.4"
|
18
15
|
s.add_dependency "rack-contrib", "~> 1.1"
|
19
16
|
s.add_dependency "sequel", "~> 3.37"
|
20
17
|
s.add_dependency "sinatra", "~> 1.3"
|
21
18
|
s.add_dependency "sinatra-param", "~> 0.1"
|
22
|
-
|
19
|
+
|
20
|
+
s.add_development_dependency "rspec"
|
21
|
+
s.add_development_dependency "rake"
|
23
22
|
|
24
23
|
s.files = Dir["./**/*"].reject { |file| file =~ /\.\/(bin|example|log|pkg|script|spec|test|vendor)/ }
|
25
24
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
metadata
CHANGED
@@ -1,43 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-push-notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mattt Thompson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: rspec
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - ~>
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.6'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - ~>
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.6'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0.9'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ~>
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0.9'
|
41
13
|
- !ruby/object:Gem::Dependency
|
42
14
|
name: rack
|
43
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,19 +81,33 @@ dependencies:
|
|
109
81
|
- !ruby/object:Gem::Version
|
110
82
|
version: '0.1'
|
111
83
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
84
|
+
name: rspec
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
114
86
|
requirements:
|
115
|
-
- -
|
87
|
+
- - ! '>='
|
116
88
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0
|
118
|
-
type: :
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
119
91
|
prerelease: false
|
120
92
|
version_requirements: !ruby/object:Gem::Requirement
|
121
93
|
requirements:
|
122
|
-
- -
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0
|
110
|
+
version: '0'
|
125
111
|
description: Generate a REST API for registering and querying push notification device
|
126
112
|
tokens.
|
127
113
|
email: m@mattt.me
|
@@ -136,8 +122,6 @@ files:
|
|
136
122
|
- ./lib/rack/push-notification/models/device.rb
|
137
123
|
- ./lib/rack/push-notification.rb
|
138
124
|
- ./LICENSE
|
139
|
-
- ./rack-push-notification-0.3.0.gem
|
140
|
-
- ./rack-push-notification-0.3.1.gem
|
141
125
|
- ./rack-push-notification.gemspec
|
142
126
|
- ./Rakefile
|
143
127
|
- ./README.md
|
Binary file
|
Binary file
|