parse-ruby-client 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +3 -7
- data/Gemfile +1 -1
- data/README.md +10 -1
- data/VERSION +1 -1
- data/example.rb +4 -0
- data/lib/parse-ruby-client.rb +1 -0
- data/lib/parse/protocol.rb +4 -0
- data/lib/parse/push.rb +32 -0
- data/parse-ruby-client.gemspec +4 -2
- data/test/test_push.rb +14 -0
- metadata +15 -13
data/.travis.yml
CHANGED
@@ -1,11 +1,7 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 1.8.7
|
4
3
|
- 1.9.2
|
5
4
|
- 1.9.3
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
# - rbx-19mode # currently in active development, may or may not work for your project
|
10
|
-
# uncomment this line if your project needs to run something other than `rake`:
|
11
|
-
# script: bundle exec rspec spec
|
5
|
+
|
6
|
+
env:
|
7
|
+
- PARSE_APPLICATION_ID=Slw1ACyMSVguo79pWvfIq15pkUjfwTLNPpL4984b PARSE_REST_API_KEY=qJKM8CGOAn70WOyR16f16YbyKWM0nBJCEbbtAMOm
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://secure.travis-ci.org/adelevie/parse-ruby-client.png?branch=master)](http://travis-ci.org/adelevie/parse-ruby-client)
|
2
|
+
|
1
3
|
The original creator of parse-ruby-client, [aalpern](http://github.com/aalpern), has decided to stop work on the project. I'm going to give the project new life, first by maintaining the project as a gem, and second by eventually making it power [parse_resource](http://github.com/adelevie/parse_resource) under the hood.
|
2
4
|
|
3
5
|
# Ruby Client for parse.com REST API
|
@@ -115,11 +117,18 @@ Parse::Query.new("GameScore") \
|
|
115
117
|
|
116
118
|
```
|
117
119
|
|
120
|
+
## Push Notifications
|
121
|
+
|
122
|
+
```ruby
|
123
|
+
push = Parse::Push.new({"alert" => "I'm sending this push to all my app users!"})
|
124
|
+
push.save
|
125
|
+
```
|
126
|
+
|
127
|
+
|
118
128
|
# TODO
|
119
129
|
|
120
130
|
- Add some form of debug logging
|
121
131
|
- ~~Support for Date, Pointer, and Bytes API [data types](https://www.parse.com/docs/rest#objects-types)~~
|
122
|
-
- Users
|
123
132
|
- ACLs
|
124
133
|
- Login
|
125
134
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/example.rb
CHANGED
data/lib/parse-ruby-client.rb
CHANGED
data/lib/parse/protocol.rb
CHANGED
data/lib/parse/push.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'cgi'
|
2
|
+
require 'parse/error'
|
3
|
+
|
4
|
+
module Parse
|
5
|
+
class Push
|
6
|
+
attr_accessor :channels
|
7
|
+
attr_accessor :channel
|
8
|
+
attr_accessor :type
|
9
|
+
attr_accessor :expiration_time_interval
|
10
|
+
attr_accessor :expiration_time
|
11
|
+
attr_accessor :data
|
12
|
+
|
13
|
+
def initialize(data, channel = "")
|
14
|
+
@data = data
|
15
|
+
@channel = channel
|
16
|
+
end
|
17
|
+
|
18
|
+
def save
|
19
|
+
uri = Protocol.push_uri
|
20
|
+
|
21
|
+
body = { :data => @data, :channel => @channel }
|
22
|
+
body.merge({ :channels => @channels }) if @channels
|
23
|
+
body.merge({ :expiration_time_interval => @expiration_time_interval }) if @expiration_time_interval
|
24
|
+
body.merge({ :expiration_time => @expiration_time }) if @expiration_time
|
25
|
+
body.merge({ :type => @type }) if @type
|
26
|
+
|
27
|
+
response = Parse.client.request uri, :post, body.to_json, nil
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/parse-ruby-client.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "parse-ruby-client"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Alan deLevie", "Adam Alpern"]
|
12
|
-
s.date = "2012-04-
|
12
|
+
s.date = "2012-04-19"
|
13
13
|
s.description = "A simple Ruby client for the parse.com REST API"
|
14
14
|
s.email = "adelevie@gmail.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -31,6 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
"lib/parse/error.rb",
|
32
32
|
"lib/parse/object.rb",
|
33
33
|
"lib/parse/protocol.rb",
|
34
|
+
"lib/parse/push.rb",
|
34
35
|
"lib/parse/query.rb",
|
35
36
|
"lib/parse/user.rb",
|
36
37
|
"lib/parse/util.rb",
|
@@ -44,6 +45,7 @@ Gem::Specification.new do |s|
|
|
44
45
|
"test/test_datatypes.rb",
|
45
46
|
"test/test_init.rb",
|
46
47
|
"test/test_object.rb",
|
48
|
+
"test/test_push.rb",
|
47
49
|
"test/test_query.rb",
|
48
50
|
"test/test_user.rb"
|
49
51
|
]
|
data/test/test_push.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parse-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-04-
|
13
|
+
date: 2012-04-19 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: patron
|
17
|
-
requirement: &
|
17
|
+
requirement: &70178541000720 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70178541000720
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: shoulda
|
28
|
-
requirement: &
|
28
|
+
requirement: &70178541000160 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70178541000160
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: bundler
|
39
|
-
requirement: &
|
39
|
+
requirement: &70178540999620 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ~>
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 1.0.0
|
45
45
|
type: :development
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70178540999620
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: jeweler
|
50
|
-
requirement: &
|
50
|
+
requirement: &70178540999120 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ~>
|
@@ -55,10 +55,10 @@ dependencies:
|
|
55
55
|
version: 1.6.4
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *70178540999120
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: rcov
|
61
|
-
requirement: &
|
61
|
+
requirement: &70178540998580 !ruby/object:Gem::Requirement
|
62
62
|
none: false
|
63
63
|
requirements:
|
64
64
|
- - ! '>='
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
version: '0'
|
67
67
|
type: :development
|
68
68
|
prerelease: false
|
69
|
-
version_requirements: *
|
69
|
+
version_requirements: *70178540998580
|
70
70
|
description: A simple Ruby client for the parse.com REST API
|
71
71
|
email: adelevie@gmail.com
|
72
72
|
executables: []
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- lib/parse/error.rb
|
90
90
|
- lib/parse/object.rb
|
91
91
|
- lib/parse/protocol.rb
|
92
|
+
- lib/parse/push.rb
|
92
93
|
- lib/parse/query.rb
|
93
94
|
- lib/parse/user.rb
|
94
95
|
- lib/parse/util.rb
|
@@ -102,6 +103,7 @@ files:
|
|
102
103
|
- test/test_datatypes.rb
|
103
104
|
- test/test_init.rb
|
104
105
|
- test/test_object.rb
|
106
|
+
- test/test_push.rb
|
105
107
|
- test/test_query.rb
|
106
108
|
- test/test_user.rb
|
107
109
|
homepage: http://github.com/adelevie/parse-ruby-client
|
@@ -119,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
119
121
|
version: '0'
|
120
122
|
segments:
|
121
123
|
- 0
|
122
|
-
hash:
|
124
|
+
hash: -951164517849250266
|
123
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
126
|
none: false
|
125
127
|
requirements:
|