geoloqi 0.9.24 → 0.9.26

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.
@@ -71,7 +71,13 @@ module Geoloqi
71
71
  meth == :get ? req.params = query : req.body = query.to_json
72
72
  end
73
73
  end
74
- @config.logger.puts "Geoloqi::Session - #{meth.to_s.upcase} #{path}?#{Rack::Utils.build_query query}:\nStatus: #{raw.status}\nHeaders: #{raw.headers.inspect}\n#{raw.body}" if @config.logger
74
+
75
+ if @config.logger
76
+ @config.logger.print "### Geoloqi::Session - #{meth.to_s.upcase} #{path}"
77
+ @config.logger.print Rack::Utils.build_query(query) unless query.nil?
78
+ @config.logger.puts "\nStatus: #{raw.status}\nHeaders: #{raw.headers.inspect}\nBody: #{raw.body}"
79
+ end
80
+
75
81
  Response.new raw.status, raw.headers, raw.body
76
82
  end
77
83
 
@@ -1,5 +1,5 @@
1
1
  module Geoloqi
2
2
  def self.version
3
- '0.9.24'
3
+ '0.9.26'
4
4
  end
5
5
  end
@@ -103,6 +103,18 @@ describe Geoloqi::Config do
103
103
  expect { io.string =~ /Geoloqi::Session/ }
104
104
  end
105
105
 
106
+ it 'displays log information if logger is provided and query is nil' do
107
+ stub_request(:get, api_url('account/username')).
108
+ with(:headers => {'Authorization'=>'OAuth access_token1234'}).
109
+ to_return(:body => {'username' => 'bulbasaurrulzok'}.to_json)
110
+
111
+ io = StringIO.new
112
+ Geoloqi.config :client_id => CLIENT_ID, :client_secret => CLIENT_SECRET, :logger => io
113
+
114
+ Geoloqi.get ACCESS_TOKEN, 'account/username'
115
+ expect { io.string =~ /Geoloqi::Session/ }
116
+ end
117
+
106
118
 
107
119
  it 'correctly checks booleans for client_id and client_secret' do
108
120
  [:client_id, :client_secret].each do |k|
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: geoloqi
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.24
5
+ version: 0.9.26
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kyle Drake