john-mayer 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
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.",
@@ -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: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Pat Nakajima