browsermob-proxy 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,10 @@
1
- # before_script:
2
- # - sudo apt-get install -y unzip
3
- # - curl -k -L -O https://github.com/downloads/webmetrics/browsermob-proxy/browsermob-proxy-2.0-beta-3-bin.zip
4
- # - unzip browsermob-proxy-2.0-beta-3-bin.zip
5
- # - ln -s ./browsermob-proxy-2.0-beta-3 /tmp/browsermob-proxy
6
- # - sh -e /etc/init.d/xvfb start
1
+ rvm:
2
+ - 1.9.2
3
+ before_script:
4
+ - sudo apt-get install -y unzip
5
+ - curl -k -L -O https://github.com/downloads/webmetrics/browsermob-proxy/browsermob-proxy-2.0-beta-6-bin.zip
6
+ - unzip browsermob-proxy-2.0-beta-6-bin.zip
7
+ - export BROWSERMOB_PROXY_HOME=`pwd`/browsermob-proxy-2.0-beta-6
8
+ - sudo chmod +x $BROWSERMOB_PROXY_HOME/bin/browsermob-proxy
9
+ - sh -e /etc/init.d/xvfb start
10
+ - export DISPLAY=:99
data/README.md CHANGED
@@ -82,7 +82,7 @@ Note on Patches/Pull Requests
82
82
  Copyright
83
83
  ---------
84
84
 
85
- Copyright 2011 Jari Bakken
85
+ Copyright 2011-2012 Jari Bakken
86
86
 
87
87
  Licensed under the Apache License, Version 2.0 (the "License");
88
88
  you may not use this file except in compliance with the License.
data/Rakefile CHANGED
@@ -18,4 +18,4 @@ end
18
18
  desc 'Run all specs.'
19
19
  task :spec => %w[spec:unit spec:e2e]
20
20
 
21
- task :default => %w[spec:unit]
21
+ task :default => :spec
@@ -49,6 +49,11 @@ module BrowserMob
49
49
  @resource['blacklist'].put :regex => regex, :status => status_code
50
50
  end
51
51
 
52
+ def header(hash)
53
+ @resource['headers'].post hash.to_json, :content_type => "application/json"
54
+ end
55
+ alias_method :headers, :header
56
+
52
57
  LIMITS = {
53
58
  :upstream_kbps => 'upstreamKbps',
54
59
  :downstream_kbps => 'downstreamKbps',
@@ -1,5 +1,5 @@
1
1
  module BrowserMob
2
2
  module Proxy
3
- VERSION = "0.0.5"
3
+ VERSION = "0.0.6"
4
4
  end
5
5
  end
@@ -34,6 +34,10 @@ describe "Proxy + WebDriver" do
34
34
  proxy.blacklist(/bad\.com/, 404)
35
35
  end
36
36
 
37
+ it "should set headers" do
38
+ proxy.headers('Content-Type' => "text/html")
39
+ end
40
+
37
41
  it "should set limits" do
38
42
  proxy.limit(:downstream_kbps => 100, :upstream_kbps => 100, :latency => 2)
39
43
  end
@@ -40,8 +40,3 @@ RSpec.configure do |c|
40
40
  c.include(BrowserMob::Proxy::SpecHelper)
41
41
  c.after(:suite) { $_bm_server.stop if $_bm_server }
42
42
  end
43
-
44
- if ENV['TRAVIS']
45
- ENV['DISPLAY'] = ":99"
46
- ENV['BROWSERMOB_PROXY_HOME'] = "/tmp/browsermob-proxy"
47
- end
@@ -13,7 +13,8 @@ module BrowserMob
13
13
  "har/pageRef" => mock("resource[har/pageRef]"),
14
14
  "whitelist" => mock("resource[whitelist]"),
15
15
  "blacklist" => mock("resource[blacklist]"),
16
- "limit" => mock("resource[limit]")
16
+ "limit" => mock("resource[limit]"),
17
+ "headers" => mock("resource[headers]")
17
18
  }.each do |path, mock|
18
19
  resource.stub!(:[]).with(path).and_return(mock)
19
20
  end
@@ -95,6 +96,12 @@ module BrowserMob
95
96
  lambda { client.limit(:foo => 1) }.should raise_error(ArgumentError)
96
97
  lambda { client.limit({}) }.should raise_error(ArgumentError)
97
98
  end
99
+
100
+ it "sets headers" do
101
+ resource['headers'].should_receive(:post).with('{"foo":"bar"}', :content_type => "application/json")
102
+
103
+ client.headers(:foo => "bar")
104
+ end
98
105
  end
99
106
 
100
107
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: browsermob-proxy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 0
9
- - 5
10
- version: 0.0.5
8
+ - 6
9
+ segments_generated: true
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - jari.bakken
@@ -15,111 +15,105 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-10 00:00:00 Z
18
+ date: 2012-03-22 00:00:00 -05:00
19
+ default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- name: rest-client
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
23
  requirements:
26
24
  - - ">="
27
25
  - !ruby/object:Gem::Version
28
- hash: 3
29
26
  segments:
30
27
  - 0
28
+ segments_generated: true
31
29
  version: "0"
30
+ requirement: *id001
31
+ name: rest-client
32
+ prerelease: false
32
33
  type: :runtime
33
- version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency
35
- name: childprocess
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
38
- none: false
35
+ version_requirements: &id002 !ruby/object:Gem::Requirement
39
36
  requirements:
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
- hash: 3
43
39
  segments:
44
40
  - 0
41
+ segments_generated: true
45
42
  version: "0"
43
+ requirement: *id002
44
+ name: childprocess
45
+ prerelease: false
46
46
  type: :runtime
47
- version_requirements: *id002
48
47
  - !ruby/object:Gem::Dependency
49
- name: json
50
- prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
52
- none: false
48
+ version_requirements: &id003 !ruby/object:Gem::Requirement
53
49
  requirements:
54
50
  - - ">="
55
51
  - !ruby/object:Gem::Version
56
- hash: 3
57
52
  segments:
58
53
  - 0
54
+ segments_generated: true
59
55
  version: "0"
56
+ requirement: *id003
57
+ name: json
58
+ prerelease: false
60
59
  type: :runtime
61
- version_requirements: *id003
62
60
  - !ruby/object:Gem::Dependency
63
- name: har
64
- prerelease: false
65
- requirement: &id004 !ruby/object:Gem::Requirement
66
- none: false
61
+ version_requirements: &id004 !ruby/object:Gem::Requirement
67
62
  requirements:
68
63
  - - ">="
69
64
  - !ruby/object:Gem::Version
70
- hash: 3
71
65
  segments:
72
66
  - 0
67
+ segments_generated: true
73
68
  version: "0"
69
+ requirement: *id004
70
+ name: har
71
+ prerelease: false
74
72
  type: :runtime
75
- version_requirements: *id004
76
73
  - !ruby/object:Gem::Dependency
77
- name: rspec
78
- prerelease: false
79
- requirement: &id005 !ruby/object:Gem::Requirement
80
- none: false
74
+ version_requirements: &id005 !ruby/object:Gem::Requirement
81
75
  requirements:
82
76
  - - ">="
83
77
  - !ruby/object:Gem::Version
84
- hash: 27
85
78
  segments:
86
79
  - 2
87
80
  - 5
88
81
  - 0
82
+ segments_generated: true
89
83
  version: 2.5.0
84
+ requirement: *id005
85
+ name: rspec
86
+ prerelease: false
90
87
  type: :development
91
- version_requirements: *id005
92
88
  - !ruby/object:Gem::Dependency
93
- name: selenium-webdriver
94
- prerelease: false
95
- requirement: &id006 !ruby/object:Gem::Requirement
96
- none: false
89
+ version_requirements: &id006 !ruby/object:Gem::Requirement
97
90
  requirements:
98
91
  - - ~>
99
92
  - !ruby/object:Gem::Version
100
- hash: 13
101
93
  segments:
102
94
  - 2
103
95
  - 7
96
+ segments_generated: true
104
97
  version: "2.7"
98
+ requirement: *id006
99
+ name: selenium-webdriver
100
+ prerelease: false
105
101
  type: :development
106
- version_requirements: *id006
107
102
  - !ruby/object:Gem::Dependency
108
- name: rake
109
- prerelease: false
110
- requirement: &id007 !ruby/object:Gem::Requirement
111
- none: false
103
+ version_requirements: &id007 !ruby/object:Gem::Requirement
112
104
  requirements:
113
105
  - - ~>
114
106
  - !ruby/object:Gem::Version
115
- hash: 63
116
107
  segments:
117
108
  - 0
118
109
  - 9
119
110
  - 2
111
+ segments_generated: true
120
112
  version: 0.9.2
113
+ requirement: *id007
114
+ name: rake
115
+ prerelease: false
121
116
  type: :development
122
- version_requirements: *id007
123
117
  description: Ruby client for the BrowserMob Proxy REST API
124
118
  email:
125
119
  - jari.bakken@gmail.com
@@ -152,6 +146,7 @@ files:
152
146
  - spec/spec_helper.rb
153
147
  - spec/unit/client_spec.rb
154
148
  - spec/unit/webdriver_listener_spec.rb
149
+ has_rdoc: true
155
150
  homepage: http://github.com/jarib/browsermob-proxy-rb
156
151
  licenses: []
157
152
 
@@ -161,27 +156,25 @@ rdoc_options: []
161
156
  require_paths:
162
157
  - lib
163
158
  required_ruby_version: !ruby/object:Gem::Requirement
164
- none: false
165
159
  requirements:
166
160
  - - ">="
167
161
  - !ruby/object:Gem::Version
168
- hash: 3
169
162
  segments:
170
163
  - 0
164
+ segments_generated: true
171
165
  version: "0"
172
166
  required_rubygems_version: !ruby/object:Gem::Requirement
173
- none: false
174
167
  requirements:
175
168
  - - ">="
176
169
  - !ruby/object:Gem::Version
177
- hash: 3
178
170
  segments:
179
171
  - 0
172
+ segments_generated: true
180
173
  version: "0"
181
174
  requirements: []
182
175
 
183
176
  rubyforge_project: browsermob-proxy-rb
184
- rubygems_version: 1.8.10
177
+ rubygems_version: 1.3.6
185
178
  signing_key:
186
179
  specification_version: 3
187
180
  summary: Ruby client for the BrowserMob Proxy REST API