geoloqi 0.9.28 → 0.9.30

Sign up to get free protection for your applications and to get access to all the features.
data/lib/geoloqi.rb CHANGED
@@ -26,7 +26,7 @@ module Geoloqi
26
26
  def oauth_url
27
27
  'https://beta.geoloqi.com/oauth/authorize'
28
28
  end
29
-
29
+
30
30
  def config(opts=nil)
31
31
  return @@config if opts.nil?
32
32
  @@config = Config.new opts
@@ -73,21 +73,23 @@ module Geoloqi
73
73
 
74
74
  def execute(meth, path, query=nil, headers={})
75
75
  query = Rack::Utils.parse_query query if query.is_a?(String)
76
+ headers = headers.merge! default_headers
77
+
76
78
  raw = @connection.send(meth) do |req|
77
79
  req.url "/#{Geoloqi.api_version.to_s}/#{path.gsub(/^\//, '')}"
78
- req.headers = headers.merge! default_headers
79
-
80
+ req.headers = headers
80
81
  if query
81
82
  meth == :get ? req.params = query : req.body = query.to_json
82
83
  end
83
84
  end
84
-
85
+
85
86
  if @config.logger
86
87
  @config.logger.print "### Geoloqi::Session - #{meth.to_s.upcase} #{path}"
87
88
  @config.logger.print "?#{Rack::Utils.build_query query}" unless query.nil?
88
- @config.logger.puts "\n### Status: #{raw.status}\n### Headers: #{raw.headers.inspect}\n### Body: #{raw.body}"
89
+ @config.logger.puts "\n### Request Headers: #{headers.inspect}"
90
+ @config.logger.puts "### Status: #{raw.status}\n### Headers: #{raw.headers.inspect}\n### Body: #{raw.body}"
89
91
  end
90
-
92
+
91
93
  Response.new raw.status, raw.headers, raw.body
92
94
  end
93
95
 
@@ -1,5 +1,5 @@
1
1
  module Geoloqi
2
2
  def self.version
3
- '0.9.28'
3
+ '0.9.30'
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: geoloqi
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.28
5
+ version: 0.9.30
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kyle Drake
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2011-10-06 00:00:00 -07:00
14
+ date: 2011-10-10 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency