snafu 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.textile +5 -0
- data/lib/snafu/models/hub.rb +1 -1
- data/lib/snafu/version.rb +1 -1
- data/snafu.gemspec +2 -2
- data/spec/fixtures/vcr_cassettes/Snafu_Locations/get_hub_should_return_an_array_of_valid_street_information_if_given_a_valid_Hub_ID.yml +39 -0
- data/spec/snafu/locations_spec.rb +6 -0
- metadata +19 -16
data/CHANGELOG.textile
ADDED
data/lib/snafu/models/hub.rb
CHANGED
@@ -15,7 +15,7 @@ module Snafu
|
|
15
15
|
@name = options["name"]
|
16
16
|
@streets = []
|
17
17
|
options["streets"].each do |street_id, street|
|
18
|
-
@streets << {:id => street_id, :name => street[
|
18
|
+
@streets << {:id => street_id, :name => street["name"]}
|
19
19
|
end
|
20
20
|
else
|
21
21
|
@id = options[:id]
|
data/lib/snafu/version.rb
CHANGED
data/snafu.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.email = ["jeff@jkbrowning.com"]
|
11
11
|
s.homepage = "https://github.com/jbrowning/snafu"
|
12
12
|
s.summary = %q{A library for the Glitch API}
|
13
|
-
s.description = %q{Snafu is an interface to
|
14
|
-
|
13
|
+
s.description = %q{Snafu is an interface to API for Glitch, an online multi-player
|
14
|
+
game created by Tiny Speck.}
|
15
15
|
|
16
16
|
s.required_ruby_version = '>= 1.9.2'
|
17
17
|
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/struct:VCR::HTTPInteraction
|
3
|
+
request: !ruby/struct:VCR::Request
|
4
|
+
method: :get
|
5
|
+
uri: http://api.glitch.com:80/simple/locations.getStreets?hub_id=27
|
6
|
+
body: !!null
|
7
|
+
headers: !!null
|
8
|
+
response: !ruby/struct:VCR::Response
|
9
|
+
status: !ruby/struct:VCR::ResponseStatus
|
10
|
+
code: 200
|
11
|
+
message: OK
|
12
|
+
headers:
|
13
|
+
access-control-allow-credentials:
|
14
|
+
- 'false'
|
15
|
+
access-control-allow-methods:
|
16
|
+
- POST, GET, OPTIONS
|
17
|
+
access-control-allow-origin:
|
18
|
+
- ! '*'
|
19
|
+
access-control-max-age:
|
20
|
+
- '1728000'
|
21
|
+
cache-control:
|
22
|
+
- no-cache="set-cookie"
|
23
|
+
content-type:
|
24
|
+
- text/plain; charset=utf-8
|
25
|
+
date:
|
26
|
+
- Sat, 03 Dec 2011 03:59:56 GMT
|
27
|
+
server:
|
28
|
+
- Apache/2.2.17
|
29
|
+
set-cookie:
|
30
|
+
- AWSELB=F7715B6B10BD5947A6E9DAE19D6F6DD7D91A271FB7B8FD96C58B401C3F3584E3DD5A789139D245B7D2205272CFBFFB3C3AC28CFB84FD157576285C68AFF419B0FB405C0DC5;PATH=/;MAX-AGE=600
|
31
|
+
content-length:
|
32
|
+
- '329'
|
33
|
+
connection:
|
34
|
+
- Close
|
35
|
+
body: ! '{"ok":1,"hub_id":"27","name":"Ix","streets":{"LM416LNIKVLM1":{"name":"Baby
|
36
|
+
Steppes"},"LM413SQ6LRN58":{"name":"East Spice"},"LM410QQ0CHARO":{"name":"Flipside"},"LM4115NJ46G8M":{"name":"Groddle
|
37
|
+
Ladder"},"LM4109NI2R640":{"name":"Guillermo Gamera Way"},"LM410TMR0S2S1":{"name":"Ruta
|
38
|
+
Asuncion"},"LM413RQ6LRG9N":{"name":"West Spice"}}}'
|
39
|
+
http_version: '1.1'
|
@@ -34,6 +34,12 @@ describe Snafu::Locations do
|
|
34
34
|
hub = @snafu.get_hub(@test_hub_id)
|
35
35
|
hub.name.should eql(@test_hub_name)
|
36
36
|
end
|
37
|
+
|
38
|
+
it "should return an array of valid street information if given a valid Hub ID", :vcr do
|
39
|
+
test_array = {:id => @test_street_id, :name => @test_street_name}
|
40
|
+
hub = @snafu.get_hub(@test_hub_id)
|
41
|
+
hub.streets.should include(test_array)
|
42
|
+
end
|
37
43
|
end
|
38
44
|
|
39
45
|
context "get_street" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snafu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-12-
|
12
|
+
date: 2011-12-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70226305981700 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70226305981700
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: guard-rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70226305980900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70226305980900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: vcr
|
38
|
-
requirement: &
|
38
|
+
requirement: &70226305980060 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70226305980060
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: fakeweb
|
49
|
-
requirement: &
|
49
|
+
requirement: &70226305979120 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70226305979120
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &70226305978600 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70226305978600
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: httparty
|
71
|
-
requirement: &
|
71
|
+
requirement: &70226305977020 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,9 +76,9 @@ dependencies:
|
|
76
76
|
version: '0.8'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
80
|
-
description: ! "Snafu is an interface to
|
81
|
-
game created by Tiny Speck."
|
79
|
+
version_requirements: *70226305977020
|
80
|
+
description: ! "Snafu is an interface to API for Glitch, an online multi-player\n
|
81
|
+
\ game created by Tiny Speck."
|
82
82
|
email:
|
83
83
|
- jeff@jkbrowning.com
|
84
84
|
executables: []
|
@@ -86,6 +86,7 @@ extensions: []
|
|
86
86
|
extra_rdoc_files: []
|
87
87
|
files:
|
88
88
|
- .gitignore
|
89
|
+
- CHANGELOG.textile
|
89
90
|
- Gemfile
|
90
91
|
- Guardfile
|
91
92
|
- LICENSE
|
@@ -110,6 +111,7 @@ files:
|
|
110
111
|
- spec/fixtures/vcr_cassettes/Snafu_Client/call_should_automatically_pass_in_the_oauth_token_if_called_with_true.yml
|
111
112
|
- spec/fixtures/vcr_cassettes/Snafu_Client/call_should_raise_a_GlitchAPIError_if_receiving_an_unsucessful_response_from_the_Glitch_API.yml
|
112
113
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hub_should_return_a_valid_hub_if_given_a_valid_Hub_ID.yml
|
114
|
+
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hub_should_return_an_array_of_valid_street_information_if_given_a_valid_Hub_ID.yml
|
113
115
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hubs_should_populated_the_returned_Hub_objects_with_an_id_and_name.yml
|
114
116
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hubs_should_return_an_array_of_Hub_objects.yml
|
115
117
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hubs_should_return_an_array_of_all_hubs.yml
|
@@ -161,6 +163,7 @@ test_files:
|
|
161
163
|
- spec/fixtures/vcr_cassettes/Snafu_Client/call_should_automatically_pass_in_the_oauth_token_if_called_with_true.yml
|
162
164
|
- spec/fixtures/vcr_cassettes/Snafu_Client/call_should_raise_a_GlitchAPIError_if_receiving_an_unsucessful_response_from_the_Glitch_API.yml
|
163
165
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hub_should_return_a_valid_hub_if_given_a_valid_Hub_ID.yml
|
166
|
+
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hub_should_return_an_array_of_valid_street_information_if_given_a_valid_Hub_ID.yml
|
164
167
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hubs_should_populated_the_returned_Hub_objects_with_an_id_and_name.yml
|
165
168
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hubs_should_return_an_array_of_Hub_objects.yml
|
166
169
|
- spec/fixtures/vcr_cassettes/Snafu_Locations/get_hubs_should_return_an_array_of_all_hubs.yml
|