jnewland-fireeagle 0.7.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,60 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "FireEagle Location" do
4
+
5
+ before(:each) do
6
+ location = Hpricot.XML(XML_LOCATION_CHUNK)
7
+ @location = FireEagle::Location.new(location)
8
+ end
9
+
10
+ it "should know if this is a best guess" do
11
+ @location.should_not be_best_guess
12
+ end
13
+
14
+ it "should represent the level" do
15
+ @location.level.should == 3
16
+ end
17
+
18
+ it "should represent the level name" do
19
+ @location.level_name.should == 'city'
20
+ end
21
+
22
+ it "should represent the location name" do
23
+ @location.name.should == 'Davis, CA'
24
+ end
25
+
26
+ it "should represent the location place id" do
27
+ @location.place_id.should == 'u4L9ZOObApTdx1q3'
28
+ end
29
+
30
+ it "should represent the location's timestamp" do
31
+ @location.located_at.should == Time.parse("2008-01-22T14:23:11-08:00")
32
+ end
33
+
34
+ it "should use the name for #to_s" do
35
+ @location.to_s.should == @location.name
36
+ end
37
+
38
+ describe "GeoRuby support" do
39
+
40
+ it "should represent a bounding box as a GeoRuby Envelope" do
41
+ location = Hpricot.XML(XML_LOCATION_CHUNK)
42
+ @location = FireEagle::Location.new(location)
43
+ @location.geom.should be_an_instance_of(GeoRuby::SimpleFeatures::Envelope)
44
+ end
45
+
46
+ it "should represent an exact point as a GeoRuby Point" do
47
+ location = Hpricot.XML(XML_EXACT_LOCATION_CHUNK)
48
+ @location = FireEagle::Location.new(location)
49
+ @location.geom.should be_an_instance_of(GeoRuby::SimpleFeatures::Point)
50
+ end
51
+
52
+ it "should be aliased as 'geo'" do
53
+ location = Hpricot.XML(XML_EXACT_LOCATION_CHUNK)
54
+ @location = FireEagle::Location.new(location)
55
+ @location.geo.should be_an_instance_of(GeoRuby::SimpleFeatures::Point)
56
+ end
57
+
58
+ end
59
+
60
+ end
@@ -0,0 +1,65 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "FireEagle Response" do
4
+
5
+ describe "user / location parsing" do
6
+
7
+ before(:each) do
8
+ @response = FireEagle::Response.new(XML_LOCATION_RESPONSE)
9
+ end
10
+
11
+ it "should indicate success" do
12
+ @response.should be_success
13
+ end
14
+
15
+ it "should have an array of users" do
16
+ @response.should have(1).users
17
+ end
18
+
19
+ it "should have each users' token" do
20
+ @response.users.first.token.should == "16w3z6ysudxt"
21
+ end
22
+
23
+ it "should flag the best guess" do
24
+ @response.users.first.best_guess.name.should == "Yolo County, California"
25
+ end
26
+
27
+ it "should have users' locations" do
28
+ @response.users.first.should have(4).locations
29
+ end
30
+
31
+ end
32
+
33
+ describe "location parsing" do
34
+
35
+ before(:each) do
36
+ @response = FireEagle::Response.new(XML_LOOKUP_RESPONSE)
37
+ end
38
+
39
+ it "should indicate success" do
40
+ @response.should be_success
41
+ end
42
+
43
+ it "should have an array of locations" do
44
+ @response.should have(9).locations
45
+ end
46
+
47
+ it "should have each location's place_id" do
48
+ @response.locations.first.place_id.should == "IrhZMHuYA5s1fFi4Qw"
49
+ end
50
+
51
+ it "should have each location's name" do
52
+ @response.locations.first.name.should == "Alpharetta, GA 30022"
53
+ end
54
+
55
+ end
56
+
57
+ describe "error handling" do
58
+
59
+ it "should raise an exception when returned xml with a status of fail" do
60
+ lambda { FireEagle::Response.new(XML_ERROR_RESPONSE) }.should raise_error(FireEagle::FireEagleException)
61
+ end
62
+
63
+ end
64
+
65
+ end
@@ -0,0 +1,190 @@
1
+ require File.dirname(__FILE__) + '/spec_helper.rb'
2
+
3
+ describe "FireEagle" do
4
+
5
+ describe "being initialized" do
6
+
7
+ it "should require OAuth Consumer Key and Secret" do
8
+ lambda do
9
+ client = FireEagle::Client.new({})
10
+ end.should raise_error(FireEagle::ArgumentError)
11
+ end
12
+
13
+ it "should initialize an OAuth::Consumer" do
14
+ @consumer = mock(OAuth::Consumer)
15
+ OAuth::Consumer.should_receive(:new).with('key', 'sekret', :site => FireEagle::API_SERVER, :authorize_url => FireEagle::AUTHORIZATION_URL).and_return(@consumer)
16
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
17
+ end
18
+
19
+ end
20
+
21
+ describe "web app authentication scenario" do
22
+
23
+ it "should initialize an OAuth::AccessToken if given its token and secret" do
24
+ @access_token = mock(OAuth::AccessToken)
25
+ OAuth::AccessToken.stub!(:new).and_return(@access_token)
26
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :access_token => 'toke', :access_token_secret => 'sekret')
27
+ client.access_token.should == @access_token
28
+ end
29
+
30
+ it "should initialize an OAuth::RequestToken if given its token and secret" do
31
+ @request_token = mock(OAuth::RequestToken)
32
+ OAuth::RequestToken.stub!(:new).and_return(@request_token)
33
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :request_token => 'toke', :request_token_secret => 'sekret')
34
+ client.request_token.should == @request_token
35
+ end
36
+ end
37
+
38
+ describe "request token scenario" do
39
+ it "shouldn't initialize with a access_token" do
40
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
41
+ client.access_token.should be_nil
42
+ end
43
+
44
+ it "should require token exchange before calling any API methods" do
45
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
46
+ lambda do
47
+ client.user
48
+ end.should raise_error(FireEagle::ArgumentError)
49
+ end
50
+
51
+ it "should generate a Request Token URL" do
52
+ consumer = mock(OAuth::Consumer)
53
+ token = mock(OAuth::RequestToken)
54
+ consumer.should_receive(:get_request_token).and_return(token)
55
+ token.should_receive(:authorize_url)
56
+
57
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
58
+ client.should_receive(:consumer).and_return(consumer)
59
+ client.get_request_token
60
+ client.authorization_url
61
+ end
62
+
63
+ it "should require #get_request_token be called before #convert_to_access_token" do
64
+ lambda do
65
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
66
+ client.convert_to_access_token
67
+ end.should raise_error(FireEagle::ArgumentError)
68
+ end
69
+
70
+ it "should require #get_request_token be called before #authorization_url" do
71
+ lambda do
72
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
73
+ client.authorization_url
74
+ end.should raise_error(FireEagle::ArgumentError)
75
+ end
76
+
77
+ it "should generate an Access Token" do
78
+ consumer = mock(OAuth::Consumer)
79
+ req_token = mock(OAuth::RequestToken)
80
+ acc_token = mock(OAuth::AccessToken)
81
+ consumer.should_receive(:get_request_token).and_return(req_token)
82
+ req_token.should_receive(:get_access_token).and_return(acc_token)
83
+
84
+ client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret')
85
+ client.should_receive(:consumer).and_return(consumer)
86
+
87
+ client.get_request_token
88
+ client.convert_to_access_token
89
+ client.access_token.should == acc_token
90
+ end
91
+
92
+ end
93
+
94
+ describe "update method" do
95
+
96
+ before(:each) do
97
+ @client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :access_token => 'toke', :access_token_secret => 'sekret')
98
+ @response = stub('response', :body => XML_SUCCESS_RESPONSE)
99
+ @client.stub!(:request).and_return(@response)
100
+ end
101
+
102
+ it "requires all or none of :lat, :lon" do
103
+ lambda { @client.update(:lat => 1) }.should raise_error(FireEagle::ArgumentError)
104
+ lambda { @client.update(:lat => 1, :lon => 2) }.should_not raise_error(FireEagle::ArgumentError)
105
+ end
106
+
107
+ it "requires all or none of :mnc, :mcc, :lac, :cellid" do
108
+ lambda { @client.update(:mcc => 123, :lac => "whatever", :cellid => true) }.should raise_error(FireEagle::ArgumentError)
109
+ lambda { @client.update(:mcc => 123, :mnc => 123123, :lac => "whatever", :cellid => true) }.should_not raise_error(FireEagle::ArgumentError)
110
+ end
111
+
112
+ it "should wrap the result" do
113
+ @client.update(:mcc => 123, :mnc => 123123, :lac => "whatever", :cellid => true).users.first.token.should == "16w3z6ysudxt"
114
+ end
115
+
116
+ end
117
+
118
+ describe "user method" do
119
+
120
+ before(:each) do
121
+ @client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :access_token => 'toke', :access_token_secret => 'sekret')
122
+ response = stub('response', :body => XML_LOCATION_RESPONSE)
123
+ @client.stub!(:request).and_return(response)
124
+ end
125
+
126
+ it "should return a best guess" do
127
+ @client.user.best_guess.name.should == "Yolo County, California"
128
+ end
129
+
130
+ it "should return several locations" do
131
+ @client.user.should have(4).locations
132
+ end
133
+
134
+ end
135
+
136
+ describe "lookup method" do
137
+
138
+ before(:each) do
139
+ @client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :access_token => 'toke', :access_token_secret => 'sekret')
140
+ @response = stub('response', :body => XML_LOOKUP_RESPONSE)
141
+ @client.stub!(:request).and_return(@response)
142
+ end
143
+
144
+ it "should return an array of Locations" do
145
+ @client.lookup(:q => "30022").should have(9).items
146
+ end
147
+
148
+ it "should return a place id for each" do
149
+ @client.lookup(:q => "30022").first.place_id.should == "IrhZMHuYA5s1fFi4Qw"
150
+ end
151
+
152
+ it "should return a name for each" do
153
+ @client.lookup(:q => "30022").first.name.should == "Alpharetta, GA 30022"
154
+ end
155
+
156
+ end
157
+
158
+ describe "within method" do
159
+ before do
160
+ @client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :access_token => 'toke', :access_token_secret => 'sekret')
161
+ @response = stub('response', :body => XML_WITHIN_RESPONSE)
162
+ @client.stub!(:request).and_return(@response)
163
+ end
164
+
165
+ it "should return an array of Users" do
166
+ @client.within(:woe => "12796255").should have(2).users
167
+ end
168
+
169
+ it "should return an array of Locations for each" do
170
+ @client.within(:woe => "12796255").first.should have(5).locations
171
+ end
172
+ end
173
+
174
+ describe "recent method" do
175
+ before do
176
+ @client = FireEagle::Client.new(:consumer_key => 'key', :consumer_secret => 'sekret', :access_token => 'toke', :access_token_secret => 'sekret')
177
+ @response = stub('response', :body => XML_RECENT_RESPONSE)
178
+ @client.stub!(:request).and_return(@response)
179
+ end
180
+
181
+ it "should return an array of Users" do
182
+ @client.recent(2, 1, 'yesterday').should have(2).users
183
+ end
184
+
185
+ it "should return an array of Locations for each" do
186
+ @client.recent(2, 1, 'yesterday').first.should have(5).locations
187
+ end
188
+ end
189
+
190
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,359 @@
1
+ begin
2
+ require 'spec'
3
+ rescue LoadError
4
+ require 'rubygems'
5
+ gem 'rspec'
6
+ require 'spec'
7
+ end
8
+
9
+ XML_ERROR_RESPONSE = <<-RESPONSE
10
+ <?xml version="1.0" encoding="utf-8"?>
11
+ <rsp stat="fail">
12
+ <err code="11" msg="Something bad happened" />
13
+ </rsp>
14
+ RESPONSE
15
+
16
+ XML_LOCATION_RESPONSE = <<-RESPONSE
17
+ <?xml version="1.0" encoding="utf-8"?>
18
+ <rsp stat="ok" xmlns:georss="http://www.georss.org/georss">
19
+ <user token="16w3z6ysudxt">
20
+ <location-hierarchy>
21
+ <location best-guess="false">
22
+ <georss:box>38.5351715088 -121.7948684692 38.575668335 -121.6747894287</georss:box>
23
+ <level>3</level>
24
+ <level-name>city</level-name>
25
+ <located-at>2008-01-22T14:23:11-08:00</located-at>
26
+ <name>Davis, CA</name>
27
+ <place-id>u4L9ZOObApTdx1q3</place-id>
28
+ </location>
29
+ <location best-guess="true">
30
+ <georss:box>38.3131217957 -122.4230804443 38.9261016846 -121.5012969971</georss:box>
31
+ <level>4</level>
32
+ <level-name>region</level-name>
33
+ <located-at>2008-01-22T18:45:26-08:00</located-at>
34
+ <name>Yolo County, California</name>
35
+ <place-id>YUYMh9CbBJ61mgFe</place-id>
36
+ </location>
37
+ <location best-guess="false">
38
+ <georss:box>32.5342788696 -124.4150238037 42.0093803406 -114.1308135986</georss:box>
39
+ <level>5</level>
40
+ <level-name>state</level-name>
41
+ <located-at>2008-01-22T18:45:26-08:00</located-at>
42
+ <name>California</name>
43
+ <place-id>SVrAMtCbAphCLAtP</place-id>
44
+ </location>
45
+ <location best-guess="false">
46
+ <georss:box>18.9108390808 -167.2764129639 72.8960571289 -66.6879425049</georss:box>
47
+ <level>6</level>
48
+ <level-name>country</level-name>
49
+ <located-at>2008-01-22T18:45:26-08:00</located-at>
50
+ <name>United States</name>
51
+ <place-id>4KO02SibApitvSBieQ</place-id>
52
+ </location>
53
+ </location-hierarchy>
54
+ </user>
55
+ </rsp>
56
+ RESPONSE
57
+
58
+ XML_SUCCESS_RESPONSE = <<-RESPONSE
59
+ <?xml version="1.0" encoding="utf-8"?>
60
+ <rsp stat="ok">
61
+ <user token="16w3z6ysudxt"/>
62
+ </rsp>
63
+ RESPONSE
64
+
65
+ XML_LOCATION_CHUNK = <<-RESPONSE
66
+ <location best-guess="false">
67
+ <georss:box>38.5351715088 -121.7948684692 38.575668335 -121.6747894287</georss:box>
68
+ <level>3</level>
69
+ <level-name>city</level-name>
70
+ <located-at>2008-01-22T14:23:11-08:00</located-at>
71
+ <name>Davis, CA</name>
72
+ <place-id>u4L9ZOObApTdx1q3</place-id>
73
+ </location>
74
+ RESPONSE
75
+
76
+ XML_EXACT_LOCATION_CHUNK = <<-RESPONSE
77
+ <location>
78
+ <georss:point>38.5351715088 -121.7948684692</georss:box>
79
+ </location>
80
+ RESPONSE
81
+
82
+ XML_LOOKUP_RESPONSE = <<-RESPONSE
83
+ <?xml version="1.0" encoding="UTF-8"?>
84
+ <rsp stat="ok">
85
+ <querystring>q=30022</querystring>
86
+ <locations start="0" total="9" count="9">
87
+ <location>
88
+ <name>Alpharetta, GA 30022</name>
89
+ <place-id>IrhZMHuYA5s1fFi4Qw</place-id>
90
+ </location>
91
+ <location>
92
+ <name>Hannover, Region Hannover, Deutschland</name>
93
+ <place-id>88Hctc2bBZlhvlwbUg</place-id>
94
+ </location>
95
+ <location>
96
+ <name>N&#238;mes, Gard, France</name>
97
+ <place-id>Sut8q82bBZkF0s1eTg</place-id>
98
+ </location>
99
+ <location>
100
+ <name>Ceggia, Venezia, Italia</name>
101
+ <place-id>s9ulRieYA5TkNK9otw</place-id>
102
+ </location>
103
+ <location>
104
+ <name>Comit&#225;n de Dom&#237;nguez, Comitan de Dominguez, M&#233;xico</name>
105
+ <place-id>.51HvYKbBZnSAeNHWw</place-id>
106
+ </location>
107
+ <location>
108
+ <name>Platanos Aitoloakarnanias, Etolia Kai Akarnania, Greece</name>
109
+ <place-id>CmfJ2H.YA5QKpS56HQ</place-id>
110
+ </location>
111
+ <location>
112
+ <name>Krak&#243;w, Krak&#243;w, Polska</name>
113
+ <place-id>9bYc0l.bA5vPTGscQg</place-id>
114
+ </location>
115
+ <location>
116
+ <name>Nakuru, Kenya</name>
117
+ <place-id>VDprypWYA5sujnZphA</place-id>
118
+ </location>
119
+ <location>
120
+ <name>Fez, Al Magreb</name>
121
+ <place-id>BxOaGgSYA5R40Nm1RA</place-id>
122
+ </location>
123
+ </locations>
124
+ </rsp>
125
+ RESPONSE
126
+
127
+ XML_WITHIN_RESPONSE = <<-RESPONSE
128
+ <?xml version="1.0" encoding="UTF-8"?>
129
+ <rsp stat="ok">
130
+ <users>
131
+ <user token="MQdDrJgXMNJi">
132
+ <location-hierarchy>
133
+ <location best-guess="true">
134
+ <id>111541</id>
135
+ <georss:point>32.7093315125 -117.1650772095</georss:point>
136
+ <level>0</level>
137
+ <level-name>exact</level-name>
138
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
139
+ <name>333 W Harbor Dr, San Diego, CA</name>
140
+ </location>
141
+ <location best-guess="false">
142
+ <id>111551</id>
143
+ <georss:box>
144
+ 32.6916618347 -117.2174377441 32.744140625 -117.1458892822
145
+ </georss:box>
146
+ <level>1</level>
147
+ <level-name>postal</level-name>
148
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
149
+ <name>San Diego, CA 92101</name>
150
+ <place-id>NpiXqwmYA5viX3K3Ew</place-id>
151
+ <woeid>12796255</woeid>
152
+ </location>
153
+ <location best-guess="false">
154
+ <id>111561</id>
155
+ <georss:box>
156
+ 32.5349388123 -117.2884292603 33.1128082275 -116.9142913818
157
+ </georss:box>
158
+ <level>3</level>
159
+ <level-name>city</level-name>
160
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
161
+ <name>San Diego, CA</name>
162
+ <place-id>Nm4O.DebBZTYKUsu</place-id>
163
+ <woeid>2487889</woeid>
164
+ </location>
165
+ <location best-guess="false">
166
+ <id>111571</id>
167
+ <georss:box>
168
+ 32.5342788696 -124.4150238037 42.0093803406 -114.1308135986
169
+ </georss:box>
170
+ <level>5</level>
171
+ <level-name>state</level-name>
172
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
173
+ <name>California</name>
174
+ <place-id>SVrAMtCbAphCLAtP</place-id>
175
+ <woeid>2347563</woeid>
176
+ </location>
177
+ <location best-guess="false">
178
+ <id>111581</id>
179
+ <georss:box>
180
+ 18.9108390808 -167.2764129639 72.8960571289 -66.6879425049
181
+ </georss:box>
182
+ <level>6</level>
183
+ <level-name>country</level-name>
184
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
185
+ <name>United States</name>
186
+ <place-id>4KO02SibApitvSBieQ</place-id>
187
+ <woeid>23424977</woeid>
188
+ </location>
189
+ </location-hierarchy>
190
+ </user>
191
+ <user token="MQdDrJgXMNJi">
192
+ <location-hierarchy>
193
+ <location best-guess="true">
194
+ <id>111541</id>
195
+ <georss:point>32.7093315125 -117.1650772095</georss:point>
196
+ <level>0</level>
197
+ <level-name>exact</level-name>
198
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
199
+ <name>333 W Harbor Dr, San Diego, CA</name>
200
+ </location>
201
+ <location best-guess="false">
202
+ <id>111551</id>
203
+ <georss:box>
204
+ 32.6916618347 -117.2174377441 32.744140625 -117.1458892822
205
+ </georss:box>
206
+ <level>1</level>
207
+ <level-name>postal</level-name>
208
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
209
+ <name>San Diego, CA 92101</name>
210
+ <place-id>NpiXqwmYA5viX3K3Ew</place-id>
211
+ <woeid>12796255</woeid>
212
+ </location>
213
+ <location best-guess="false">
214
+ <id>111561</id>
215
+ <georss:box>
216
+ 32.5349388123 -117.2884292603 33.1128082275 -116.9142913818
217
+ </georss:box>
218
+ <level>3</level>
219
+ <level-name>city</level-name>
220
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
221
+ <name>San Diego, CA</name>
222
+ <place-id>Nm4O.DebBZTYKUsu</place-id>
223
+ <woeid>2487889</woeid>
224
+ </location>
225
+ <location best-guess="false">
226
+ <id>111571</id>
227
+ <georss:box>
228
+ 32.5342788696 -124.4150238037 42.0093803406 -114.1308135986
229
+ </georss:box>
230
+ <level>5</level>
231
+ <level-name>state</level-name>
232
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
233
+ <name>California</name>
234
+ <place-id>SVrAMtCbAphCLAtP</place-id>
235
+ <woeid>2347563</woeid>
236
+ </location>
237
+ <location best-guess="false">
238
+ <id>111581</id>
239
+ <georss:box>
240
+ 18.9108390808 -167.2764129639 72.8960571289 -66.6879425049
241
+ </georss:box>
242
+ <level>6</level>
243
+ <level-name>country</level-name>
244
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
245
+ <name>United States</name>
246
+ <place-id>4KO02SibApitvSBieQ</place-id>
247
+ <woeid>23424977</woeid>
248
+ </location>
249
+ </location-hierarchy>
250
+ </user>
251
+ </users>
252
+ </rsp>
253
+ RESPONSE
254
+
255
+ XML_RECENT_RESPONSE = <<-RESPONSE
256
+ <?xml version="1.0" encoding="UTF-8"?>
257
+ <rsp stat="ok" xmlns:georss="http://www.georss.org/georss">
258
+ <users>
259
+ <user token="MQdDrJgXMNJi">
260
+ <location-hierarchy>
261
+ <location best-guess="true">
262
+ <id>111541</id>
263
+ <georss:point>32.7093315125 -117.1650772095</georss:point>
264
+ <level>0</level>
265
+ <level-name>exact</level-name>
266
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
267
+ <name>333 W Harbor Dr, San Diego, CA</name>
268
+ </location>
269
+ <location best-guess="false">
270
+ <id>111551</id>
271
+ <georss:box>32.6916618347 -117.2174377441 32.744140625 -117.1458892822</georss:box>
272
+ <level>1</level>
273
+ <level-name>postal</level-name>
274
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
275
+ <name>San Diego, CA 92101</name>
276
+ <place-id>NpiXqwmYA5viX3K3Ew</place-id>
277
+ <woeid>12796255</woeid>
278
+ </location>
279
+ <location best-guess="false">
280
+ <id>111561</id>
281
+ <georss:box>32.5349388123 -117.2884292603 33.1128082275 -116.9142913818</georss:box>
282
+ <level>3</level>
283
+ <level-name>city</level-name>
284
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
285
+ <name>San Diego, CA</name>
286
+ <place-id>Nm4O.DebBZTYKUsu</place-id>
287
+ <woeid>2487889</woeid>
288
+ </location>
289
+ <location best-guess="false">
290
+ <id>111571</id>
291
+ <georss:box>32.5342788696 -124.4150238037 42.0093803406 -114.1308135986</georss:box>
292
+ <level>5</level>
293
+ <level-name>state</level-name>
294
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
295
+ <name>California</name>
296
+ <place-id>SVrAMtCbAphCLAtP</place-id>
297
+ <woeid>2347563</woeid>
298
+ </location>
299
+ <location best-guess="false">
300
+ <id>111581</id>
301
+ <georss:box>18.9108390808 -167.2764129639 72.8960571289 -66.6879425049</georss:box>
302
+ <level>6</level>
303
+ <level-name>country</level-name>
304
+ <located-at>2008-03-03T09:05:16-08:00</located-at>
305
+ <name>United States</name>
306
+ <place-id>4KO02SibApitvSBieQ</place-id>
307
+ <woeid>23424977</woeid>
308
+ </location>
309
+ </location-hierarchy>
310
+ </user>
311
+ <user token="XMoZaTjZJiOQ">
312
+ <location-hierarchy>
313
+ <location best-guess="true">
314
+ <id>113221</id>
315
+ <georss:box>32.8155899048 -96.8162918091 32.8511695862 -96.7717132568</georss:box>
316
+ <level>1</level>
317
+ <level-name>postal</level-name>
318
+ <located-at>2008-03-03T10:24:24-08:00</located-at>
319
+ <name>Dallas, TX 75205</name>
320
+ <place-id>1KTPxFCYA5vlcics6A</place-id>
321
+ <woeid>12790441</woeid>
322
+ </location>
323
+ <location best-guess="false">
324
+ <id>113231</id>
325
+ <georss:box>32.6209487915 -96.9988708496 33.0258712769 -96.4660263062</georss:box>
326
+ <level>3</level>
327
+ <level-name>city</level-name>
328
+ <located-at>2008-03-03T10:24:24-08:00</located-at>
329
+ <name>Dallas, TX</name>
330
+ <place-id>bgWooz.bApRFBRNK</place-id>
331
+ <woeid>2388929</woeid>
332
+ </location>
333
+ <location best-guess="false">
334
+ <id>113241</id>
335
+ <georss:box>25.8372898102 -106.645652771 36.5006904602 -93.5079269409</georss:box>
336
+ <level>5</level>
337
+ <level-name>state</level-name>
338
+ <located-at>2008-03-03T10:24:24-08:00</located-at>
339
+ <name>Texas</name>
340
+ <place-id>b1Yi6qubApjz6jWW</place-id>
341
+ <woeid>2347602</woeid>
342
+ </location>
343
+ <location best-guess="false">
344
+ <id>113251</id>
345
+ <georss:box>18.9108390808 -167.2764129639 72.8960571289 -66.6879425049</georss:box>
346
+ <level>6</level>
347
+ <level-name>country</level-name>
348
+ <located-at>2008-03-03T10:24:24-08:00</located-at>
349
+ <name>United States</name>
350
+ <place-id>4KO02SibApitvSBieQ</place-id>
351
+ <woeid>23424977</woeid>
352
+ </location>
353
+ </location-hierarchy>
354
+ </user>
355
+ </users>
356
+ </rsp>
357
+ RESPONSE
358
+
359
+ require File.dirname(__FILE__) + '/../lib/fireeagle'
@@ -0,0 +1,7 @@
1
+ task :ruby_env do
2
+ RUBY_APP = if RUBY_PLATFORM =~ /java/
3
+ "jruby"
4
+ else
5
+ "ruby"
6
+ end unless defined? RUBY_APP
7
+ end