leadlight 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -7
- data/README.md +82 -0
- data/default.gems +1 -0
- data/leadlight.gemspec +16 -7
- data/lib/leadlight.rb +18 -62
- data/lib/leadlight/basic_converter.rb +18 -0
- data/lib/leadlight/codec.rb +2 -0
- data/lib/leadlight/entity.rb +1 -0
- data/lib/leadlight/errors.rb +10 -2
- data/lib/leadlight/header_helpers.rb +11 -0
- data/lib/leadlight/hyperlinkable.rb +1 -1
- data/lib/leadlight/representation.rb +19 -1
- data/lib/leadlight/request.rb +44 -11
- data/lib/leadlight/service.rb +4 -9
- data/lib/leadlight/service_class_methods.rb +69 -0
- data/lib/leadlight/service_middleware.rb +2 -14
- data/lib/leadlight/tint.rb +6 -2
- data/lib/leadlight/tint_helper.rb +27 -4
- data/lib/leadlight/type_map.rb +101 -0
- data/spec/cassettes/Leadlight/authorized_GitHub_example/_user/has_the_expected_content.yml +8 -8
- data/spec/cassettes/Leadlight/authorized_GitHub_example/_user/indicates_the_expected_oath_scopes.yml +8 -8
- data/spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_team_members.yml +273 -284
- data/spec/cassettes/Leadlight/authorized_GitHub_example/{adding_and_removing_team_members/.yml → adding_and_removing_teams.yml} +57 -84
- data/spec/cassettes/Leadlight/authorized_GitHub_example/test_team/.yml +111 -117
- data/spec/cassettes/Leadlight/basic_GitHub_example/_root/.yml +58 -25
- data/spec/cassettes/Leadlight/basic_GitHub_example/_root/__location__/.yml +58 -25
- data/spec/cassettes/Leadlight/basic_GitHub_example/_root/should_be_a_204_no_content.yml +58 -25
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/.yml +58 -25
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/__location__/.yml +58 -25
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/should_be_a_204_no_content.yml +58 -25
- data/spec/cassettes/Leadlight/tinted_GitHub_example/_user/has_the_expected_content.yml +122 -50
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/.yml +190 -77
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_able_to_follow_next_link.yml +260 -104
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable.yml +616 -212
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable_over_page_boundaries.yml +331 -131
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_have_next_and_last_links.yml +190 -77
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_link/exists.yml +58 -25
- data/spec/cassettes/Leadlight/tinted_GitHub_example/user_link/links_to_the_expected_URL.yml +58 -25
- data/spec/leadlight/hyperlinkable_spec.rb +3 -1
- data/spec/leadlight/link_template_spec.rb +2 -1
- data/spec/leadlight/request_spec.rb +44 -21
- data/spec/leadlight/service_middleware_spec.rb +9 -46
- data/spec/leadlight/service_spec.rb +30 -24
- data/spec/leadlight/tint_helper_spec.rb +67 -1
- data/spec/leadlight/tint_spec.rb +69 -0
- data/spec/leadlight/type_map_spec.rb +127 -0
- data/spec/leadlight_spec.rb +102 -51
- data/spec/support/credentials.rb +10 -2
- data/spec/support/vcr.rb +1 -1
- metadata +61 -32
- data/lib/leadlight/type.rb +0 -71
- data/spec/leadlight/type_spec.rb +0 -137
@@ -1,32 +1,65 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
7
|
-
headers:
|
8
|
-
Accept:
|
9
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
-
|
11
|
-
|
6
|
+
body: ''
|
7
|
+
headers:
|
8
|
+
Accept:
|
9
|
+
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
+
text/plain
|
11
|
+
response:
|
12
|
+
status:
|
12
13
|
code: 204
|
13
|
-
message:
|
14
|
-
headers:
|
15
|
-
server:
|
14
|
+
message: !!null
|
15
|
+
headers:
|
16
|
+
server:
|
16
17
|
- nginx/1.0.4
|
17
|
-
date:
|
18
|
-
-
|
19
|
-
connection:
|
18
|
+
date:
|
19
|
+
- Sun, 15 Jan 2012 19:38:31 GMT
|
20
|
+
connection:
|
20
21
|
- close
|
21
|
-
status:
|
22
|
+
status:
|
22
23
|
- 204 No Content
|
23
|
-
x-ratelimit-limit:
|
24
|
-
-
|
25
|
-
etag:
|
26
|
-
- "
|
27
|
-
x-ratelimit-remaining:
|
28
|
-
-
|
29
|
-
body:
|
30
|
-
http_version:
|
31
|
-
recorded_at:
|
24
|
+
x-ratelimit-limit:
|
25
|
+
- '5000'
|
26
|
+
etag:
|
27
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
|
+
x-ratelimit-remaining:
|
29
|
+
- '4999'
|
30
|
+
body: ''
|
31
|
+
http_version: !!null
|
32
|
+
recorded_at: Sun, 15 Jan 2012 19:38:31 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: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
|
32
65
|
recorded_with: VCR 2.0.0.rc1
|
@@ -1,32 +1,65 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
7
|
-
headers:
|
8
|
-
Accept:
|
9
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
-
|
11
|
-
|
6
|
+
body: ''
|
7
|
+
headers:
|
8
|
+
Accept:
|
9
|
+
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
+
text/plain
|
11
|
+
response:
|
12
|
+
status:
|
12
13
|
code: 204
|
13
|
-
message:
|
14
|
-
headers:
|
15
|
-
server:
|
14
|
+
message: !!null
|
15
|
+
headers:
|
16
|
+
server:
|
16
17
|
- nginx/1.0.4
|
17
|
-
date:
|
18
|
-
-
|
19
|
-
connection:
|
18
|
+
date:
|
19
|
+
- Sun, 15 Jan 2012 19:38:32 GMT
|
20
|
+
connection:
|
20
21
|
- close
|
21
|
-
status:
|
22
|
+
status:
|
22
23
|
- 204 No Content
|
23
|
-
x-ratelimit-limit:
|
24
|
-
-
|
25
|
-
etag:
|
26
|
-
- "
|
27
|
-
x-ratelimit-remaining:
|
28
|
-
-
|
29
|
-
body:
|
30
|
-
http_version:
|
31
|
-
recorded_at:
|
24
|
+
x-ratelimit-limit:
|
25
|
+
- '5000'
|
26
|
+
etag:
|
27
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
|
+
x-ratelimit-remaining:
|
29
|
+
- '4997'
|
30
|
+
body: ''
|
31
|
+
http_version: !!null
|
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
|
56
|
+
x-ratelimit-limit:
|
57
|
+
- '5000'
|
58
|
+
etag:
|
59
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
60
|
+
x-ratelimit-remaining:
|
61
|
+
- '4997'
|
62
|
+
body: ''
|
63
|
+
http_version: !!null
|
64
|
+
recorded_at: Mon, 16 Jan 2012 02:45:53 GMT
|
32
65
|
recorded_with: VCR 2.0.0.rc1
|
@@ -1,32 +1,65 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
7
|
-
headers:
|
8
|
-
Accept:
|
9
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
-
|
11
|
-
|
6
|
+
body: ''
|
7
|
+
headers:
|
8
|
+
Accept:
|
9
|
+
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
+
text/plain
|
11
|
+
response:
|
12
|
+
status:
|
12
13
|
code: 204
|
13
|
-
message:
|
14
|
-
headers:
|
15
|
-
server:
|
14
|
+
message: !!null
|
15
|
+
headers:
|
16
|
+
server:
|
16
17
|
- nginx/1.0.4
|
17
|
-
date:
|
18
|
-
-
|
19
|
-
connection:
|
18
|
+
date:
|
19
|
+
- Sun, 15 Jan 2012 19:38:32 GMT
|
20
|
+
connection:
|
20
21
|
- close
|
21
|
-
status:
|
22
|
+
status:
|
22
23
|
- 204 No Content
|
23
|
-
x-ratelimit-limit:
|
24
|
-
-
|
25
|
-
etag:
|
26
|
-
- "
|
27
|
-
x-ratelimit-remaining:
|
28
|
-
-
|
29
|
-
body:
|
30
|
-
http_version:
|
31
|
-
recorded_at:
|
24
|
+
x-ratelimit-limit:
|
25
|
+
- '5000'
|
26
|
+
etag:
|
27
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
|
+
x-ratelimit-remaining:
|
29
|
+
- '4998'
|
30
|
+
body: ''
|
31
|
+
http_version: !!null
|
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: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
|
32
65
|
recorded_with: VCR 2.0.0.rc1
|
@@ -1,32 +1,65 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
7
|
-
headers:
|
8
|
-
Accept:
|
9
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
-
|
11
|
-
|
6
|
+
body: ''
|
7
|
+
headers:
|
8
|
+
Accept:
|
9
|
+
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
+
text/plain
|
11
|
+
response:
|
12
|
+
status:
|
12
13
|
code: 204
|
13
|
-
message:
|
14
|
-
headers:
|
15
|
-
server:
|
14
|
+
message: !!null
|
15
|
+
headers:
|
16
|
+
server:
|
16
17
|
- nginx/1.0.4
|
17
|
-
date:
|
18
|
-
-
|
19
|
-
connection:
|
18
|
+
date:
|
19
|
+
- Sun, 15 Jan 2012 19:38:32 GMT
|
20
|
+
connection:
|
20
21
|
- close
|
21
|
-
status:
|
22
|
+
status:
|
22
23
|
- 204 No Content
|
23
|
-
x-ratelimit-limit:
|
24
|
-
-
|
25
|
-
etag:
|
26
|
-
- "
|
27
|
-
x-ratelimit-remaining:
|
28
|
-
-
|
29
|
-
body:
|
30
|
-
http_version:
|
31
|
-
recorded_at:
|
24
|
+
x-ratelimit-limit:
|
25
|
+
- '5000'
|
26
|
+
etag:
|
27
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
|
+
x-ratelimit-remaining:
|
29
|
+
- '4996'
|
30
|
+
body: ''
|
31
|
+
http_version: !!null
|
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
|
56
|
+
x-ratelimit-limit:
|
57
|
+
- '5000'
|
58
|
+
etag:
|
59
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
60
|
+
x-ratelimit-remaining:
|
61
|
+
- '4996'
|
62
|
+
body: ''
|
63
|
+
http_version: !!null
|
64
|
+
recorded_at: Mon, 16 Jan 2012 02:45:53 GMT
|
32
65
|
recorded_with: VCR 2.0.0.rc1
|
@@ -1,32 +1,65 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
4
|
method: get
|
5
5
|
uri: https://api.github.com/
|
6
|
-
body:
|
7
|
-
headers:
|
8
|
-
Accept:
|
9
|
-
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
-
|
11
|
-
|
6
|
+
body: ''
|
7
|
+
headers:
|
8
|
+
Accept:
|
9
|
+
- application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
|
10
|
+
text/plain
|
11
|
+
response:
|
12
|
+
status:
|
12
13
|
code: 204
|
13
|
-
message:
|
14
|
-
headers:
|
15
|
-
server:
|
14
|
+
message: !!null
|
15
|
+
headers:
|
16
|
+
server:
|
16
17
|
- nginx/1.0.4
|
17
|
-
date:
|
18
|
-
-
|
19
|
-
connection:
|
18
|
+
date:
|
19
|
+
- Sun, 15 Jan 2012 19:38:33 GMT
|
20
|
+
connection:
|
20
21
|
- close
|
21
|
-
status:
|
22
|
+
status:
|
22
23
|
- 204 No Content
|
23
|
-
x-ratelimit-limit:
|
24
|
-
-
|
25
|
-
etag:
|
26
|
-
- "
|
27
|
-
x-ratelimit-remaining:
|
28
|
-
-
|
29
|
-
body:
|
30
|
-
http_version:
|
31
|
-
recorded_at:
|
24
|
+
x-ratelimit-limit:
|
25
|
+
- '5000'
|
26
|
+
etag:
|
27
|
+
- ! '"d41d8cd98f00b204e9800998ecf8427e"'
|
28
|
+
x-ratelimit-remaining:
|
29
|
+
- '4994'
|
30
|
+
body: ''
|
31
|
+
http_version: !!null
|
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: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
|
32
65
|
recorded_with: VCR 2.0.0.rc1
|