fireeagle 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.6.1
2
+
3
+ * Remove 'not implemented' message
4
+ * Remove JSON requirement
5
+
1
6
  == 0.6.0
2
7
 
3
8
  * Complete rewrite
data/README.txt CHANGED
@@ -42,6 +42,10 @@ Authorization is handled by OAuth. For more details about the OAuth
42
42
  authorization flow and how it differs based on your application type, please
43
43
  see http://fireeagle.yahoo.net/developer/documentation/authorizing
44
44
 
45
+ == Contributing
46
+
47
+ http://github.com/jnewland/fireeagle/tree/master. You know what to do.
48
+
45
49
  Rubyforge Project Page:: http://rubyforge.org/projects/fireeagle
46
50
  Author:: Jesse Newland (http://soylentfoo.jnewland.com) (jnewland@gmail.com[mailto:jnewland@gmail.com])
47
51
  Copyright:: Copyright (c) 2008 Jesse Newland. Portions[http://pastie.caboo.se/private/oevvkdzl0zrdkf8s7hetg] Copyright (c) 2008 Yahoo!
data/config/hoe.rb CHANGED
@@ -58,7 +58,7 @@ hoe = Hoe.new(GEM_NAME, VERS) do |p|
58
58
 
59
59
  # == Optional
60
60
  p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
61
- p.extra_deps = [ ['oauth', '>= 0.2.1'], ['json', '>= 1.1.1'], ['hpricot', '>= 0.6'], ['GeoRuby', '>= 1.3.2'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
61
+ p.extra_deps = [ ['oauth', '>= 0.2.1'], ['hpricot', '>= 0.6'], ['GeoRuby', '>= 1.3.2'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
62
62
 
63
63
  #p.spec_extras = {} # A hash of extra values to set in the gemspec.
64
64
 
@@ -157,11 +157,7 @@ class FireEagle
157
157
 
158
158
  response = get(FireEagle::LOOKUP_API_PATH + ".#{format}", :params => params)
159
159
 
160
- if json?
161
- JSON.parse(response.body)
162
- else
163
- FireEagle::Response.new(response.body).locations
164
- end
160
+ FireEagle::Response.new(response.body).locations
165
161
  end
166
162
 
167
163
  # Sets a User's current Location using using a Place ID hash or a set of Location parameters. If the User
@@ -196,11 +192,7 @@ class FireEagle
196
192
 
197
193
  response = post(FireEagle::UPDATE_API_PATH + ".#{format}", :params => location)
198
194
 
199
- if json?
200
- JSON.parse(response.body)
201
- else
202
- FireEagle::Response.new(response.body)
203
- end
195
+ FireEagle::Response.new(response.body)
204
196
  end
205
197
 
206
198
  # Returns the Location of a User.
@@ -209,16 +201,10 @@ class FireEagle
209
201
 
210
202
  response = get(FireEagle::USER_API_PATH + ".#{format}")
211
203
 
212
- if json?
213
- JSON.parse(response.body)
214
- else
215
- FireEagle::Response.new(response.body).users.first
216
- end
204
+ FireEagle::Response.new(response.body).users.first
217
205
  end
218
206
  alias_method :location, :user
219
207
 
220
- # <b>NOTE: not implemented yet</b>
221
- #
222
208
  # Query for Users of an Application who have updated their Location recently. Returns a list of
223
209
  # Users for the Application with recently updated locations.
224
210
  def recent(count = 10, start = 0)
@@ -228,14 +214,9 @@ class FireEagle
228
214
 
229
215
  response = get(FireEagle::RECENT_API_PATH + ".#{format}", :params => params)
230
216
 
231
- if json?
232
- JSON.parse(response.body)
233
- else
234
- FireEagle::Response.new(response.body).users
235
- end
217
+ FireEagle::Response.new(response.body).users
236
218
  end
237
219
 
238
- # <b>NOTE: not implemented yet</b>
239
220
  # Takes a Place ID or a Location and returns a list of users of your application who are within the bounding box of that Location.
240
221
  #
241
222
  # Location Hash keys, in order of priority:
@@ -264,11 +245,7 @@ class FireEagle
264
245
 
265
246
  response = get(FireEagle::WITHIN_API_PATH + ".#{format}", :params => params)
266
247
 
267
- if json?
268
- JSON.parse(response.body)
269
- else
270
- FireEagle::Response.new(response.body).users
271
- end
248
+ FireEagle::Response.new(response.body).users
272
249
  end
273
250
 
274
251
  protected
@@ -288,10 +265,6 @@ class FireEagle
288
265
  format == FireEagle::FORMAT_XML
289
266
  end
290
267
 
291
- def json? #:nodoc:
292
- format == FireEagle::FORMAT_JSON
293
- end
294
-
295
268
  def create_token(response) #:nodoc:
296
269
  token = Hash[*response.body.split("&").map { |x| x.split("=") }.flatten]
297
270
  OAuth::Token.new(token["oauth_token"], token["oauth_token_secret"])
@@ -2,7 +2,7 @@ class FireEagle #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 6
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/fireeagle.rb CHANGED
@@ -4,7 +4,6 @@ require 'rubygems'
4
4
  gem 'oauth', ">= 0.2.1"
5
5
  require 'oauth/client/helper'
6
6
  require 'oauth/request_proxy/net_http'
7
- require 'json'
8
7
  require 'hpricot'
9
8
  require 'geo_ruby'
10
9
 
@@ -20,7 +19,6 @@ class FireEagle
20
19
  UPDATE_API_PATH = "/api/0.1/update"
21
20
  RECENT_API_PATH = "/api/0.1/recent"
22
21
  WITHIN_API_PATH = "/api/0.1/within"
23
- FORMAT_JSON = "json"
24
22
  FORMAT_XML = "xml"
25
23
  UPDATE_PARAMS = :lat, :lon, :woeid, :place_id, :address, :mnc, :mcc, :lac, :cid, :postal, :city, :state, :country, :q, :label
26
24
  # not yet supported
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fireeagle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Newland
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-03-05 00:00:00 -05:00
12
+ date: 2008-03-06 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -21,15 +21,6 @@ dependencies:
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.2.1
23
23
  version:
24
- - !ruby/object:Gem::Dependency
25
- name: json
26
- version_requirement:
27
- version_requirements: !ruby/object:Gem::Requirement
28
- requirements:
29
- - - ">="
30
- - !ruby/object:Gem::Version
31
- version: 1.1.1
32
- version:
33
24
  - !ruby/object:Gem::Dependency
34
25
  name: hpricot
35
26
  version_requirement: