john-mayer 0.0.7 → 0.0.8
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/lib/foursquare.rb +12 -0
- data/lib/foursquare/base.rb +3 -0
- metadata +3 -3
data/lib/foursquare.rb
CHANGED
@@ -14,6 +14,18 @@ require "foursquare/venue"
|
|
14
14
|
module Foursquare
|
15
15
|
class Error < StandardError ; end
|
16
16
|
|
17
|
+
def self.verbose=(setting)
|
18
|
+
@verbose = setting
|
19
|
+
end
|
20
|
+
|
21
|
+
def self.verbose?
|
22
|
+
@verbose
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.log(msg)
|
26
|
+
puts msg if verbose?
|
27
|
+
end
|
28
|
+
|
17
29
|
ERRORS = {
|
18
30
|
"invalid_auth" => "OAuth token was not provided or was invalid.",
|
19
31
|
"param_error" => "A required parameter was missing or a parameter was malformed. This is also used if the resource ID in the path is incorrect.",
|
data/lib/foursquare/base.rb
CHANGED
@@ -19,8 +19,11 @@ module Foursquare
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def get(path, params={})
|
22
|
+
Foursquare.log("GET #{API + path}")
|
23
|
+
Foursquare.log("PARAMS: #{params.inspect}")
|
22
24
|
params.merge!(:oauth_token => @access_token)
|
23
25
|
response = JSON.parse(Typhoeus::Request.get(API + path, :params => params).body)
|
26
|
+
Foursquare.log(response.inspect)
|
24
27
|
response["meta"]["errorType"] ? error(response) : response["response"]
|
25
28
|
end
|
26
29
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: john-mayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 8
|
10
|
+
version: 0.0.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Pat Nakajima
|