dmc_kanye 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dmc_kanye.gemspec +1 -1
- data/lib/dmc_kanye/imma_let_you_finish.rb +36 -36
- data/lib/dmc_kanye/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25ea4799ce74fe7f6ff18f93cb71713584eb69434d7072c91077d8a57af67766
|
4
|
+
data.tar.gz: 7a121ed0195cc0c3ef0930743b24222b0b3da07dc16e591a9b44d6ef5edc7aa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 686ab35f8ed38d2b0d73bc572a708b79d594c0bd482c845805f43dbd563f694b9b4b9615c488de099ba52187010482d524a7f9c5fa262c79ab1f0aea267804b8
|
7
|
+
data.tar.gz: 2c7afd64412d629843850aa28422e399a6df6b7140dddc6c7a36d37f319f77c33f228998086b6f9c095a441abcfbd243dc5d2b82613e9f7fb0d1b0f93e6de3bf
|
data/dmc_kanye.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "capybara"
|
21
|
+
spec.add_dependency "capybara", "~> 3.40"
|
22
22
|
spec.add_dependency "poltergeist"
|
23
23
|
spec.add_development_dependency "rake"
|
24
24
|
end
|
@@ -42,58 +42,58 @@ end
|
|
42
42
|
# Here we have overridden the behavior of a method in Capybara. The part
|
43
43
|
# that we added is highlighted below to make it easier when upgrading
|
44
44
|
# to a future version of Capybara.
|
45
|
+
#
|
46
|
+
# Original code lives here: https://github.com/teamcapybara/capybara/blob/3.40.0/lib/capybara/node/base.rb#L76
|
45
47
|
|
46
48
|
##### THIS CODE IS ORIGINAL
|
47
49
|
module Capybara
|
48
50
|
module Node
|
49
51
|
class Base
|
52
|
+
def synchronize(seconds = nil, errors: nil)
|
53
|
+
return yield if session.synchronized
|
50
54
|
##### START PUNCHING DUCKS
|
51
55
|
# orig code:
|
52
|
-
#
|
56
|
+
# seconds = session_options.default_max_wait_time if [nil, true].include? seconds
|
53
57
|
# new code:
|
54
|
-
def synchronize(seconds = nil, options = {})
|
55
58
|
kanye_in_the_house = session.driver.respond_to?(:kanye_invited?) && session.driver.kanye_invited?
|
56
|
-
if seconds
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
if [nil, true].include? seconds
|
60
|
+
if kanye_in_the_house
|
61
|
+
seconds = DmcKanye::Config.default_wait_time || session_options.default_max_wait_time
|
62
|
+
else
|
63
|
+
seconds = session_options.default_max_wait_time
|
64
|
+
end
|
62
65
|
end
|
63
66
|
##### STOP PUNCHING DUCKS, BACK TO ORIGINAL CODE
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
else
|
69
|
-
session.synchronized = true
|
70
|
-
begin
|
67
|
+
interval = session_options.default_retry_interval
|
68
|
+
session.synchronized = true
|
69
|
+
timer = Capybara::Helpers.timer(expire_in: seconds)
|
70
|
+
begin
|
71
71
|
##### START PUNCHING DUCKS
|
72
72
|
# orig code:
|
73
|
-
#
|
73
|
+
# yield
|
74
74
|
# new code:
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
75
|
+
session.driver.send(:imma_let_you_finish) if kanye_in_the_house
|
76
|
+
result = yield
|
77
|
+
session.driver.send(:imma_let_you_finish) if kanye_in_the_house
|
78
|
+
result
|
79
79
|
##### STOP PUNCHING DUCKS, BACK TO ORIGINAL CODE
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
retry
|
94
|
-
ensure
|
95
|
-
session.synchronized = false
|
80
|
+
rescue StandardError => e
|
81
|
+
session.raise_server_error!
|
82
|
+
raise e unless catch_error?(e, errors)
|
83
|
+
|
84
|
+
if driver.wait?
|
85
|
+
raise e if timer.expired?
|
86
|
+
|
87
|
+
sleep interval
|
88
|
+
reload if session_options.automatic_reload
|
89
|
+
else
|
90
|
+
old_base = @base
|
91
|
+
reload if session_options.automatic_reload
|
92
|
+
raise e if old_base == @base
|
96
93
|
end
|
94
|
+
retry
|
95
|
+
ensure
|
96
|
+
session.synchronized = false
|
97
97
|
end
|
98
98
|
end
|
99
99
|
end
|
data/lib/dmc_kanye/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dmc_kanye
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wyatt Greene
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capybara
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '3.40'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '3.40'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: poltergeist
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|