parse-ruby-client 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -12,4 +12,5 @@ group :development do
12
12
  gem "rcov", ">= 0"
13
13
  end
14
14
 
15
- gem "patron"
15
+ gem "patron"
16
+ gem "vcr"
data/Gemfile.lock CHANGED
@@ -10,6 +10,7 @@ GEM
10
10
  rake (0.9.2.2)
11
11
  rcov (0.9.11)
12
12
  shoulda (2.11.3)
13
+ vcr (2.0.1)
13
14
 
14
15
  PLATFORMS
15
16
  ruby
@@ -20,3 +21,4 @@ DEPENDENCIES
20
21
  patron
21
22
  rcov
22
23
  shoulda
24
+ vcr
data/README.md CHANGED
@@ -19,7 +19,7 @@ This currently depends on the gems 'json' and 'patron' for JSON support and HTTP
19
19
 
20
20
  ## Installation
21
21
 
22
- `gem "parse-ruby-client", "~> 0.0.4"`
22
+ `gem "parse-ruby-client", "~> 0.0.5"`
23
23
 
24
24
  ---
25
25
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -59,7 +59,7 @@ module Parse
59
59
  # increment/decrement API call.
60
60
  KEY_AMOUNT = "amount"
61
61
 
62
- RESERVED_KEYS = [ KEY_CLASS_NAME, KEY_CREATED_AT, KEY_OBJECT_ID ]
62
+ RESERVED_KEYS = [ KEY_CLASS_NAME, KEY_CREATED_AT, KEY_OBJECT_ID, KEY_UPDATED_AT]
63
63
 
64
64
  # Other Constants
65
65
  # ----------------------------------------
@@ -93,6 +93,7 @@ module Parse
93
93
  # The class name for User objects, when referenced by a Pointer.
94
94
  CLASS_USER = "_User"
95
95
  USER_LOGIN_URI = "/#{VERSION}/login"
96
+ PASSWORD_RESET_URI = "/#{VERSION}/requestPasswordReset"
96
97
 
97
98
  KEY_USER_SESSION_TOKEN = "sessionToken"
98
99
 
data/lib/parse/user.rb CHANGED
@@ -17,6 +17,11 @@ module Parse
17
17
  new(response)
18
18
  end
19
19
 
20
+ def self.reset_password(email)
21
+ body = {"email" => email}
22
+ Parse.client.post(Parse::Protocol::PASSWORD_RESET_URI, body)
23
+ end
24
+
20
25
  def initialize(data = nil)
21
26
  @class_name = Parse::Protocol::CLASS_USER
22
27
 
@@ -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.5"
8
+ s.version = "0.0.6"
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-19"
12
+ s.date = "2012-05-04"
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 = [
@@ -60,12 +60,14 @@ Gem::Specification.new do |s|
60
60
 
61
61
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
62
62
  s.add_runtime_dependency(%q<patron>, [">= 0"])
63
+ s.add_runtime_dependency(%q<vcr>, [">= 0"])
63
64
  s.add_development_dependency(%q<shoulda>, [">= 0"])
64
65
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
65
66
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
66
67
  s.add_development_dependency(%q<rcov>, [">= 0"])
67
68
  else
68
69
  s.add_dependency(%q<patron>, [">= 0"])
70
+ s.add_dependency(%q<vcr>, [">= 0"])
69
71
  s.add_dependency(%q<shoulda>, [">= 0"])
70
72
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
71
73
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
@@ -73,6 +75,7 @@ Gem::Specification.new do |s|
73
75
  end
74
76
  else
75
77
  s.add_dependency(%q<patron>, [">= 0"])
78
+ s.add_dependency(%q<vcr>, [">= 0"])
76
79
  s.add_dependency(%q<shoulda>, [">= 0"])
77
80
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
78
81
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
data/test/helper.rb CHANGED
@@ -15,4 +15,4 @@ $LOAD_PATH.unshift(File.dirname(__FILE__))
15
15
  require 'parse-ruby-client'
16
16
 
17
17
  class Test::Unit::TestCase
18
- end
18
+ end
data/test/test_client.rb CHANGED
@@ -30,6 +30,20 @@ class TestClient < Test::Unit::TestCase
30
30
  assert_equal foo[Parse::Protocol::KEY_UPDATED_AT].class, String
31
31
  end
32
32
 
33
+ def test_server_update
34
+ foo = Parse::Object.new("TestSave").save
35
+ foo["name"] = 'john'
36
+ foo.save
37
+
38
+ bar = Parse.get("TestSave",foo.id) # pull it from the server
39
+ assert_equal bar["name"], 'john'
40
+ bar["name"] = 'dave'
41
+ bar.save
42
+
43
+ bat = Parse.get("TestSave",foo.id)
44
+ assert_equal bar["name"], 'dave'
45
+ end
46
+
33
47
  def test_destroy
34
48
  d = Parse::Object.new "toBeDeleted"
35
49
  d["foo"] = "bar"
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.5
4
+ version: 0.0.6
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-19 00:00:00.000000000Z
13
+ date: 2012-05-04 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: patron
17
- requirement: &70178541000720 !ruby/object:Gem::Requirement
17
+ requirement: &70356085268660 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,21 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70178541000720
25
+ version_requirements: *70356085268660
26
+ - !ruby/object:Gem::Dependency
27
+ name: vcr
28
+ requirement: &70356085268040 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *70356085268040
26
37
  - !ruby/object:Gem::Dependency
27
38
  name: shoulda
28
- requirement: &70178541000160 !ruby/object:Gem::Requirement
39
+ requirement: &70356085267180 !ruby/object:Gem::Requirement
29
40
  none: false
30
41
  requirements:
31
42
  - - ! '>='
@@ -33,10 +44,10 @@ dependencies:
33
44
  version: '0'
34
45
  type: :development
35
46
  prerelease: false
36
- version_requirements: *70178541000160
47
+ version_requirements: *70356085267180
37
48
  - !ruby/object:Gem::Dependency
38
49
  name: bundler
39
- requirement: &70178540999620 !ruby/object:Gem::Requirement
50
+ requirement: &70356085266660 !ruby/object:Gem::Requirement
40
51
  none: false
41
52
  requirements:
42
53
  - - ~>
@@ -44,10 +55,10 @@ dependencies:
44
55
  version: 1.0.0
45
56
  type: :development
46
57
  prerelease: false
47
- version_requirements: *70178540999620
58
+ version_requirements: *70356085266660
48
59
  - !ruby/object:Gem::Dependency
49
60
  name: jeweler
50
- requirement: &70178540999120 !ruby/object:Gem::Requirement
61
+ requirement: &70356085266180 !ruby/object:Gem::Requirement
51
62
  none: false
52
63
  requirements:
53
64
  - - ~>
@@ -55,10 +66,10 @@ dependencies:
55
66
  version: 1.6.4
56
67
  type: :development
57
68
  prerelease: false
58
- version_requirements: *70178540999120
69
+ version_requirements: *70356085266180
59
70
  - !ruby/object:Gem::Dependency
60
71
  name: rcov
61
- requirement: &70178540998580 !ruby/object:Gem::Requirement
72
+ requirement: &70356085265480 !ruby/object:Gem::Requirement
62
73
  none: false
63
74
  requirements:
64
75
  - - ! '>='
@@ -66,7 +77,7 @@ dependencies:
66
77
  version: '0'
67
78
  type: :development
68
79
  prerelease: false
69
- version_requirements: *70178540998580
80
+ version_requirements: *70356085265480
70
81
  description: A simple Ruby client for the parse.com REST API
71
82
  email: adelevie@gmail.com
72
83
  executables: []
@@ -121,7 +132,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
132
  version: '0'
122
133
  segments:
123
134
  - 0
124
- hash: -951164517849250266
135
+ hash: 1767955505612683619
125
136
  required_rubygems_version: !ruby/object:Gem::Requirement
126
137
  none: false
127
138
  requirements: