leadlight 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.lock +20 -18
- data/default.gems +1 -1
- data/leadlight.gemspec +24 -4
- data/lib/leadlight.rb +4 -5
- data/lib/leadlight/connection_builder.rb +29 -0
- data/lib/leadlight/errors.rb +11 -5
- data/lib/leadlight/hyperlinkable.rb +31 -10
- data/lib/leadlight/lib_ext.rb +3 -0
- data/lib/leadlight/lib_ext/faraday/README +6 -0
- data/lib/leadlight/lib_ext/faraday/adapter.rb +7 -0
- data/lib/leadlight/lib_ext/faraday/builder.rb +47 -0
- data/lib/leadlight/lib_ext/faraday/connection.rb +40 -0
- data/lib/leadlight/lib_ext/faraday/middleware.rb +7 -0
- data/lib/leadlight/link.rb +91 -4
- data/lib/leadlight/link_template.rb +13 -5
- data/lib/leadlight/null_link.rb +21 -0
- data/lib/leadlight/param_hash.rb +42 -0
- data/lib/leadlight/representation.rb +23 -3
- data/lib/leadlight/request.rb +42 -10
- data/lib/leadlight/service.rb +11 -9
- data/lib/leadlight/service_class_methods.rb +11 -3
- data/lib/leadlight/tint_helper.rb +32 -2
- data/spec/cassettes/Leadlight/authorized_GitHub_example/_user/has_the_expected_content.yml +72 -54
- data/spec/cassettes/Leadlight/authorized_GitHub_example/_user/indicates_the_expected_oath_scopes.yml +73 -55
- data/spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_team_members.yml +353 -265
- data/spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_teams.yml +75 -175
- data/spec/cassettes/Leadlight/authorized_GitHub_example/team_list/should_have_a_link_back_to_the_org.yml +196 -0
- data/spec/cassettes/Leadlight/authorized_GitHub_example/test_team/.yml +152 -108
- data/spec/cassettes/Leadlight/authorized_GitHub_example/test_team/has_a_root_link.yml +197 -0
- data/spec/cassettes/Leadlight/basic_GitHub_example/_root/.yml +15 -43
- data/spec/cassettes/Leadlight/basic_GitHub_example/_root/__location__/.yml +15 -43
- data/spec/cassettes/Leadlight/basic_GitHub_example/_root/should_be_a_204_no_content.yml +15 -43
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/.yml +15 -43
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/__location__/.yml +15 -43
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/should_be_a_204_no_content.yml +15 -43
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_user/has_the_expected_content.yml +35 -90
- data/spec/cassettes/Leadlight/tinted_GitHub_example/bad_links/enables_custom_error_matching.yml +25 -17
- data/spec/cassettes/Leadlight/tinted_GitHub_example/bad_links/should_raise_ResourceNotFound.yml +26 -90
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/.yml +57 -140
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_able_to_follow_next_link.yml +79 -192
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable.yml +279 -350
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable_over_page_boundaries.yml +98 -243
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_have_next_and_last_links.yml +59 -142
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_link/exists.yml +15 -43
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_link/links_to_the_expected_URL.yml +15 -43
- data/spec/leadlight/hyperlinkable_spec.rb +50 -4
- data/spec/leadlight/link_spec.rb +70 -10
- data/spec/leadlight/link_template_spec.rb +20 -4
- data/spec/leadlight/null_link_spec.rb +14 -0
- data/spec/leadlight/param_hash_spec.rb +26 -0
- data/spec/leadlight/representation_spec.rb +36 -4
- data/spec/leadlight/request_spec.rb +39 -22
- data/spec/leadlight/service_spec.rb +14 -13
- data/spec/leadlight/tint_helper_spec.rb +36 -2
- data/spec/leadlight_spec.rb +31 -17
- data/spec/support/link_matchers.rb +59 -0
- data/spec/support/misc.rb +9 -0
- metadata +49 -34
@@ -3,7 +3,9 @@ http_interactions:
|
|
3
3
|
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
7
9
|
headers:
|
8
10
|
Accept:
|
9
11
|
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
@@ -11,55 +13,25 @@ http_interactions:
|
|
11
13
|
response:
|
12
14
|
status:
|
13
15
|
code: 204
|
14
|
-
message:
|
16
|
+
message:
|
15
17
|
headers:
|
16
18
|
server:
|
17
|
-
- nginx/1.0.
|
19
|
+
- nginx/1.0.13
|
18
20
|
date:
|
19
|
-
-
|
21
|
+
- Wed, 01 Aug 2012 19:38:39 GMT
|
20
22
|
connection:
|
21
23
|
- close
|
22
24
|
status:
|
23
25
|
- 204 No Content
|
24
26
|
x-ratelimit-limit:
|
25
27
|
- '5000'
|
26
|
-
|
27
|
-
-
|
28
|
+
cache-control:
|
29
|
+
- ''
|
28
30
|
x-ratelimit-remaining:
|
29
|
-
- '
|
30
|
-
body:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
body: 'null'
|
37
|
-
headers:
|
38
|
-
Content-Type:
|
39
|
-
- application/json
|
40
|
-
Accept:
|
41
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
42
|
-
text/plain
|
43
|
-
response:
|
44
|
-
status:
|
45
|
-
code: 204
|
46
|
-
message: !!null
|
47
|
-
headers:
|
48
|
-
server:
|
49
|
-
- nginx/1.0.4
|
50
|
-
date:
|
51
|
-
- Mon, 16 Jan 2012 02:45:52 GMT
|
52
|
-
connection:
|
53
|
-
- close
|
54
|
-
status:
|
55
|
-
- 204 No Content
|
56
|
-
x-ratelimit-limit:
|
57
|
-
- '5000'
|
58
|
-
etag:
|
59
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
60
|
-
x-ratelimit-remaining:
|
61
|
-
- '4999'
|
62
|
-
body: ''
|
63
|
-
http_version: !!null
|
64
|
-
recorded_at: Mon, 16 Jan 2012 02:45:52 GMT
|
65
|
-
recorded_with: VCR 2.0.0.rc1
|
31
|
+
- '4994'
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 01 Aug 2012 19:38:29 GMT
|
37
|
+
recorded_with: VCR 2.2.4
|
@@ -3,7 +3,9 @@ http_interactions:
|
|
3
3
|
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
7
9
|
headers:
|
8
10
|
Accept:
|
9
11
|
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
@@ -11,55 +13,25 @@ http_interactions:
|
|
11
13
|
response:
|
12
14
|
status:
|
13
15
|
code: 204
|
14
|
-
message:
|
16
|
+
message:
|
15
17
|
headers:
|
16
18
|
server:
|
17
|
-
- nginx/1.0.
|
19
|
+
- nginx/1.0.13
|
18
20
|
date:
|
19
|
-
-
|
21
|
+
- Wed, 01 Aug 2012 19:38:40 GMT
|
20
22
|
connection:
|
21
23
|
- close
|
22
24
|
status:
|
23
25
|
- 204 No Content
|
24
|
-
x-ratelimit-limit:
|
25
|
-
- '5000'
|
26
|
-
etag:
|
27
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
26
|
x-ratelimit-remaining:
|
29
|
-
- '
|
30
|
-
|
31
|
-
|
32
|
-
recorded_at: Sun, 15 Jan 2012 19:38:32 GMT
|
33
|
-
- request:
|
34
|
-
method: get
|
35
|
-
uri: https://api.github.com/
|
36
|
-
body: 'null'
|
37
|
-
headers:
|
38
|
-
Content-Type:
|
39
|
-
- application/json
|
40
|
-
Accept:
|
41
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
42
|
-
text/plain
|
43
|
-
response:
|
44
|
-
status:
|
45
|
-
code: 204
|
46
|
-
message: !!null
|
47
|
-
headers:
|
48
|
-
server:
|
49
|
-
- nginx/1.0.4
|
50
|
-
date:
|
51
|
-
- Mon, 16 Jan 2012 02:45:53 GMT
|
52
|
-
connection:
|
53
|
-
- close
|
54
|
-
status:
|
55
|
-
- 204 No Content
|
27
|
+
- '4992'
|
28
|
+
cache-control:
|
29
|
+
- ''
|
56
30
|
x-ratelimit-limit:
|
57
31
|
- '5000'
|
58
|
-
|
59
|
-
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
recorded_at: Mon, 16 Jan 2012 02:45:53 GMT
|
65
|
-
recorded_with: VCR 2.0.0.rc1
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 01 Aug 2012 19:38:29 GMT
|
37
|
+
recorded_with: VCR 2.2.4
|
@@ -3,7 +3,9 @@ http_interactions:
|
|
3
3
|
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
7
9
|
headers:
|
8
10
|
Accept:
|
9
11
|
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
@@ -11,55 +13,25 @@ http_interactions:
|
|
11
13
|
response:
|
12
14
|
status:
|
13
15
|
code: 204
|
14
|
-
message:
|
16
|
+
message:
|
15
17
|
headers:
|
16
18
|
server:
|
17
|
-
- nginx/1.0.
|
19
|
+
- nginx/1.0.13
|
18
20
|
date:
|
19
|
-
-
|
21
|
+
- Wed, 01 Aug 2012 19:38:40 GMT
|
20
22
|
connection:
|
21
23
|
- close
|
22
24
|
status:
|
23
25
|
- 204 No Content
|
24
26
|
x-ratelimit-limit:
|
25
27
|
- '5000'
|
26
|
-
|
27
|
-
-
|
28
|
+
cache-control:
|
29
|
+
- ''
|
28
30
|
x-ratelimit-remaining:
|
29
|
-
- '
|
30
|
-
body:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
body: 'null'
|
37
|
-
headers:
|
38
|
-
Content-Type:
|
39
|
-
- application/json
|
40
|
-
Accept:
|
41
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
42
|
-
text/plain
|
43
|
-
response:
|
44
|
-
status:
|
45
|
-
code: 204
|
46
|
-
message: !!null
|
47
|
-
headers:
|
48
|
-
server:
|
49
|
-
- nginx/1.0.4
|
50
|
-
date:
|
51
|
-
- Mon, 16 Jan 2012 02:45:52 GMT
|
52
|
-
connection:
|
53
|
-
- close
|
54
|
-
status:
|
55
|
-
- 204 No Content
|
56
|
-
x-ratelimit-limit:
|
57
|
-
- '5000'
|
58
|
-
etag:
|
59
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
60
|
-
x-ratelimit-remaining:
|
61
|
-
- '4998'
|
62
|
-
body: ''
|
63
|
-
http_version: !!null
|
64
|
-
recorded_at: Mon, 16 Jan 2012 02:45:52 GMT
|
65
|
-
recorded_with: VCR 2.0.0.rc1
|
31
|
+
- '4993'
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 01 Aug 2012 19:38:29 GMT
|
37
|
+
recorded_with: VCR 2.2.4
|
@@ -3,7 +3,9 @@ http_interactions:
|
|
3
3
|
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
7
9
|
headers:
|
8
10
|
Accept:
|
9
11
|
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
@@ -11,55 +13,25 @@ http_interactions:
|
|
11
13
|
response:
|
12
14
|
status:
|
13
15
|
code: 204
|
14
|
-
message:
|
16
|
+
message:
|
15
17
|
headers:
|
16
18
|
server:
|
17
|
-
- nginx/1.0.
|
19
|
+
- nginx/1.0.13
|
18
20
|
date:
|
19
|
-
-
|
21
|
+
- Wed, 01 Aug 2012 19:38:40 GMT
|
20
22
|
connection:
|
21
23
|
- close
|
22
24
|
status:
|
23
25
|
- 204 No Content
|
24
|
-
x-ratelimit-limit:
|
25
|
-
- '5000'
|
26
|
-
etag:
|
27
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
26
|
x-ratelimit-remaining:
|
29
|
-
- '
|
30
|
-
|
31
|
-
|
32
|
-
recorded_at: Sun, 15 Jan 2012 19:38:32 GMT
|
33
|
-
- request:
|
34
|
-
method: get
|
35
|
-
uri: https://api.github.com/
|
36
|
-
body: 'null'
|
37
|
-
headers:
|
38
|
-
Content-Type:
|
39
|
-
- application/json
|
40
|
-
Accept:
|
41
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
42
|
-
text/plain
|
43
|
-
response:
|
44
|
-
status:
|
45
|
-
code: 204
|
46
|
-
message: !!null
|
47
|
-
headers:
|
48
|
-
server:
|
49
|
-
- nginx/1.0.4
|
50
|
-
date:
|
51
|
-
- Mon, 16 Jan 2012 02:45:53 GMT
|
52
|
-
connection:
|
53
|
-
- close
|
54
|
-
status:
|
55
|
-
- 204 No Content
|
27
|
+
- '4991'
|
28
|
+
cache-control:
|
29
|
+
- ''
|
56
30
|
x-ratelimit-limit:
|
57
31
|
- '5000'
|
58
|
-
|
59
|
-
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
recorded_at: Mon, 16 Jan 2012 02:45:53 GMT
|
65
|
-
recorded_with: VCR 2.0.0.rc1
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 01 Aug 2012 19:38:29 GMT
|
37
|
+
recorded_with: VCR 2.2.4
|
@@ -3,7 +3,9 @@ http_interactions:
|
|
3
3
|
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
7
9
|
headers:
|
8
10
|
Accept:
|
9
11
|
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
@@ -11,55 +13,25 @@ http_interactions:
|
|
11
13
|
response:
|
12
14
|
status:
|
13
15
|
code: 204
|
14
|
-
message:
|
16
|
+
message:
|
15
17
|
headers:
|
16
18
|
server:
|
17
|
-
- nginx/1.0.
|
19
|
+
- nginx/1.0.13
|
18
20
|
date:
|
19
|
-
-
|
21
|
+
- Wed, 01 Aug 2012 19:38:40 GMT
|
20
22
|
connection:
|
21
23
|
- close
|
22
24
|
status:
|
23
25
|
- 204 No Content
|
26
|
+
cache-control:
|
27
|
+
- ''
|
24
28
|
x-ratelimit-limit:
|
25
29
|
- '5000'
|
26
|
-
etag:
|
27
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
30
|
x-ratelimit-remaining:
|
29
|
-
- '
|
30
|
-
body:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
body: 'null'
|
37
|
-
headers:
|
38
|
-
Content-Type:
|
39
|
-
- application/json
|
40
|
-
Accept:
|
41
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
42
|
-
text/plain
|
43
|
-
response:
|
44
|
-
status:
|
45
|
-
code: 204
|
46
|
-
message: !!null
|
47
|
-
headers:
|
48
|
-
server:
|
49
|
-
- nginx/1.0.4
|
50
|
-
date:
|
51
|
-
- Mon, 16 Jan 2012 02:45:54 GMT
|
52
|
-
connection:
|
53
|
-
- close
|
54
|
-
status:
|
55
|
-
- 204 No Content
|
56
|
-
x-ratelimit-limit:
|
57
|
-
- '5000'
|
58
|
-
etag:
|
59
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
60
|
-
x-ratelimit-remaining:
|
61
|
-
- '4994'
|
62
|
-
body: ''
|
63
|
-
http_version: !!null
|
64
|
-
recorded_at: Mon, 16 Jan 2012 02:45:54 GMT
|
65
|
-
recorded_with: VCR 2.0.0.rc1
|
31
|
+
- '4989'
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 01 Aug 2012 19:38:30 GMT
|
37
|
+
recorded_with: VCR 2.2.4
|
@@ -3,7 +3,9 @@ http_interactions:
|
|
3
3
|
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
7
9
|
headers:
|
8
10
|
Accept:
|
9
11
|
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
@@ -11,55 +13,25 @@ http_interactions:
|
|
11
13
|
response:
|
12
14
|
status:
|
13
15
|
code: 204
|
14
|
-
message:
|
16
|
+
message:
|
15
17
|
headers:
|
16
18
|
server:
|
17
|
-
- nginx/1.0.
|
19
|
+
- nginx/1.0.13
|
18
20
|
date:
|
19
|
-
-
|
21
|
+
- Wed, 01 Aug 2012 19:38:40 GMT
|
20
22
|
connection:
|
21
23
|
- close
|
22
24
|
status:
|
23
25
|
- 204 No Content
|
24
|
-
x-ratelimit-limit:
|
25
|
-
- '5000'
|
26
|
-
etag:
|
27
|
-
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
26
|
x-ratelimit-remaining:
|
29
|
-
- '
|
30
|
-
|
31
|
-
|
32
|
-
recorded_at: Sun, 15 Jan 2012 19:38:33 GMT
|
33
|
-
- request:
|
34
|
-
method: get
|
35
|
-
uri: https://api.github.com/
|
36
|
-
body: 'null'
|
37
|
-
headers:
|
38
|
-
Content-Type:
|
39
|
-
- application/json
|
40
|
-
Accept:
|
41
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
42
|
-
text/plain
|
43
|
-
response:
|
44
|
-
status:
|
45
|
-
code: 204
|
46
|
-
message: !!null
|
47
|
-
headers:
|
48
|
-
server:
|
49
|
-
- nginx/1.0.4
|
50
|
-
date:
|
51
|
-
- Mon, 16 Jan 2012 02:45:53 GMT
|
52
|
-
connection:
|
53
|
-
- close
|
54
|
-
status:
|
55
|
-
- 204 No Content
|
27
|
+
- '4990'
|
28
|
+
cache-control:
|
29
|
+
- ''
|
56
30
|
x-ratelimit-limit:
|
57
31
|
- '5000'
|
58
|
-
|
59
|
-
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
recorded_at: Mon, 16 Jan 2012 02:45:53 GMT
|
65
|
-
recorded_with: VCR 2.0.0.rc1
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
http_version:
|
36
|
+
recorded_at: Wed, 01 Aug 2012 19:38:30 GMT
|
37
|
+
recorded_with: VCR 2.2.4
|