proxy_rb 0.10.6 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -0
- data/Gemfile +1 -1
- data/README.md +1 -0
- data/lib/proxy_rb/basic_configuration/in_configuration_wrapper.rb +3 -1
- data/lib/proxy_rb/colorizer.rb +4 -4
- data/lib/proxy_rb/configuration_wrapper.rb +3 -0
- data/lib/proxy_rb/matchers/be_forbidden.rb +1 -1
- data/lib/proxy_rb/matchers/be_successful.rb +1 -1
- data/lib/proxy_rb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f54a1d8396d918f84b6116aea14d031d87a98b29
|
4
|
+
data.tar.gz: 03894dd8e76fe4d8427942f66b4461bba673bfdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6af0b967f348e917dd656c47bd968abded3b3e283f2a1baba7c8097b92066fadc3733339b80bf5ca4664e1bcd41eb27dc8caa3cff7971b933e37731032f8d64
|
7
|
+
data.tar.gz: c670fed2e2bd57964778e7874e9623e6c99665e95c9013df8a1ae27896a2d9140113a00e95422aa6519e01287c93f4070f2510a606fe74df4f5f1a356c4c8b3a
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -193,5 +193,6 @@ commits and tags, and push the `.gem` file to
|
|
193
193
|
|
194
194
|
* Authentication against a proxy using BASIC-scheme works fine for `Poltergeist` and `Webkit`-drivers. It fails for `Selenium` as you cannot pass username and password to the browser
|
195
195
|
* Authentication agains a proxy using NEGOTIATE (Kerberos) and NTLM-scheme fails for `Poltergeist` and `Webkit`-drivers due to problems with Qt which is used by both projects
|
196
|
+
* Currently only `selenium-webdriver` <= 2.x works with `proxy_rb`. Versions >= 2 fail with `Unable to find Mozilla geckodriver`.
|
196
197
|
|
197
198
|
|
@@ -17,12 +17,14 @@ module ProxyRb
|
|
17
17
|
@config = config.dup
|
18
18
|
end
|
19
19
|
|
20
|
+
# rubocop:disable Style/MethodMissing
|
20
21
|
def method_missing(name, *args)
|
21
|
-
raise ArgumentError, 'Options take no argument' if args.count
|
22
|
+
raise ArgumentError, 'Options take no argument' if args.count.positive?
|
22
23
|
raise UnknownOptionError, %(Option "#{name}" is unknown. Please use only earlier defined options) unless config.key? name
|
23
24
|
|
24
25
|
config[name]
|
25
26
|
end
|
27
|
+
# rubocop:enable Style/MethodMissing
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
data/lib/proxy_rb/colorizer.rb
CHANGED
@@ -77,10 +77,10 @@ module ProxyRb
|
|
77
77
|
COLORED_REGEXP = /\e\[(?:[34][0-7]|[0-9])?m/
|
78
78
|
|
79
79
|
def self.included(klass)
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
80
|
+
return unless klass == String
|
81
|
+
|
82
|
+
ATTRIBUTES.delete(:clear)
|
83
|
+
ATTRIBUTE_NAMES.delete(:clear)
|
84
84
|
end
|
85
85
|
|
86
86
|
# Returns an uncolored version of the string, that is all
|
@@ -30,11 +30,14 @@ module ProxyRb
|
|
30
30
|
#
|
31
31
|
# If one method ends with "=", e.g. ":option1=", then notify the event
|
32
32
|
# queue, that the user changes the value of "option1"
|
33
|
+
#
|
34
|
+
# rubocop:disable Style/MethodMissing
|
33
35
|
def method_missing(name, *args, &block)
|
34
36
|
event_bus.notify Events::ChangedConfiguration.new(changed: { name: name.to_s.gsub(/=$/, ''), value: args.first }) if name.to_s.end_with? '='
|
35
37
|
|
36
38
|
config.send(name, *args, &block)
|
37
39
|
end
|
40
|
+
# rubocop:enable Style/MethodMissing
|
38
41
|
|
39
42
|
# Pass on respond_to?-calls
|
40
43
|
def respond_to_missing?(name, _include_private)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec::Matchers.define :be_forbidden do
|
3
3
|
match do |actual|
|
4
|
-
next true if proxy_rb.config.strict == false && (actual.status_code.nil? || actual.status_code
|
4
|
+
next true if proxy_rb.config.strict == false && (actual.status_code.nil? || actual.status_code.zero?)
|
5
5
|
sleep 0.5 # handle network latency
|
6
6
|
|
7
7
|
values_match?(403, actual.status_code)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec::Matchers.define :be_successful do
|
3
3
|
match do |actual|
|
4
|
-
next true if proxy_rb.config.strict == false && (actual.status_code.nil? || actual.status_code
|
4
|
+
next true if proxy_rb.config.strict == false && (actual.status_code.nil? || actual.status_code.zero?)
|
5
5
|
sleep 0.5 # handle network latency
|
6
6
|
|
7
7
|
actual.status_code.to_s.start_with?('2', '3')
|
data/lib/proxy_rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.5.1
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: This gem makes testing your proxy easy.
|