teamsnap_rb 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fc076a15bd112473e0614984bbb5fab2d6cd12c
4
- data.tar.gz: ce09d08b1ae9a0587bfd4e4542db3f653e6e6f82
3
+ metadata.gz: df029d3200aa07846692d44230168501d7c9c7eb
4
+ data.tar.gz: 51cb3ac850a1daa124959294e9377eafd82292b4
5
5
  SHA512:
6
- metadata.gz: 204df58528420a02bc864a07f2bfe873eb117b1288ff8420f7450b40b8e1d7d7219cd0d1a1415771c759f42211eb76a65bda2d6946f76e258ca2381f482b449c
7
- data.tar.gz: 607c9b05801b789360e617274239518d9b64cc30a1013df234e1e548134e47df74d381cfd11a5fdf8dc07669010f777fd8e21e0cdce70ca97b8492c366d86d1e
6
+ metadata.gz: 338292b6235fc69889ce56b16dcd9f20b07d03b016b57744b5fd994349bd306fea2979a3438cfce08ef49985bb3bf7b3d3734cb420a83cc30563f03caff44404
7
+ data.tar.gz: 2fb25427411b7189f4f53ebbcbe2a05e660ad1cc10ddf179363f491781481b7a5f2b35e83fab84e073f7b02f7a6a23d03b09ceacda66e26791ad270e3b22c9f3
@@ -1,3 +1,3 @@
1
1
  module TeamSnap
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
data/lib/teamsnap.rb CHANGED
@@ -154,7 +154,7 @@ module TeamSnap
154
154
  collection
155
155
  .fetch(:items) { [] }
156
156
  .map { |item|
157
- data = parse_data(item)
157
+ data = parse_data(item).merge(:href => item[:href])
158
158
  type = type_of(item)
159
159
  cls = load_class(type, data)
160
160
 
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:3000/members/search?id=1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.9.1
12
+ Authorization:
13
+ - Bearer 1-classic-dont_tell_the_cops
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Content-Type:
20
+ - application/vnd.collection+json
21
+ Content-Length:
22
+ - '7117'
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ X-RateLimit-Limit:
26
+ - '5000'
27
+ X-RateLimit-Remaining:
28
+ - '4998'
29
+ X-RateLimit-Reset:
30
+ - '1430163887'
31
+ ETag:
32
+ - '"6a9b73e7b710f8849d23b5bee9559a8f"'
33
+ Cache-Control:
34
+ - max-age=0, private, must-revalidate
35
+ X-Request-Id:
36
+ - 25c642aa-c947-400a-a784-81403c7b383d
37
+ X-Runtime:
38
+ - '0.050683'
39
+ Connection:
40
+ - keep-alive
41
+ Server:
42
+ - thin
43
+ body:
44
+ encoding: UTF-8
45
+ string: '{"collection":{"version":"3.60.0","href":"http://localhost:3000/members","template":{"data":[{"name":"first_name","value":null},{"name":"last_name","value":null},{"name":"gender","value":null},{"name":"position","value":null},{"name":"is_manager","value":null},{"name":"birthday","value":null},{"name":"hide_age","value":null},{"name":"hide_address","value":null},{"name":"is_non_player","value":null},{"name":"address_street1","value":null},{"name":"address_street2","value":null},{"name":"address_city","value":null},{"name":"address_state","value":null},{"name":"address_zip","value":null},{"name":"jersey_number","value":null},{"name":"team_id","value":null}]},"links":[{"rel":"assignments","href":"http://localhost:3000/assignments"},{"rel":"availabilities","href":"http://localhost:3000/availabilities"},{"rel":"broadcast_emails","href":"http://localhost:3000/broadcast_emails"},{"rel":"broadcast_smses","href":"http://localhost:3000/broadcast_smses"},{"rel":"contact_email_addresses","href":"http://localhost:3000/contact_email_addresses"},{"rel":"contact_phone_numbers","href":"http://localhost:3000/contact_phone_numbers"},{"rel":"contacts","href":"http://localhost:3000/contacts"},{"rel":"custom_data","href":"http://localhost:3000/custom_data"},{"rel":"custom_fields","href":"http://localhost:3000/custom_fields"},{"rel":"league_custom_data","href":"http://localhost:3000/league_custom_data"},{"rel":"league_custom_fields","href":"http://localhost:3000/league_custom_fields"},{"rel":"forum_posts","href":"http://localhost:3000/forum_posts"},{"rel":"forum_subscriptions","href":"http://localhost:3000/forum_subscriptions"},{"rel":"forum_topics","href":"http://localhost:3000/forum_topics"},{"rel":"league_registrant_documents","href":"http://localhost:3000/league_registrant_documents"},{"rel":"member_email_addresses","href":"http://localhost:3000/member_email_addresses"},{"rel":"member_files","href":"http://localhost:3000/member_files"},{"rel":"member_links","href":"http://localhost:3000/member_links"},{"rel":"member_payments","href":"http://localhost:3000/member_payments"},{"rel":"member_phone_numbers","href":"http://localhost:3000/member_phone_numbers"},{"rel":"member_preferences","href":"http://localhost:3000/members_preferences"},{"rel":"team","href":"http://localhost:3000/teams"},{"rel":"tracked_item_statuses","href":"http://localhost:3000/tracked_item_statuses"},{"rel":"user","href":"http://localhost:3000/users"},{"rel":"root","href":"http://localhost:3000/"},{"rel":"self","href":"http://localhost:3000/members/search?id=1"}],"queries":[{"rel":"search","href":"http://localhost:3000/members/search","data":[{"name":"team_id","value":null},{"name":"user_id","value":null},{"name":"id","value":null}]},{"rel":"managers","href":"http://localhost:3000/members/managers","data":[{"name":"team_id","value":null}]},{"rel":"owner","href":"http://localhost:3000/members/owner","data":[{"name":"team_id","value":null}]}],"commands":[{"rel":"disable_member","href":"http://localhost:3000/members/disable_member","data":[{"name":"member_id","value":null}]},{"rel":"upload_member_photo","href":"http://localhost:3000/members/upload_member_photo","data":[{"name":"member_id","value":null},{"name":"file","value":null},{"name":"x","value":null},{"name":"y","value":null},{"name":"width","value":null},{"name":"height","value":null}]},{"rel":"remove_member_photo","href":"http://localhost:3000/members/remove_member_photo","data":[{"name":"member_id","value":null}]},{"rel":"generate_member_thumbnail","href":"http://localhost:3000/members/generate_member_thumbnail","data":[{"name":"member_id","value":null},{"name":"x","value":null},{"name":"y","value":null},{"name":"width","value":null},{"name":"height","value":null}]}],"items":[{"href":"http://localhost:3000/members/1","data":[{"name":"id","value":1},{"name":"type","value":"member"},{"name":"address_city","value":null},{"name":"address_state","value":null},{"name":"address_street1","value":null},{"name":"address_street2","value":null},{"name":"address_zip","value":null},{"name":"birthday","value":""},{"name":"first_name","value":"Manny"},{"name":"gender","value":null},{"name":"hide_address","value":null},{"name":"hide_age","value":null},{"name":"invitation_code","value":null},{"name":"invitation_declined","value":null},{"name":"is_activated","value":true},{"name":"is_invitable","value":false},{"name":"is_invited","value":false},{"name":"is_manager","value":true},{"name":"is_non_player","value":false},{"name":"is_owner","value":false},{"name":"is_ownership_pending","value":null},{"name":"jersey_number","value":null},{"name":"last_logged_in_at","value":null,"type":"DateTime"},{"name":"last_name","value":"Manager"},{"name":"position","value":null},{"name":"team_id","value":1},{"name":"user_id","value":6},{"name":"updated_at","value":"2015-04-23T15:30:29Z","type":"DateTime"},{"name":"created_at","value":"2015-04-23T15:30:29Z","type":"DateTime"}],"links":[{"rel":"assignments","href":"http://localhost:3000/assignments/search?member_id=1"},{"rel":"availabilities","href":"http://localhost:3000/availabilities/search?member_id=1"},{"rel":"broadcast_emails","href":"http://localhost:3000/broadcast_emails/search?member_id=1"},{"rel":"broadcast_smses","href":"http://localhost:3000/broadcast_smses/search?member_id=1"},{"rel":"contact_email_addresses","href":"http://localhost:3000/contact_email_addresses/search?member_id=1"},{"rel":"contact_phone_numbers","href":"http://localhost:3000/contact_phone_numbers/search?member_id=1"},{"rel":"contacts","href":"http://localhost:3000/contacts/search?member_id=1"},{"rel":"custom_data","href":"http://localhost:3000/custom_data/search?member_id=1"},{"rel":"custom_fields","href":"http://localhost:3000/custom_fields/search?team_id=1"},{"rel":"league_custom_data","href":"http://localhost:3000/league_custom_data/search?member_id=1"},{"rel":"league_custom_fields","href":"http://localhost:3000/league_custom_fields/search?team_id=1"},{"rel":"forum_posts","href":"http://localhost:3000/forum_posts/search?member_id=1"},{"rel":"forum_subscriptions","href":"http://localhost:3000/forum_subscriptions/search?member_id=1"},{"rel":"forum_topics","href":"http://localhost:3000/forum_topics/search?team_id=1"},{"rel":"league_registrant_documents","href":"http://localhost:3000/league_registrant_documents/search?member_id=1"},{"rel":"member_email_addresses","href":"http://localhost:3000/member_email_addresses/search?member_id=1"},{"rel":"member_files","href":"http://localhost:3000/member_files/search?member_id=1"},{"rel":"member_links","href":"http://localhost:3000/member_links/search?member_id=1"},{"rel":"member_payments","href":"http://localhost:3000/member_payments/search?member_id=1"},{"rel":"member_phone_numbers","href":"http://localhost:3000/member_phone_numbers/search?member_id=1"},{"rel":"member_preferences","href":"http://localhost:3000/members_preferences/1"},{"rel":"team","href":"http://localhost:3000/teams/1"},{"rel":"tracked_item_statuses","href":"http://localhost:3000/tracked_item_statuses/search?member_id=1"},{"rel":"user","href":"http://localhost:3000/users/6"}]}]}}'
46
+ http_version: '1.1'
47
+ adapter_metadata:
48
+ effective_url: http://localhost:3000/members/search?id=1
49
+ recorded_at: Mon, 27 Apr 2015 18:55:43 GMT
50
+ recorded_with: VCR 2.9.3
@@ -125,4 +125,10 @@ RSpec.describe "teamsnap_rb", :vcr => true do
125
125
  "You must include a team_id parameter"
126
126
  )
127
127
  end
128
+
129
+ it "adds href to items" do
130
+ m = TeamSnap::Member.find(1)
131
+
132
+ expect(m.href).to eq("http://localhost:3000/members/1")
133
+ end
128
134
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teamsnap_rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
@@ -154,6 +154,7 @@ files:
154
154
  - lib/teamsnap/version.rb
155
155
  - spec/cassettes/apiv3-init.yml
156
156
  - spec/cassettes/teamsnap_rb/adds_find_if_search_is_available.yml
157
+ - spec/cassettes/teamsnap_rb/adds_href_to_items.yml
157
158
  - spec/cassettes/teamsnap_rb/can_follow_plural_links.yml
158
159
  - spec/cassettes/teamsnap_rb/can_follow_singular_links.yml
159
160
  - spec/cassettes/teamsnap_rb/can_handle_an_empty_bulk_load.yml
@@ -195,6 +196,7 @@ summary: A gem to interact with TeamSnap's API
195
196
  test_files:
196
197
  - spec/cassettes/apiv3-init.yml
197
198
  - spec/cassettes/teamsnap_rb/adds_find_if_search_is_available.yml
199
+ - spec/cassettes/teamsnap_rb/adds_href_to_items.yml
198
200
  - spec/cassettes/teamsnap_rb/can_follow_plural_links.yml
199
201
  - spec/cassettes/teamsnap_rb/can_follow_singular_links.yml
200
202
  - spec/cassettes/teamsnap_rb/can_handle_an_empty_bulk_load.yml