afmotion 2.3.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -4
- data/README.md +2 -1
- data/lib/afmotion.rb +1 -1
- data/lib/afmotion/http_result.rb +8 -0
- data/lib/afmotion/version.rb +1 -1
- data/spec/integration_spec.rb +8 -0
- data/vendor/Podfile.lock +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 65da43227281846aaf7f6d790dc7b4aa67b095d9
|
|
4
|
+
data.tar.gz: 9d2d70fc1419d1cf1a994d855e5e8606e8f6a2e7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3704f5368b72cedc47f8b7e038e944a6e021251ab50aee91e0eccb54175b49924a0d0f66835c8e0ea30ae71583e33048e724dcb3c298393bef1d7ad16c8366c
|
|
7
|
+
data.tar.gz: fc296d84647c5df73449d9ba46c9d258f29fd74a1e854854e109c6d9966940abc9d0d5e2bf5ca62261c2770db9d9fcaa152b009c72c78fff8f42669f9afc5109
|
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
afmotion (2.
|
|
4
|
+
afmotion (2.4.1)
|
|
5
5
|
motion-cocoapods (>= 1.4.1)
|
|
6
6
|
motion-require (>= 0.1)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activesupport (3.2.
|
|
11
|
+
activesupport (3.2.19)
|
|
12
12
|
i18n (~> 0.6, >= 0.6.4)
|
|
13
13
|
multi_json (~> 1.0)
|
|
14
14
|
claide (0.6.1)
|
|
@@ -34,7 +34,7 @@ GEM
|
|
|
34
34
|
cocoapods-downloader (0.6.1)
|
|
35
35
|
cocoapods-plugins (0.2.0)
|
|
36
36
|
nap
|
|
37
|
-
cocoapods-trunk (0.1.
|
|
37
|
+
cocoapods-trunk (0.1.4)
|
|
38
38
|
json_pure (~> 1.8)
|
|
39
39
|
nap (>= 0.6)
|
|
40
40
|
netrc
|
|
@@ -42,7 +42,7 @@ GEM
|
|
|
42
42
|
colored (1.2)
|
|
43
43
|
escape (0.0.4)
|
|
44
44
|
fuzzy_match (2.0.4)
|
|
45
|
-
i18n (0.6.
|
|
45
|
+
i18n (0.6.11)
|
|
46
46
|
json_pure (1.8.1)
|
|
47
47
|
motion-cocoapods (1.5.0)
|
|
48
48
|
cocoapods (>= 0.32.1)
|
data/README.md
CHANGED
|
@@ -91,7 +91,7 @@ You can also request arbitrary images:
|
|
|
91
91
|
|
|
92
92
|
1. `gem install afmotion`
|
|
93
93
|
|
|
94
|
-
2. `require 'afmotion'` or add to your `Gemfile` (`gem 'afmotion'
|
|
94
|
+
2. `require 'afmotion'` or add to your `Gemfile` (`gem 'afmotion'`)
|
|
95
95
|
|
|
96
96
|
3. `rake pod:install`
|
|
97
97
|
|
|
@@ -105,6 +105,7 @@ Each AFMotion wrapper callback yields an `AFMotion::HTTPResult` object. This obj
|
|
|
105
105
|
AFMotion::some_function do |result|
|
|
106
106
|
# result.operation is the AFURLConnectionOperation instance
|
|
107
107
|
p result.operation.inspect
|
|
108
|
+
p result.status_code
|
|
108
109
|
|
|
109
110
|
if result.success?
|
|
110
111
|
# result.object depends on the type of operation.
|
data/lib/afmotion.rb
CHANGED
data/lib/afmotion/http_result.rb
CHANGED
|
@@ -22,6 +22,14 @@ module AFMotion
|
|
|
22
22
|
!!error
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def status_code
|
|
26
|
+
if self.operation
|
|
27
|
+
self.operation.response.statusCode
|
|
28
|
+
else
|
|
29
|
+
self.task.response.statusCode
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
25
33
|
def body
|
|
26
34
|
if task && task.currentRequest
|
|
27
35
|
raise "Cannot call result.body of a task"
|
data/lib/afmotion/version.rb
CHANGED
data/spec/integration_spec.rb
CHANGED
|
@@ -3,6 +3,8 @@ describe "AFMotion" do
|
|
|
3
3
|
|
|
4
4
|
before do
|
|
5
5
|
disable_network_access!
|
|
6
|
+
@object = nil
|
|
7
|
+
@result = nil
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
after do
|
|
@@ -17,6 +19,7 @@ describe "AFMotion" do
|
|
|
17
19
|
to_return(json: {"data" => ["thing"]}, delay: 0.3)
|
|
18
20
|
|
|
19
21
|
AFMotion::JSON.get(url) do |result|
|
|
22
|
+
@result = result
|
|
20
23
|
@object = result.object
|
|
21
24
|
resume
|
|
22
25
|
end
|
|
@@ -31,6 +34,8 @@ describe "AFMotion" do
|
|
|
31
34
|
|
|
32
35
|
@object.delete('data')
|
|
33
36
|
@object.count.should == 1
|
|
37
|
+
|
|
38
|
+
@result.status_code.should == 200
|
|
34
39
|
end
|
|
35
40
|
end
|
|
36
41
|
end
|
|
@@ -48,6 +53,7 @@ describe "AFMotion" do
|
|
|
48
53
|
end
|
|
49
54
|
|
|
50
55
|
client.get(path, nil) do |result|
|
|
56
|
+
@result = result
|
|
51
57
|
@object = result.object
|
|
52
58
|
resume
|
|
53
59
|
end
|
|
@@ -62,6 +68,8 @@ describe "AFMotion" do
|
|
|
62
68
|
|
|
63
69
|
@object.delete('data')
|
|
64
70
|
@object.count.should == 1
|
|
71
|
+
|
|
72
|
+
@result.status_code.should == 200
|
|
65
73
|
end
|
|
66
74
|
end
|
|
67
75
|
end
|
data/vendor/Podfile.lock
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
PODS:
|
|
2
|
-
- AFNetworking (2.
|
|
2
|
+
- AFNetworking (2.4.1):
|
|
3
3
|
- AFNetworking/NSURLConnection
|
|
4
4
|
- AFNetworking/NSURLSession
|
|
5
5
|
- AFNetworking/Reachability
|
|
6
6
|
- AFNetworking/Security
|
|
7
7
|
- AFNetworking/Serialization
|
|
8
8
|
- AFNetworking/UIKit
|
|
9
|
-
- AFNetworking/NSURLConnection (2.
|
|
9
|
+
- AFNetworking/NSURLConnection (2.4.1):
|
|
10
10
|
- AFNetworking/Reachability
|
|
11
11
|
- AFNetworking/Security
|
|
12
12
|
- AFNetworking/Serialization
|
|
13
|
-
- AFNetworking/NSURLSession (2.
|
|
13
|
+
- AFNetworking/NSURLSession (2.4.1):
|
|
14
14
|
- AFNetworking/Reachability
|
|
15
15
|
- AFNetworking/Security
|
|
16
16
|
- AFNetworking/Serialization
|
|
17
|
-
- AFNetworking/Reachability (2.
|
|
18
|
-
- AFNetworking/Security (2.
|
|
19
|
-
- AFNetworking/Serialization (2.
|
|
20
|
-
- AFNetworking/UIKit (2.
|
|
17
|
+
- AFNetworking/Reachability (2.4.1)
|
|
18
|
+
- AFNetworking/Security (2.4.1)
|
|
19
|
+
- AFNetworking/Serialization (2.4.1)
|
|
20
|
+
- AFNetworking/UIKit (2.4.1):
|
|
21
21
|
- AFNetworking/NSURLConnection
|
|
22
22
|
- AFNetworking/NSURLSession
|
|
23
23
|
|
|
24
24
|
DEPENDENCIES:
|
|
25
|
-
- AFNetworking (~> 2.
|
|
25
|
+
- AFNetworking (~> 2.4.1)
|
|
26
26
|
|
|
27
27
|
SPEC CHECKSUMS:
|
|
28
|
-
AFNetworking:
|
|
28
|
+
AFNetworking: 0aabc6fae66d6e5d039eeb21c315843c7aae51ab
|
|
29
29
|
|
|
30
30
|
COCOAPODS: 0.33.1
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: afmotion
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Clay Allsopp
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-06
|
|
11
|
+
date: 2014-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: motion-cocoapods
|