leadlight 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/Gemfile +9 -0
  2. data/Gemfile.lock +79 -0
  3. data/Guardfile +19 -0
  4. data/Rakefile +133 -0
  5. data/leadlight.gemspec +125 -0
  6. data/lib/leadlight.rb +92 -0
  7. data/lib/leadlight/blank.rb +15 -0
  8. data/lib/leadlight/codec.rb +63 -0
  9. data/lib/leadlight/enumerable_representation.rb +24 -0
  10. data/lib/leadlight/errors.rb +14 -0
  11. data/lib/leadlight/hyperlinkable.rb +126 -0
  12. data/lib/leadlight/link.rb +35 -0
  13. data/lib/leadlight/link_template.rb +47 -0
  14. data/lib/leadlight/representation.rb +30 -0
  15. data/lib/leadlight/request.rb +91 -0
  16. data/lib/leadlight/service.rb +73 -0
  17. data/lib/leadlight/service_middleware.rb +50 -0
  18. data/lib/leadlight/tint.rb +26 -0
  19. data/lib/leadlight/tint_helper.rb +67 -0
  20. data/lib/leadlight/type.rb +71 -0
  21. data/spec/cassettes/Leadlight/authorized_GitHub_example/_user/has_the_expected_content.yml +75 -0
  22. data/spec/cassettes/Leadlight/authorized_GitHub_example/_user/indicates_the_expected_oath_scopes.yml +75 -0
  23. data/spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_team_members.yml +384 -0
  24. data/spec/cassettes/Leadlight/authorized_GitHub_example/adding_and_removing_team_members/.yml +309 -0
  25. data/spec/cassettes/Leadlight/authorized_GitHub_example/test_team/.yml +159 -0
  26. data/spec/cassettes/Leadlight/basic_GitHub_example/_root/.yml +32 -0
  27. data/spec/cassettes/Leadlight/basic_GitHub_example/_root/__location__/.yml +32 -0
  28. data/spec/cassettes/Leadlight/basic_GitHub_example/_root/should_be_a_204_no_content.yml +32 -0
  29. data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/.yml +32 -0
  30. data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/__location__/.yml +32 -0
  31. data/spec/cassettes/Leadlight/tinted_GitHub_example/_root/should_be_a_204_no_content.yml +32 -0
  32. data/spec/cassettes/Leadlight/tinted_GitHub_example/_user/has_the_expected_content.yml +65 -0
  33. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/.yml +100 -0
  34. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_able_to_follow_next_link.yml +135 -0
  35. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable.yml +275 -0
  36. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_be_enumerable_over_page_boundaries.yml +170 -0
  37. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_followers/should_have_next_and_last_links.yml +100 -0
  38. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_link/exists.yml +32 -0
  39. data/spec/cassettes/Leadlight/tinted_GitHub_example/user_link/links_to_the_expected_URL.yml +32 -0
  40. data/spec/leadlight/codec_spec.rb +93 -0
  41. data/spec/leadlight/hyperlinkable_spec.rb +136 -0
  42. data/spec/leadlight/link_spec.rb +53 -0
  43. data/spec/leadlight/link_template_spec.rb +45 -0
  44. data/spec/leadlight/representation_spec.rb +62 -0
  45. data/spec/leadlight/request_spec.rb +236 -0
  46. data/spec/leadlight/service_middleware_spec.rb +81 -0
  47. data/spec/leadlight/service_spec.rb +127 -0
  48. data/spec/leadlight/tint_helper_spec.rb +132 -0
  49. data/spec/leadlight/type_spec.rb +137 -0
  50. data/spec/leadlight_spec.rb +237 -0
  51. data/spec/spec_helper_lite.rb +6 -0
  52. data/spec/support/credentials.rb +16 -0
  53. data/spec/support/vcr.rb +18 -0
  54. metadata +229 -0
@@ -0,0 +1,73 @@
1
+ require 'fattr'
2
+ require 'forwardable'
3
+ require 'leadlight/request'
4
+
5
+ module Leadlight
6
+ module Service
7
+ extend Forwardable
8
+
9
+ attr_reader :service_options
10
+ fattr(:logger) { service_options.fetch(:logger) { ::Logger.new($stderr) } }
11
+ fattr(:tints) { self.class.tints }
12
+ fattr(:codec) { service_options.fetch(:codec) { Codec.new } }
13
+
14
+ def_delegators :codec, :encode, :decode
15
+ def_delegators 'self.class', :types, :type_for_name
16
+
17
+ def initialize(service_options={})
18
+ @service_options = service_options
19
+ end
20
+
21
+ def root
22
+ get('/') do |r|
23
+ return r
24
+ end
25
+ end
26
+
27
+ def url
28
+ self.class.url
29
+ end
30
+
31
+ def connection
32
+ @connection ||= Faraday.new(url: self.url) do |builder|
33
+ builder.use Leadlight::ServiceMiddleware, service: self
34
+ instance_exec(builder, &connection_stack)
35
+ builder.use Faraday::Response::Logger, logger
36
+ instance_exec(builder, &Leadlight.common_connection_stack)
37
+ end
38
+ end
39
+
40
+ [:options, :head, :get, :post, :put, :delete, :patch].each do |name|
41
+ define_method(name) do |url, *args, &block|
42
+ perform_request(url, name, *args, &block)
43
+ end
44
+ end
45
+
46
+ # Convenience method for a quick GET which submits, waits, raises
47
+ # on error, and yields the representation.
48
+ def get_representation!(*args, &block)
49
+ get(*args).raise_on_error.submit_and_wait(&block)
50
+ end
51
+
52
+ private
53
+
54
+ def perform_request(url, http_method, params={}, body=nil, &representation_handler)
55
+ req = Request.new(connection, url, http_method, params, body)
56
+ req.on_prepare_request do |faraday_request|
57
+ prepare_request(faraday_request)
58
+ end
59
+ if representation_handler
60
+ req.submit_and_wait(&representation_handler)
61
+ end
62
+ req
63
+ end
64
+
65
+ def prepare_request(request)
66
+ # Override in subclasses
67
+ end
68
+
69
+ def connection_stack
70
+ self.class.connection_stack
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,50 @@
1
+ require 'multi_json'
2
+ require 'leadlight/blank'
3
+ require 'leadlight/hyperlinkable'
4
+ require 'leadlight/representation'
5
+
6
+ module Leadlight
7
+
8
+ class ServiceMiddleware
9
+ def initialize(app, options={})
10
+ @app = app
11
+ @service = options.fetch(:service)
12
+ end
13
+
14
+ def call(env)
15
+ env[:leadlight_service] = @service
16
+ env[:request_headers]['Accept'] = default_accept_types
17
+ @app.call(env).on_complete do |env|
18
+ env[:leadlight_representation] = represent(env)
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ def default_accept_types
25
+ %w[
26
+ application/json
27
+ text/x-yaml
28
+ application/xml
29
+ application/xhtml+xml
30
+ text/html
31
+ text/plain
32
+ ]
33
+ end
34
+
35
+ def represent(env)
36
+ content_type = env[:response_headers]['Content-Type']
37
+ representation = if (env[:body] || '').size > 0
38
+ ::MultiJson.decode(env[:body])
39
+ else
40
+ Blank.new
41
+ end
42
+ representation.
43
+ extend(Representation).
44
+ initialize_representation(env[:leadlight_service], env[:url], env[:response]).
45
+ extend(Hyperlinkable).
46
+ apply_all_tints
47
+ end
48
+ end
49
+
50
+ end
@@ -0,0 +1,26 @@
1
+ require 'leadlight/tint_helper'
2
+
3
+ module Leadlight
4
+ class Tint < Module
5
+ attr_reader :name
6
+ def initialize(name, &block)
7
+ @name = @tint_name = name
8
+ tint = self
9
+ super(){
10
+ define_method(:__apply_tint__) do
11
+ super()
12
+ helper = TintHelper.new(self, tint)
13
+ helper.exec_tint(&block)
14
+ end
15
+ }
16
+ end
17
+
18
+ def inspect
19
+ "#<Leadlight::Tint:#{@tint_name}>"
20
+ end
21
+
22
+ def to_s
23
+ inspect
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,67 @@
1
+ require 'delegate'
2
+ require 'mime/types'
3
+
4
+ module Leadlight
5
+ class TintHelper < SimpleDelegator
6
+ def initialize(representation, tint)
7
+ @tint = tint
8
+ super(representation)
9
+ end
10
+
11
+ def exec_tint(&block)
12
+ catch(:halt_tint) do
13
+ instance_eval(&block)
14
+ end
15
+ self
16
+ end
17
+
18
+ def match(&block)
19
+ matched = instance_eval(&block)
20
+ throw :halt_tint unless matched
21
+ end
22
+
23
+ def match_path(pattern)
24
+ match{ pattern === __location__.path }
25
+ end
26
+
27
+ def match_template(path_template)
28
+ path_url = Addressable::URI.parse(path_template)
29
+ full_url = __location__ + path_url
30
+ template = Addressable::Template.new(full_url.to_s)
31
+ match { template.match(__location__) }
32
+ end
33
+
34
+ def match_content_type(pattern)
35
+ content_type = __response__.env[:response_headers]['Content-Type'].to_s
36
+ throw :halt_tint if content_type.empty?
37
+ mimetype = MIME::Type.new(content_type)
38
+ match{
39
+ # Gotta get rid of the type params
40
+ pattern === "#{mimetype.media_type}/#{mimetype.sub_type}"
41
+ }
42
+ end
43
+
44
+ def match_class(klass)
45
+ match{ klass === __getobj__}
46
+ end
47
+
48
+ def add_header(name, value)
49
+ __response__.env[:response_headers][name] = value
50
+ end
51
+
52
+ def extend(mod=nil, &block)
53
+ if mod && block
54
+ raise ArgumentError, 'Module or block, not both'
55
+ end
56
+ if mod
57
+ __getobj__.extend(mod)
58
+ else
59
+ __getobj__.extend(Module.new(&block))
60
+ end
61
+ end
62
+
63
+ def type(type_name)
64
+ __getobj__.__type__ = __service__.type_for_name(type_name)
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,71 @@
1
+ require 'fattr'
2
+ require 'addressable/template'
3
+ require 'leadlight/tint'
4
+
5
+ module Leadlight
6
+ class Type < Module
7
+ attr_reader :name
8
+ attr_reader :service
9
+ fattr :enctype
10
+ fattr :link_to_create
11
+
12
+ def initialize(name, service, &body)
13
+ @name = name
14
+ @service = service
15
+ @builder = Object.method(:new)
16
+ @enctype = 'application/json'
17
+ super() do
18
+ instance_exec &preamble
19
+ instance_exec &body
20
+ end
21
+ end
22
+
23
+ def inspect
24
+ "#<Leadlight::Type:#{name}>"
25
+ end
26
+
27
+ def to_s
28
+ "Type(#{name})"
29
+ end
30
+
31
+ def builder(&block)
32
+ @builder = block
33
+ end
34
+
35
+ def build(*args)
36
+ obj = @builder.call(*args).extend(self)
37
+ yield obj if block_given?
38
+ obj
39
+ end
40
+
41
+ def to_entity(object)
42
+ Entity.new(enctype)
43
+ end
44
+
45
+ def encode(representation, options={})
46
+ encoder = options.fetch(:encoder){ representation.__service__ }
47
+ encoder.encode(enctype, representation, options)
48
+ end
49
+
50
+ def extended(object)
51
+ super
52
+ if link_to_create
53
+ object.add_link(link_to_create, 'create', "Create a new #{name}")
54
+ end
55
+ end
56
+
57
+ def tint
58
+ @tint ||= Tint.new("type:#{name}") do
59
+ end
60
+ end
61
+
62
+ private
63
+
64
+ def preamble
65
+ the_type = self
66
+ proc {
67
+ define_method(:__type__){ the_type }
68
+ }
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,75 @@
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, text/plain
12
+ response:
13
+ status:
14
+ code: 204
15
+ message:
16
+ headers:
17
+ server:
18
+ - nginx/1.0.4
19
+ date:
20
+ - Mon, 09 Jan 2012 02:31:55 GMT
21
+ connection:
22
+ - close
23
+ status:
24
+ - 204 No Content
25
+ x-ratelimit-limit:
26
+ - "5000"
27
+ etag:
28
+ - "\"d41d8cd98f00b204e9800998ecf8427e\""
29
+ x-oauth-scopes:
30
+ - repo
31
+ x-ratelimit-remaining:
32
+ - "4999"
33
+ body: ""
34
+ http_version:
35
+ recorded_at: Mon, 09 Jan 2012 02:31:54 GMT
36
+ - request:
37
+ method: get
38
+ uri: https://api.github.com/users/avdi
39
+ body: ""
40
+ headers:
41
+ Authorization:
42
+ - <AUTH FILTERED>
43
+ Accept:
44
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html, text/plain
45
+ response:
46
+ status:
47
+ code: 200
48
+ message:
49
+ headers:
50
+ server:
51
+ - nginx/1.0.4
52
+ date:
53
+ - Mon, 09 Jan 2012 02:31:55 GMT
54
+ content-type:
55
+ - application/json; charset=utf-8
56
+ transfer-encoding:
57
+ - chunked
58
+ connection:
59
+ - close
60
+ status:
61
+ - 200 OK
62
+ x-ratelimit-limit:
63
+ - "5000"
64
+ etag:
65
+ - "\"16b8c1c449e332c8cdb94888facbedfd\""
66
+ x-oauth-scopes:
67
+ - repo
68
+ x-ratelimit-remaining:
69
+ - "4998"
70
+ x-accepted-oauth-scopes:
71
+ - user
72
+ body: "{\"type\":\"User\",\"location\":\"Pennsylvania, USA\",\"company\":\"ShipRise\",\"email\":\"avdi@avdi.org\",\"followers\":178,\"blog\":\"http://avdi.org/devblog/\",\"created_at\":\"2008-02-26T19:54:34Z\",\"login\":\"avdi\",\"avatar_url\":\"https://secure.gravatar.com/avatar/4dea430d31b993abaf41cd9b54f8128d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"4dea430d31b993abaf41cd9b54f8128d\",\"public_repos\":61,\"following\":34,\"html_url\":\"https://github.com/avdi\",\"hireable\":false,\"public_gists\":68,\"name\":\"Avdi Grimm\",\"bio\":null,\"url\":\"https://api.github.com/users/avdi\",\"id\":982}"
73
+ http_version:
74
+ recorded_at: Mon, 09 Jan 2012 02:31:54 GMT
75
+ recorded_with: VCR 2.0.0.rc1
@@ -0,0 +1,75 @@
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, text/plain
12
+ response:
13
+ status:
14
+ code: 204
15
+ message:
16
+ headers:
17
+ server:
18
+ - nginx/1.0.4
19
+ date:
20
+ - Mon, 09 Jan 2012 02:31:56 GMT
21
+ connection:
22
+ - close
23
+ status:
24
+ - 204 No Content
25
+ x-ratelimit-limit:
26
+ - "5000"
27
+ etag:
28
+ - "\"d41d8cd98f00b204e9800998ecf8427e\""
29
+ x-oauth-scopes:
30
+ - repo
31
+ x-ratelimit-remaining:
32
+ - "4997"
33
+ body: ""
34
+ http_version:
35
+ recorded_at: Mon, 09 Jan 2012 02:31:54 GMT
36
+ - request:
37
+ method: get
38
+ uri: https://api.github.com/users/avdi
39
+ body: ""
40
+ headers:
41
+ Authorization:
42
+ - <AUTH FILTERED>
43
+ Accept:
44
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html, text/plain
45
+ response:
46
+ status:
47
+ code: 200
48
+ message:
49
+ headers:
50
+ server:
51
+ - nginx/1.0.4
52
+ date:
53
+ - Mon, 09 Jan 2012 02:31:56 GMT
54
+ content-type:
55
+ - application/json; charset=utf-8
56
+ transfer-encoding:
57
+ - chunked
58
+ connection:
59
+ - close
60
+ status:
61
+ - 200 OK
62
+ x-ratelimit-limit:
63
+ - "5000"
64
+ etag:
65
+ - "\"1c5ce32320a58cc20b20e43775836557\""
66
+ x-oauth-scopes:
67
+ - repo
68
+ x-ratelimit-remaining:
69
+ - "4996"
70
+ x-accepted-oauth-scopes:
71
+ - user
72
+ body: "{\"type\":\"User\",\"location\":\"Pennsylvania, USA\",\"company\":\"ShipRise\",\"email\":\"avdi@avdi.org\",\"bio\":null,\"followers\":178,\"blog\":\"http://avdi.org/devblog/\",\"avatar_url\":\"https://secure.gravatar.com/avatar/4dea430d31b993abaf41cd9b54f8128d?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"created_at\":\"2008-02-26T19:54:34Z\",\"login\":\"avdi\",\"gravatar_id\":\"4dea430d31b993abaf41cd9b54f8128d\",\"following\":34,\"html_url\":\"https://github.com/avdi\",\"public_repos\":61,\"name\":\"Avdi Grimm\",\"public_gists\":68,\"url\":\"https://api.github.com/users/avdi\",\"id\":982,\"hireable\":false}"
73
+ http_version:
74
+ recorded_at: Mon, 09 Jan 2012 02:31:55 GMT
75
+ recorded_with: VCR 2.0.0.rc1
@@ -0,0 +1,384 @@
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, 09 Jan 2012 04:26:53 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
+ - '4961'
34
+ body: ''
35
+ http_version: !!null
36
+ recorded_at: Mon, 09 Jan 2012 04:26:51 GMT
37
+ - request:
38
+ method: get
39
+ uri: https://api.github.com/users/leadlight-test
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, 09 Jan 2012 04:26:53 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
+ - ! '"840c0261b10d96847d2cae0bbe7aa71e"'
68
+ x-oauth-scopes:
69
+ - repo
70
+ x-ratelimit-remaining:
71
+ - '4960'
72
+ x-accepted-oauth-scopes:
73
+ - user
74
+ body: ! '{"type":"User","followers":0,"html_url":"https://github.com/leadlight-test","created_at":"2012-01-09T02:38:20Z","login":"leadlight-test","gravatar_id":"71a3f4f0d28bcb9c10fe96bbfce8fef8","public_repos":0,"following":0,"public_gists":0,"url":"https://api.github.com/users/leadlight-test","id":1314019,"avatar_url":"https://secure.gravatar.com/avatar/71a3f4f0d28bcb9c10fe96bbfce8fef8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"}'
75
+ http_version: !!null
76
+ recorded_at: Mon, 09 Jan 2012 04:26:51 GMT
77
+ - request:
78
+ method: get
79
+ uri: https://api.github.com/
80
+ body: ''
81
+ headers:
82
+ Authorization:
83
+ - <AUTH FILTERED>
84
+ Accept:
85
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
86
+ text/plain
87
+ response:
88
+ status:
89
+ code: 204
90
+ message: !!null
91
+ headers:
92
+ server:
93
+ - nginx/1.0.4
94
+ date:
95
+ - Mon, 09 Jan 2012 04:26:53 GMT
96
+ connection:
97
+ - close
98
+ status:
99
+ - 204 No Content
100
+ x-ratelimit-limit:
101
+ - '5000'
102
+ etag:
103
+ - ! '"d41d8cd98f00b204e9800998ecf8427e"'
104
+ x-oauth-scopes:
105
+ - repo
106
+ x-ratelimit-remaining:
107
+ - '4959'
108
+ body: ''
109
+ http_version: !!null
110
+ recorded_at: Mon, 09 Jan 2012 04:26:52 GMT
111
+ - request:
112
+ method: get
113
+ uri: https://api.github.com/orgs/shiprise
114
+ body: ''
115
+ headers:
116
+ Authorization:
117
+ - <AUTH FILTERED>
118
+ Accept:
119
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
120
+ text/plain
121
+ response:
122
+ status:
123
+ code: 200
124
+ message: !!null
125
+ headers:
126
+ server:
127
+ - nginx/1.0.4
128
+ date:
129
+ - Mon, 09 Jan 2012 04:26:54 GMT
130
+ content-type:
131
+ - application/json; charset=utf-8
132
+ transfer-encoding:
133
+ - chunked
134
+ connection:
135
+ - close
136
+ status:
137
+ - 200 OK
138
+ x-ratelimit-limit:
139
+ - '5000'
140
+ etag:
141
+ - ! '"c6a60d604b660c4c194cb914dd0da09a"'
142
+ x-oauth-scopes:
143
+ - repo
144
+ x-ratelimit-remaining:
145
+ - '4958'
146
+ x-accepted-oauth-scopes:
147
+ - repo
148
+ body: ! '{"type":"Organization","location":null,"plan":{"private_repos":10,"space":2516582,"name":"bronze"},"followers":0,"company":null,"blog":"http://shiprise.net","email":"avdi@shiprise.net","disk_usage":552,"total_private_repos":1,"billing_email":"avdi@shiprise.net","created_at":"2011-10-27T20:49:51Z","login":"ShipRise","avatar_url":"https://secure.gravatar.com/avatar/6dd3c12e97a46ff08c358542cae955e2?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","owned_private_repos":1,"public_gists":0,"following":0,"private_gists":0,"public_repos":0,"name":"ShipRise","html_url":"https://github.com/ShipRise","url":"https://api.github.com/orgs/ShipRise","id":1156570,"collaborators":0}'
149
+ http_version: !!null
150
+ recorded_at: Mon, 09 Jan 2012 04:26:52 GMT
151
+ - request:
152
+ method: get
153
+ uri: https://api.github.com/orgs/shiprise/teams
154
+ body: ''
155
+ headers:
156
+ Authorization:
157
+ - <AUTH FILTERED>
158
+ Accept:
159
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
160
+ text/plain
161
+ response:
162
+ status:
163
+ code: 200
164
+ message: !!null
165
+ headers:
166
+ server:
167
+ - nginx/1.0.4
168
+ date:
169
+ - Mon, 09 Jan 2012 04:26:54 GMT
170
+ content-type:
171
+ - application/json; charset=utf-8
172
+ transfer-encoding:
173
+ - chunked
174
+ connection:
175
+ - close
176
+ status:
177
+ - 200 OK
178
+ x-ratelimit-limit:
179
+ - '5000'
180
+ etag:
181
+ - ! '"7bacecfddc356d3ba366ba12652db603"'
182
+ x-oauth-scopes:
183
+ - repo
184
+ x-ratelimit-remaining:
185
+ - '4957'
186
+ x-accepted-oauth-scopes:
187
+ - repo
188
+ body: ! '[{"name":"BitBindery Development","url":"https://api.github.com/teams/111894","id":111894},{"name":"Leadlight
189
+ Test Team","url":"https://api.github.com/teams/127491","id":127491},{"name":"Owners","url":"https://api.github.com/teams/104018","id":104018}]'
190
+ http_version: !!null
191
+ recorded_at: Mon, 09 Jan 2012 04:26:52 GMT
192
+ - request:
193
+ method: get
194
+ uri: https://api.github.com/teams/127491
195
+ body: ''
196
+ headers:
197
+ Authorization:
198
+ - <AUTH FILTERED>
199
+ Accept:
200
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
201
+ text/plain
202
+ response:
203
+ status:
204
+ code: 200
205
+ message: !!null
206
+ headers:
207
+ server:
208
+ - nginx/1.0.4
209
+ date:
210
+ - Mon, 09 Jan 2012 04:26:54 GMT
211
+ content-type:
212
+ - application/json; charset=utf-8
213
+ transfer-encoding:
214
+ - chunked
215
+ connection:
216
+ - close
217
+ status:
218
+ - 200 OK
219
+ x-ratelimit-limit:
220
+ - '5000'
221
+ etag:
222
+ - ! '"028df71b90485d72587c23be1161baed"'
223
+ x-oauth-scopes:
224
+ - repo
225
+ x-ratelimit-remaining:
226
+ - '4956'
227
+ x-accepted-oauth-scopes:
228
+ - repo
229
+ body: ! '{"repos_count":0,"permission":"pull","name":"Leadlight Test Team","members_count":1,"url":"https://api.github.com/teams/127491","id":127491}'
230
+ http_version: !!null
231
+ recorded_at: Mon, 09 Jan 2012 04:26:53 GMT
232
+ - request:
233
+ method: put
234
+ uri: https://api.github.com/teams/127491/members/leadlight-test
235
+ body: ''
236
+ headers:
237
+ Authorization:
238
+ - <AUTH FILTERED>
239
+ Accept:
240
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
241
+ text/plain
242
+ response:
243
+ status:
244
+ code: 204
245
+ message: !!null
246
+ headers:
247
+ server:
248
+ - nginx/1.0.4
249
+ date:
250
+ - Mon, 09 Jan 2012 04:26:55 GMT
251
+ connection:
252
+ - close
253
+ status:
254
+ - 204 No Content
255
+ x-ratelimit-limit:
256
+ - '5000'
257
+ etag:
258
+ - ! '"d41d8cd98f00b204e9800998ecf8427e"'
259
+ x-oauth-scopes:
260
+ - repo
261
+ x-ratelimit-remaining:
262
+ - '4955'
263
+ x-accepted-oauth-scopes:
264
+ - repo
265
+ body: ''
266
+ http_version: !!null
267
+ recorded_at: Mon, 09 Jan 2012 04:26:53 GMT
268
+ - request:
269
+ method: get
270
+ uri: https://api.github.com/teams/127491/members
271
+ body: ''
272
+ headers:
273
+ Authorization:
274
+ - <AUTH FILTERED>
275
+ Accept:
276
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
277
+ text/plain
278
+ response:
279
+ status:
280
+ code: 200
281
+ message: !!null
282
+ headers:
283
+ server:
284
+ - nginx/1.0.4
285
+ date:
286
+ - Mon, 09 Jan 2012 04:26:55 GMT
287
+ content-type:
288
+ - application/json; charset=utf-8
289
+ transfer-encoding:
290
+ - chunked
291
+ connection:
292
+ - close
293
+ status:
294
+ - 200 OK
295
+ x-ratelimit-limit:
296
+ - '5000'
297
+ etag:
298
+ - ! '"584015087edc658ced2457c05965827a"'
299
+ x-oauth-scopes:
300
+ - repo
301
+ x-ratelimit-remaining:
302
+ - '4954'
303
+ x-accepted-oauth-scopes:
304
+ - repo
305
+ body: ! '[{"gravatar_id":"71a3f4f0d28bcb9c10fe96bbfce8fef8","login":"leadlight-test","avatar_url":"https://secure.gravatar.com/avatar/71a3f4f0d28bcb9c10fe96bbfce8fef8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/leadlight-test","id":1314019}]'
306
+ http_version: !!null
307
+ recorded_at: Mon, 09 Jan 2012 04:26:53 GMT
308
+ - request:
309
+ method: delete
310
+ uri: https://api.github.com/teams/127491/members/leadlight-test
311
+ body: ''
312
+ headers:
313
+ Authorization:
314
+ - <AUTH FILTERED>
315
+ Accept:
316
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
317
+ text/plain
318
+ response:
319
+ status:
320
+ code: 204
321
+ message: !!null
322
+ headers:
323
+ server:
324
+ - nginx/1.0.4
325
+ date:
326
+ - Mon, 09 Jan 2012 04:29:59 GMT
327
+ connection:
328
+ - close
329
+ status:
330
+ - 204 No Content
331
+ x-ratelimit-limit:
332
+ - '5000'
333
+ etag:
334
+ - ! '"d41d8cd98f00b204e9800998ecf8427e"'
335
+ x-oauth-scopes:
336
+ - repo
337
+ x-ratelimit-remaining:
338
+ - '4953'
339
+ x-accepted-oauth-scopes:
340
+ - repo
341
+ body: ''
342
+ http_version: !!null
343
+ recorded_at: Mon, 09 Jan 2012 04:29:57 GMT
344
+ - request:
345
+ method: get
346
+ uri: https://api.github.com/teams/127491/members
347
+ body: ''
348
+ headers:
349
+ Authorization:
350
+ - <AUTH FILTERED>
351
+ Accept:
352
+ - application/json, text/x-yaml, application/xml, application/xhtml+xml, text/html,
353
+ text/plain
354
+ response:
355
+ status:
356
+ code: 200
357
+ message: !!null
358
+ headers:
359
+ server:
360
+ - nginx/1.0.4
361
+ date:
362
+ - Mon, 09 Jan 2012 04:29:59 GMT
363
+ content-type:
364
+ - application/json; charset=utf-8
365
+ connection:
366
+ - close
367
+ status:
368
+ - 200 OK
369
+ x-ratelimit-limit:
370
+ - '5000'
371
+ etag:
372
+ - ! '"d751713988987e9331980363e24189ce"'
373
+ x-oauth-scopes:
374
+ - repo
375
+ x-ratelimit-remaining:
376
+ - '4952'
377
+ content-length:
378
+ - '2'
379
+ x-accepted-oauth-scopes:
380
+ - repo
381
+ body: ! '[]'
382
+ http_version: !!null
383
+ recorded_at: Mon, 09 Jan 2012 04:29:57 GMT
384
+ recorded_with: VCR 2.0.0.rc1