screengem 0.17.0 → 0.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/screengem/automatic_visit.rb +12 -12
- data/lib/screengem/factories/question_factory.rb +14 -10
- data/lib/screengem/factories/task_factory.rb +14 -10
- data/lib/screengem/screen_elements.rb +4 -4
- data/lib/screengem/version.rb +1 -1
- data/screengem.gemspec +3 -2
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cb523354724ca72cbf826806114006306fc6d140cc351a4f1d90114e7524268
|
4
|
+
data.tar.gz: 33a4cd4556e719c74e535473fc115e2c60055e0b309835024fd98fdca541af9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97802cce90e9b46e469d711ff2e5ad61ddfd496af35c5cce5601ee236c67daa71999ef106d5302fcc1f4e31b91ccf7d01c260d77ade3cfff2ddbb19424c3c642
|
7
|
+
data.tar.gz: cbedf6c1f6d2722b151420403f604b54ba5ac9c3fcf0ef24b06fc91dad98ab88ef10c858cc12021797b1813438d62d9a81cffd1c5f5e3312f05013bdf3555147
|
data/CHANGELOG.md
CHANGED
@@ -11,13 +11,19 @@ module Screengem
|
|
11
11
|
@screen_element = screen_element
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
definition = ::RUBY_VERSION >= "3.0" ? "..." : "*args"
|
15
|
+
|
16
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
17
|
+
def method_missing(method, #{definition})
|
18
|
+
if screen_element.respond_to?(method)
|
19
|
+
screen_element.visit if auto_visit?(method)
|
20
|
+
|
21
|
+
screen_element.send(method, #{definition})
|
22
|
+
else
|
23
|
+
super
|
24
|
+
end
|
19
25
|
end
|
20
|
-
|
26
|
+
RUBY
|
21
27
|
|
22
28
|
def respond_to_missing?(method, *)
|
23
29
|
screen_element.respond_to?(method)
|
@@ -25,12 +31,6 @@ module Screengem
|
|
25
31
|
|
26
32
|
private
|
27
33
|
|
28
|
-
def forward_with_auto_visit(method, args)
|
29
|
-
screen_element.visit if auto_visit?(method)
|
30
|
-
|
31
|
-
screen_element.send(method, *args)
|
32
|
-
end
|
33
|
-
|
34
34
|
def auto_visit?(method)
|
35
35
|
methods_to_decorate.include?(method)
|
36
36
|
end
|
@@ -6,17 +6,21 @@ module Screengem
|
|
6
6
|
class QuestionFactory < BasicObject
|
7
7
|
include ::Singleton
|
8
8
|
|
9
|
-
|
10
|
-
question_class_name = "#{question_name}_question".camelize
|
11
|
-
question_class = "#{question_scope}::#{question_class_name}".constantize
|
9
|
+
definition = ::RUBY_VERSION >= "3.0" ? "..." : "*args"
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
12
|
+
def method_missing(question_name, #{definition})
|
13
|
+
question_class_name = "\#{question_name}_question".camelize
|
14
|
+
question_class = "\#{question_scope}::\#{question_class_name}".constantize
|
15
|
+
|
16
|
+
question_class.new(#{definition})
|
17
|
+
rescue => e
|
18
|
+
QuestionError.new(<<~MSG)
|
19
|
+
Unable to create question: '\#{question_class_name}'.
|
20
|
+
Details: \#{e.message}
|
21
|
+
MSG
|
22
|
+
end
|
23
|
+
RUBY
|
20
24
|
|
21
25
|
def respond_to_missing?(_question_name, *)
|
22
26
|
true
|
@@ -6,17 +6,21 @@ module Screengem
|
|
6
6
|
class TaskFactory < BasicObject
|
7
7
|
include ::Singleton
|
8
8
|
|
9
|
-
|
10
|
-
task_class_name = "#{task_name}_task".camelize
|
11
|
-
task_class = "#{task_scope}::#{task_class_name}".constantize
|
9
|
+
definition = ::RUBY_VERSION >= "3.0" ? "..." : "*args"
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
class_eval <<~RUBY, __FILE__, __LINE__ + 1
|
12
|
+
def method_missing(task_name, #{definition})
|
13
|
+
task_class_name = "\#{task_name}_task".camelize
|
14
|
+
task_class = "\#{task_scope}::\#{task_class_name}".constantize
|
15
|
+
|
16
|
+
task_class.new(#{definition})
|
17
|
+
rescue => e
|
18
|
+
TaskError.new(<<~MSG)
|
19
|
+
Unable to create task: '\#{task_class_name}'.
|
20
|
+
Details: \#{e.message}
|
21
|
+
MSG
|
22
|
+
end
|
23
|
+
RUBY
|
20
24
|
|
21
25
|
def respond_to_missing?(_task_name, *)
|
22
26
|
true
|
@@ -37,14 +37,14 @@ module Screengem
|
|
37
37
|
|
38
38
|
if auto_visit?(screen_element_class)
|
39
39
|
class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
40
|
-
def #{method_name}(
|
41
|
-
Screengem::AutomaticVisit.new(#{class_name}.new(
|
40
|
+
def #{method_name}(...)
|
41
|
+
Screengem::AutomaticVisit.new(#{class_name}.new(...))
|
42
42
|
end
|
43
43
|
RUBY
|
44
44
|
else
|
45
45
|
class_eval(<<~RUBY, __FILE__, __LINE__ + 1)
|
46
|
-
def #{method_name}(
|
47
|
-
#{class_name}.new(
|
46
|
+
def #{method_name}(...)
|
47
|
+
#{class_name}.new(...)
|
48
48
|
end
|
49
49
|
RUBY
|
50
50
|
end
|
data/lib/screengem/version.rb
CHANGED
data/screengem.gemspec
CHANGED
@@ -16,7 +16,8 @@ Gem::Specification.new do |spec|
|
|
16
16
|
"homepage_uri" => "https://github.com/nulogy/screengem",
|
17
17
|
"changelog_uri" => "https://github.com/nulogy/screengem/blob/master/CHANGELOG.md",
|
18
18
|
"source_code_uri" => "https://github.com/nulogy/screengem",
|
19
|
-
"bug_tracker_uri" => "https://github.com/nulogy/screengem/issues"
|
19
|
+
"bug_tracker_uri" => "https://github.com/nulogy/screengem/issues",
|
20
|
+
"rubygems_mfa_required" => "true"
|
20
21
|
}
|
21
22
|
|
22
23
|
# Specify which files should be added to the gem when it is released.
|
@@ -29,7 +30,7 @@ Gem::Specification.new do |spec|
|
|
29
30
|
spec.require_paths = ["lib"]
|
30
31
|
spec.required_ruby_version = ">= 2.7"
|
31
32
|
|
32
|
-
spec.add_runtime_dependency "activesupport", ">= 5.2", "< 7.
|
33
|
+
spec.add_runtime_dependency "activesupport", ">= 5.2", "< 7.1"
|
33
34
|
spec.add_runtime_dependency "capybara", ">= 3.0", "< 4.0"
|
34
35
|
spec.add_runtime_dependency "require_all", ">= 3.0", "< 4.0"
|
35
36
|
spec.add_runtime_dependency "rspec-expectations", "~> 3.11"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: screengem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alistair McKinnell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.2'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '7.
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.2'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '7.
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: capybara
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -230,6 +230,7 @@ metadata:
|
|
230
230
|
changelog_uri: https://github.com/nulogy/screengem/blob/master/CHANGELOG.md
|
231
231
|
source_code_uri: https://github.com/nulogy/screengem
|
232
232
|
bug_tracker_uri: https://github.com/nulogy/screengem/issues
|
233
|
+
rubygems_mfa_required: 'true'
|
233
234
|
post_install_message:
|
234
235
|
rdoc_options: []
|
235
236
|
require_paths:
|
@@ -245,7 +246,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
245
246
|
- !ruby/object:Gem::Version
|
246
247
|
version: '0'
|
247
248
|
requirements: []
|
248
|
-
rubygems_version: 3.
|
249
|
+
rubygems_version: 3.4.7
|
249
250
|
signing_key:
|
250
251
|
specification_version: 4
|
251
252
|
summary: Ruby implementation of the Screengem Pattern.
|