Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Request bodies now supported!

  • Loading branch information...
commit 0450776fdd55da79fadfcbfb3c1217d9b67d7783 1 parent 6d0c1b3
Avdi Grimm authored

Showing 23 changed files with 2,428 additions and 821 deletions. Show diff stats Hide diff stats

  1. +1 1  lib/leadlight/hyperlinkable.rb
  2. +8 3 lib/leadlight/request.rb
  3. +2 1  lib/leadlight/type_map.rb
  4. +282 0 spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_teams.yml
  5. +56 23 spec/cassettes/Leadlight/basic_GitHub_example/_root/.yml
  6. +56 23 spec/cassettes/Leadlight/basic_GitHub_example/_root/__location__/.yml
  7. +56 23 spec/cassettes/Leadlight/basic_GitHub_example/_root/should_be_a_204_no_content.yml
  8. +56 23 spec/cassettes/Leadlight/tinted_GitHub_example/_root/.yml
  9. +56 23 spec/cassettes/Leadlight/tinted_GitHub_example/_root/__location__/.yml
  10. +56 23 spec/cassettes/Leadlight/tinted_GitHub_example/_root/should_be_a_204_no_content.yml
  11. +118 46 spec/cassettes/Leadlight/tinted_GitHub_example/_user/has_the_expected_content.yml
  12. +184 71 spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/.yml
  13. +252 96 spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_able_to_follow_next_link.yml
  14. +590 221 spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable.yml
  15. +321 121 spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable_over_page_boundaries.yml
  16. +184 71 spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_have_next_and_last_links.yml
  17. +56 23 spec/cassettes/Leadlight/tinted_GitHub_example/user_link/exists.yml
  18. +56 23 spec/cassettes/Leadlight/tinted_GitHub_example/user_link/links_to_the_expected_URL.yml
  19. +3 1 spec/leadlight/hyperlinkable_spec.rb
  20. +2 1  spec/leadlight/link_template_spec.rb
  21. +4 3 spec/leadlight/request_spec.rb
  22. +6 0 spec/leadlight/type_map_spec.rb
  23. +23 1 spec/leadlight_spec.rb
2  lib/leadlight/hyperlinkable.rb
@@ -10,7 +10,7 @@ module Leadlight
10 10 module Hyperlinkable
11 11 def self.extended(representation)
12 12 super(representation)
13   - representation.add_link(representation.__response__.env[:url],
  13 + representation.add_link(representation.__location__,
14 14 'self', 'self', rev: 'self')
15 15 representation.add_links_from_headers
16 16 end
11 lib/leadlight/request.rb
@@ -51,8 +51,12 @@ def completed?
51 51 end
52 52
53 53 def submit
54   - connection.run_request(http_method, url, body, {}) do |request|
55   - request.options[:leadlight_request] = self
  54 + entity = type_map.to_entity_body(body)
  55 + entity_body = entity.body
  56 + content_type = entity.content_type
  57 + connection.run_request(http_method, url, entity_body, {}) do |request|
  58 + request.headers['Content-Type'] = content_type if content_type
  59 + request.options[:leadlight_request] = self
56 60 execute_hook(:on_prepare_request, request)
57 61 end.on_complete do |env|
58 62 synchronize do
@@ -102,9 +106,10 @@ def represent(env)
102 106 content_type = env[:response_headers]['Content-Type']
103 107 content_type = clean_content_type(content_type)
104 108 representation = type_map.to_native(content_type, env[:body])
  109 + location = Addressable::URI.parse(env[:response_headers].fetch('location'){ env[:url] })
105 110 representation.
106 111 extend(Representation).
107   - initialize_representation(env[:leadlight_service], env[:url], env[:response]).
  112 + initialize_representation(env[:leadlight_service], location, env[:response]).
108 113 extend(Hyperlinkable).
109 114 apply_all_tints
110 115 end
3  lib/leadlight/type_map.rb
@@ -82,13 +82,14 @@ def initialize(codec)
82 82 end
83 83
84 84 def encode(object, options={})
  85 + return Entity.new(nil, nil) if object.nil?
85 86 content_type = options.delete(:content_type){"application/json"}
86 87 body = @codec.encode(content_type, object, options)
87 88 Entity.new(content_type, body)
88 89 end
89 90
90 91 def decode(content_type, entity_body, options={})
91   - case entity_body.size
  92 + case entity_body.to_s.size
92 93 when 0,1 # No valid JSON document is smaller than 2 bytes
93 94 Blank.new
94 95 else
282 spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_teams.yml
... ... @@ -0,0 +1,282 @@
  1 +---
  2 +http_interactions:
  3 +- request:
  4 + method: get
  5 + uri: https://api.github.com/
  6 + body: ''
  7 + headers:
  8 + Authorization:
  9 + - <AUTH FILTERED>
  10 + Accept:
  11 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  12 + text/plain
  13 + response:
  14 + status:
  15 + code: 204
  16 + message: !!null
  17 + headers:
  18 + server:
  19 + - nginx/1.0.4
  20 + date:
  21 + - Mon, 16 Jan 2012 04:50:22 GMT
  22 + connection:
  23 + - close
  24 + status:
  25 + - 204 No Content
  26 + x-ratelimit-limit:
  27 + - '5000'
  28 + etag:
  29 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  30 + x-oauth-scopes:
  31 + - repo
  32 + x-ratelimit-remaining:
  33 + - '4985'
  34 + body: ''
  35 + http_version: !!null
  36 + recorded_at: Mon, 16 Jan 2012 04:50:22 GMT
  37 +- request:
  38 + method: get
  39 + uri: https://api.github.com/orgs/shiprise
  40 + body: ''
  41 + headers:
  42 + Authorization:
  43 + - <AUTH FILTERED>
  44 + Accept:
  45 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  46 + text/plain
  47 + response:
  48 + status:
  49 + code: 200
  50 + message: !!null
  51 + headers:
  52 + server:
  53 + - nginx/1.0.4
  54 + date:
  55 + - Mon, 16 Jan 2012 04:50:22 GMT
  56 + content-type:
  57 + - application/json; charset=utf-8
  58 + transfer-encoding:
  59 + - chunked
  60 + connection:
  61 + - close
  62 + status:
  63 + - 200 OK
  64 + x-ratelimit-limit:
  65 + - '5000'
  66 + etag:
  67 + - ! '"08a3c9cddbbd6fe2819b345e19634c09"'
  68 + x-oauth-scopes:
  69 + - repo
  70 + x-ratelimit-remaining:
  71 + - '4984'
  72 + x-accepted-oauth-scopes:
  73 + - repo
  74 + body: ! '{"type":"Organization","collaborators":0,"created_at":"2011-10-27T20:49:51Z","email":"avdi@shiprise.net","url":"https://api.github.com/orgs/ShipRise","login":"ShipRise","plan":{"space":2516582,"private_repos":10,"name":"bronze"},"followers":0,"blog":"http://shiprise.net","total_private_repos":1,"public_repos":0,"following":0,"billing_email":"avdi@shiprise.net","owned_private_repos":1,"disk_usage":552,"public_gists":0,"html_url":"https://github.com/ShipRise","name":"Leadlight
  75 + Ephemeral Team","avatar_url":"https://secure.gravatar.com/avatar/6dd3c12e97a46ff08c358542cae955e2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","location":null,"id":1156570,"private_gists":0,"company":null}'
  76 + http_version: !!null
  77 + recorded_at: Mon, 16 Jan 2012 04:50:22 GMT
  78 +- request:
  79 + method: post
  80 + uri: https://api.github.com/orgs/shiprise/teams
  81 + body: ! '{"name":"Leadlight Ephemeral Team","permission":"pull"}'
  82 + headers:
  83 + Content-Type:
  84 + - application/json
  85 + Authorization:
  86 + - <AUTH FILTERED>
  87 + Accept:
  88 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  89 + text/plain
  90 + response:
  91 + status:
  92 + code: 201
  93 + message: !!null
  94 + headers:
  95 + server:
  96 + - nginx/1.0.4
  97 + date:
  98 + - Mon, 16 Jan 2012 04:50:23 GMT
  99 + content-type:
  100 + - application/json; charset=utf-8
  101 + connection:
  102 + - close
  103 + status:
  104 + - 201 Created
  105 + x-ratelimit-limit:
  106 + - '5000'
  107 + etag:
  108 + - ! '"054dbeddef24cd45b014dc0fcdb45654"'
  109 + location:
  110 + - https://api.github.com/teams/130176
  111 + x-oauth-scopes:
  112 + - repo
  113 + x-ratelimit-remaining:
  114 + - '4983'
  115 + x-accepted-oauth-scopes:
  116 + - repo
  117 + content-length:
  118 + - '145'
  119 + body: ! '{"url":"https://api.github.com/teams/130176","name":"Leadlight Ephemeral
  120 + Team","permission":"pull","members_count":0,"repos_count":0,"id":130176}'
  121 + http_version: !!null
  122 + recorded_at: Mon, 16 Jan 2012 04:50:22 GMT
  123 +- request:
  124 + method: get
  125 + uri: https://api.github.com/orgs/shiprise/teams
  126 + body: ''
  127 + headers:
  128 + Authorization:
  129 + - <AUTH FILTERED>
  130 + Accept:
  131 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  132 + text/plain
  133 + response:
  134 + status:
  135 + code: 200
  136 + message: !!null
  137 + headers:
  138 + server:
  139 + - nginx/1.0.4
  140 + date:
  141 + - Mon, 16 Jan 2012 04:50:23 GMT
  142 + content-type:
  143 + - application/json; charset=utf-8
  144 + transfer-encoding:
  145 + - chunked
  146 + connection:
  147 + - close
  148 + status:
  149 + - 200 OK
  150 + x-ratelimit-limit:
  151 + - '5000'
  152 + etag:
  153 + - ! '"8dd1b70061636cf5ebaaca6448460331"'
  154 + x-oauth-scopes:
  155 + - repo
  156 + x-ratelimit-remaining:
  157 + - '4982'
  158 + x-accepted-oauth-scopes:
  159 + - repo
  160 + body: ! '[{"url":"https://api.github.com/teams/111894","name":"BitBindery Development","id":111894},{"url":"https://api.github.com/teams/130176","name":"Leadlight
  161 + Ephemeral Team","id":130176},{"url":"https://api.github.com/teams/127491","name":"Leadlight
  162 + Test Team","id":127491},{"url":"https://api.github.com/teams/104018","name":"Owners","id":104018}]'
  163 + http_version: !!null
  164 + recorded_at: Mon, 16 Jan 2012 04:50:23 GMT
  165 +- request:
  166 + method: get
  167 + uri: https://api.github.com/teams/130176
  168 + body: ''
  169 + headers:
  170 + Authorization:
  171 + - <AUTH FILTERED>
  172 + Accept:
  173 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  174 + text/plain
  175 + response:
  176 + status:
  177 + code: 200
  178 + message: !!null
  179 + headers:
  180 + server:
  181 + - nginx/1.0.4
  182 + date:
  183 + - Mon, 16 Jan 2012 04:50:23 GMT
  184 + content-type:
  185 + - application/json; charset=utf-8
  186 + transfer-encoding:
  187 + - chunked
  188 + connection:
  189 + - close
  190 + status:
  191 + - 200 OK
  192 + x-ratelimit-limit:
  193 + - '5000'
  194 + etag:
  195 + - ! '"ceecc29b7574f9776b0e76cc4946fd42"'
  196 + x-oauth-scopes:
  197 + - repo
  198 + x-ratelimit-remaining:
  199 + - '4981'
  200 + x-accepted-oauth-scopes:
  201 + - repo
  202 + body: ! '{"members_count":0,"repos_count":0,"url":"https://api.github.com/teams/130176","permission":"pull","name":"Leadlight
  203 + Ephemeral Team","id":130176}'
  204 + http_version: !!null
  205 + recorded_at: Mon, 16 Jan 2012 04:50:23 GMT
  206 +- request:
  207 + method: delete
  208 + uri: https://api.github.com/teams/130176
  209 + body: ''
  210 + headers:
  211 + Authorization:
  212 + - <AUTH FILTERED>
  213 + Accept:
  214 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  215 + text/plain
  216 + response:
  217 + status:
  218 + code: 204
  219 + message: !!null
  220 + headers:
  221 + server:
  222 + - nginx/1.0.4
  223 + date:
  224 + - Mon, 16 Jan 2012 04:50:41 GMT
  225 + connection:
  226 + - close
  227 + status:
  228 + - 204 No Content
  229 + x-ratelimit-limit:
  230 + - '5000'
  231 + etag:
  232 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  233 + x-oauth-scopes:
  234 + - repo
  235 + x-ratelimit-remaining:
  236 + - '4980'
  237 + x-accepted-oauth-scopes:
  238 + - repo
  239 + body: ''
  240 + http_version: !!null
  241 + recorded_at: Mon, 16 Jan 2012 04:50:41 GMT
  242 +- request:
  243 + method: delete
  244 + uri: https://api.github.com/orgs/shiprise/teams
  245 + body: ''
  246 + headers:
  247 + Authorization:
  248 + - <AUTH FILTERED>
  249 + Accept:
  250 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  251 + text/plain
  252 + response:
  253 + status:
  254 + code: 404
  255 + message: !!null
  256 + headers:
  257 + server:
  258 + - nginx/1.0.4
  259 + date:
  260 + - Mon, 16 Jan 2012 04:52:55 GMT
  261 + content-type:
  262 + - application/json; charset=utf-8
  263 + connection:
  264 + - close
  265 + status:
  266 + - 404 Not Found
  267 + x-ratelimit-limit:
  268 + - '5000'
  269 + etag:
  270 + - ! '"e66a7a6c91e2c26803f3f49feb7a883f"'
  271 + x-oauth-scopes:
  272 + - repo
  273 + x-ratelimit-remaining:
  274 + - '4979'
  275 + x-accepted-oauth-scopes:
  276 + - repo
  277 + content-length:
  278 + - '23'
  279 + body: ! '{"message":"Not Found"}'
  280 + http_version: !!null
  281 + recorded_at: Mon, 16 Jan 2012 04:52:55 GMT
  282 +recorded_with: VCR 2.0.0.rc1
79 spec/cassettes/Leadlight/basic_GitHub_example/_root/.yml
... ... @@ -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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:31 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4999"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4999'
  30 + body: ''
  31 + http_version: !!null
31 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
79 spec/cassettes/Leadlight/basic_GitHub_example/_root/__location__/.yml
... ... @@ -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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:32 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4997"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4997'
  30 + body: ''
  31 + http_version: !!null
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
  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
79 spec/cassettes/Leadlight/basic_GitHub_example/_root/should_be_a_204_no_content.yml
... ... @@ -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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:32 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4998"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4998'
  30 + body: ''
  31 + http_version: !!null
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: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
79 spec/cassettes/Leadlight/tinted_GitHub_example/_root/.yml
... ... @@ -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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:32 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4996"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4996'
  30 + body: ''
  31 + http_version: !!null
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
  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
79 spec/cassettes/Leadlight/tinted_GitHub_example/_root/__location__/.yml
... ... @@ -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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:33 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4994"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4994'
  30 + body: ''
  31 + http_version: !!null
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: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
79 spec/cassettes/Leadlight/tinted_GitHub_example/_root/should_be_a_204_no_content.yml
... ... @@ -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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:33 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4995"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4995'
  30 + body: ''
  31 + http_version: !!null
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
  56 + x-ratelimit-limit:
  57 + - '5000'
  58 + etag:
  59 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  60 + x-ratelimit-remaining:
  61 + - '4995'
  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
164 spec/cassettes/Leadlight/tinted_GitHub_example/_user/has_the_expected_content.yml
... ... @@ -1,65 +1,137 @@
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, text/plain
10   - response:
11   - status:
  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 + date:
18 19 - Sun, 15 Jan 2012 19:38:34 GMT
19   - connection:
  20 + connection:
20 21 - close
21   - status:
  22 + status:
22 23 - 204 No Content
23   - x-ratelimit-limit:
24   - - "5000"
25   - etag:
26   - - "\"d41d8cd98f00b204e9800998ecf8427e\""
27   - x-ratelimit-remaining:
28   - - "4991"
29   - body: ""
30   - http_version:
  24 + x-ratelimit-limit:
  25 + - '5000'
  26 + etag:
  27 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  28 + x-ratelimit-remaining:
  29 + - '4991'
  30 + body: ''
  31 + http_version: !!null
31 32 recorded_at: Sun, 15 Jan 2012 19:38:34 GMT
32   -- request:
  33 +- request:
33 34 method: get
34 35 uri: https://api.github.com/users/avdi
35   - body: ""
36   - headers:
37   - Accept:
38   - - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html, text/plain
39   - response:
40   - status:
  36 + body: ''
  37 + headers:
  38 + Accept:
  39 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  40 + text/plain
  41 + response:
  42 + status:
41 43 code: 200
42   - message:
43   - headers:
44   - server:
  44 + message: !!null
  45 + headers:
  46 + server:
45 47 - nginx/1.0.4
46   - date:
  48 + date:
47 49 - Sun, 15 Jan 2012 19:38:35 GMT
48   - content-type:
  50 + content-type:
49 51 - application/json; charset=utf-8
50   - transfer-encoding:
  52 + transfer-encoding:
51 53 - chunked
52   - connection:
  54 + connection:
53 55 - close
54   - status:
  56 + status:
55 57 - 200 OK
56   - x-ratelimit-limit:
57   - - "5000"
58   - etag:
59   - - "\"bd2349fc1bde922b61f07cdfeac7fc06\""
60   - x-ratelimit-remaining:
61   - - "4990"
62   - body: "{\"type\":\"User\",\"created_at\":\"2008-02-26T19:54:34Z\",\"email\":\"avdi@avdi.org\",\"hireable\":false,\"url\":\"https://api.github.com/users/avdi\",\"login\":\"avdi\",\"bio\":null,\"followers\":181,\"following\":33,\"blog\":\"http://avdi.org/devblog/\",\"name\":\"Avdi Grimm\",\"public_repos\":61,\"location\":\"Pennsylvania, USA\",\"id\":982,\"public_gists\":72,\"html_url\":\"https://github.com/avdi\",\"company\":\"ShipRise\",\"gravatar_id\":\"4dea430d31b993abaf41cd9b54f8128d\",\"avatar_url\":\"https://secure.gravatar.com/avatar/4dea430d31b993abaf41cd9b54f8128d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"}"
63   - http_version:
  58 + x-ratelimit-limit:
  59 + - '5000'
  60 + etag:
  61 + - ! '"bd2349fc1bde922b61f07cdfeac7fc06"'
  62 + x-ratelimit-remaining:
  63 + - '4990'
  64 + body: ! '{"type":"User","created_at":"2008-02-26T19:54:34Z","email":"avdi@avdi.org","hireable":false,"url":"https://api.github.com/users/avdi","login":"avdi","bio":null,"followers":181,"following":33,"blog":"http://avdi.org/devblog/","name":"Avdi
  65 + Grimm","public_repos":61,"location":"Pennsylvania, USA","id":982,"public_gists":72,"html_url":"https://github.com/avdi","company":"ShipRise","gravatar_id":"4dea430d31b993abaf41cd9b54f8128d","avatar_url":"https://secure.gravatar.com/avatar/4dea430d31b993abaf41cd9b54f8128d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"}'
  66 + http_version: !!null
64 67 recorded_at: Sun, 15 Jan 2012 19:38:35 GMT
  68 +- request:
  69 + method: get
  70 + uri: https://api.github.com/
  71 + body: 'null'
  72 + headers:
  73 + Content-Type:
  74 + - application/json
  75 + Accept:
  76 + - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
  77 + text/plain
  78 + response:
  79 + status:
  80 + code: 204
  81 + message: !!null
  82 + headers:
  83 + server:
  84 + - nginx/1.0.4
  85 + date:
  86 + - Mon, 16 Jan 2012 02:45:55 GMT
  87 + connection:
  88 + - close
  89 + status:
  90 + - 204 No Content
  91 + x-ratelimit-limit:
  92 + - '5000'
  93 + etag:
  94 + - ! '"d41d8cd98f00b204e9800998ecf8427e"'
  95 + x-ratelimit-remaining:
  96 + - '4991'
  97 + body: ''