browsermob-proxy 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4746a40da8079c78653f63bf05ac1be1edfa6ca5
4
- data.tar.gz: f46530ae50096d7454c8be71cb0e0ef8dc52893c
3
+ metadata.gz: e8a8e4e9be3341956bda02727640a15ed856e6e2
4
+ data.tar.gz: 4fb4be71eb9e5e549593e4f7ad647093c5847128
5
5
  SHA512:
6
- metadata.gz: d8194f92c4ec9ec9e8fcb68b5fc41af88ef227b38e0a1da8fffcf24fe7593cb48b5ceed9bb5a0308cde0df5adeef3a48afa4742cd2c6ae668b5546cdaba74ec1
7
- data.tar.gz: 4a35dda92ad80928bda64c2cf4d1adc298e4a0479233494fa436fdc232517a8ae24bbf96c56770a877337d16e44b0543a5eaf1b0c16ce76a078e7836a995985f
6
+ metadata.gz: f1e58e4cc70d04b3b29ea9f468698be7ba6b7420ec17fb4567a02746d1fc904a6ff1a44f10521e0742f25b62fe2e80eaf9f3ec06e19d57c3563decc300792cfc
7
+ data.tar.gz: 9a220eac9753cd7d3fd20815b7d7abd304bea9294213103a37fa8de63407e2abaccabe08940aca44672386d2dad521f9093e96941e44123a125bc99f47e4cb07
@@ -4,13 +4,16 @@ module BrowserMob
4
4
  class Client
5
5
  attr_reader :host, :port
6
6
 
7
- def self.from(server_url)
7
+ def self.from(server_url, port = nil)
8
8
  # ActiveSupport may define Object#load, so we can't use MultiJson.respond_to? here.
9
9
  sm = MultiJson.singleton_methods.map { |e| e.to_sym }
10
10
  decode_method = sm.include?(:load) ? :load : :decode
11
11
 
12
+ new_proxy_url = URI.join(server_url, "proxy")
13
+ new_proxy_url.query = "port=#{port}" if port
14
+
12
15
  port = MultiJson.send(decode_method,
13
- RestClient.post(URI.join(server_url, "proxy").to_s, '')
16
+ RestClient.post(new_proxy_url.to_s, '')
14
17
  ).fetch('port')
15
18
 
16
19
  uri = URI.parse(File.join(server_url, "proxy", port.to_s))
@@ -43,8 +43,8 @@ module BrowserMob
43
43
  "http://localhost:#{port}"
44
44
  end
45
45
 
46
- def create_proxy
47
- Client.from url
46
+ def create_proxy(port = nil)
47
+ Client.from url, port
48
48
  end
49
49
 
50
50
  def stop
@@ -108,4 +108,4 @@ module BrowserMob
108
108
 
109
109
  end # Server
110
110
  end # Proxy
111
- end # BrowserMob
111
+ end # BrowserMob
@@ -1,5 +1,5 @@
1
1
  module BrowserMob
2
2
  module Proxy
3
- VERSION = "0.1.9"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsermob-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - jari.bakken
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client