scout_rails 1.0.4.pre → 1.0.4.pre.2

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.
@@ -1,6 +1,7 @@
1
- # 1.0.4
1
+ # 1.0.4.pre
2
2
 
3
3
  * Added Mongo + Moped instrumentation. Mongo is used for Mongoid < 3.
4
+ * Proxy support
4
5
 
5
6
  # 1.0.3
6
7
 
@@ -262,8 +262,7 @@ module ScoutRails
262
262
 
263
263
  def request(url, &connector)
264
264
  response = nil
265
- http = Net::HTTP.new(url.host, url.port)
266
- response = http.start(&connector)
265
+ response = http(url).start(&connector)
267
266
  logger.debug "got response: #{response.inspect}"
268
267
  case response
269
268
  when Net::HTTPSuccess, Net::HTTPNotModified
@@ -279,6 +278,14 @@ module ScoutRails
279
278
  response
280
279
  end
281
280
 
281
+ # Take care of the http proxy, if specified in config.
282
+ # Given a blank string, the proxy_uri URI instance's host/port/user/pass will be nil.
283
+ # Net::HTTP::Proxy returns a regular Net::HTTP class if the first argument (host) is nil.
284
+ def http(url)
285
+ proxy_uri = URI.parse(config.settings['proxy'].to_s)
286
+ Net::HTTP::Proxy(proxy_uri.host,proxy_uri.port,proxy_uri.user,proxy_uri.password).new(url.host, url.port)
287
+ end
288
+
282
289
  # Loads the instrumention logic.
283
290
  def load_instruments
284
291
  case environment.framework
@@ -1,3 +1,3 @@
1
1
  module ScoutRails
2
- VERSION = "1.0.4.pre"
2
+ VERSION = "1.0.4.pre.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scout_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4.pre
4
+ version: 1.0.4.pre.2
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-08-30 00:00:00.000000000 Z
13
+ date: 2012-09-04 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Monitors a Ruby on Rails application and reports detailed metrics on
16
16
  performance to Scout, a hosted monitoring service.