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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a9311c4efbaf425f5cb08c89cb7ec0df2408ce296e8df1725fc63ce073c27878
4
- data.tar.gz: 8ef3d9d8f9b4e7b3fb28ef55b1f5a084e96d0e32b84178cee531d27143926e54
3
+ metadata.gz: 7cb523354724ca72cbf826806114006306fc6d140cc351a4f1d90114e7524268
4
+ data.tar.gz: 33a4cd4556e719c74e535473fc115e2c60055e0b309835024fd98fdca541af9f
5
5
  SHA512:
6
- metadata.gz: 9e391d87bc90efc2153fb3cbfcd094d51c9676f94a7371111494a8d174b83f9a12d703a562470ae18be9533156f20b954286a003c1a8832947841599c57d62a1
7
- data.tar.gz: 548acebf1c946d4235a908a6c6f5d50a1f520bbf20373a8625254613f3fc58ad1f60300a82a6038d180d9f0a11deb3808925531381165b88dba3b8bb3d46a33c
6
+ metadata.gz: 97802cce90e9b46e469d711ff2e5ad61ddfd496af35c5cce5601ee236c67daa71999ef106d5302fcc1f4e31b91ccf7d01c260d77ade3cfff2ddbb19424c3c642
7
+ data.tar.gz: cbedf6c1f6d2722b151420403f604b54ba5ac9c3fcf0ef24b06fc91dad98ab88ef10c858cc12021797b1813438d62d9a81cffd1c5f5e3312f05013bdf3555147
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## main (unreleased)
4
4
 
5
+ ## 0.18.1 (2023-03-05)
6
+
7
+ * Refine support for Ruby 3.x
8
+
9
+ ## 0.18.0 (2023-02-04)
10
+
11
+ * Support Ruby 3.x
12
+
5
13
  ## 0.17.0 (2022-10-11)
6
14
 
7
15
  ### Breaking Changes
@@ -11,13 +11,19 @@ module Screengem
11
11
  @screen_element = screen_element
12
12
  end
13
13
 
14
- def method_missing(method, *args)
15
- if screen_element.respond_to?(method)
16
- forward_with_auto_visit(method, args)
17
- else
18
- super
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
- end
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
- def method_missing(question_name, *args)
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
- question_class.new(*args)
14
- rescue => e
15
- QuestionError.new(<<~MSG)
16
- Unable to create question: '#{question_class_name}'.
17
- Details: #{e.message}
18
- MSG
19
- end
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
- def method_missing(task_name, *args)
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
- task_class.new(*args)
14
- rescue => e
15
- TaskError.new(<<~MSG)
16
- Unable to create task: '#{task_class_name}'.
17
- Details: #{e.message}
18
- MSG
19
- end
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}(*args)
41
- Screengem::AutomaticVisit.new(#{class_name}.new(*args))
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}(*args)
47
- #{class_name}.new(*args)
46
+ def #{method_name}(...)
47
+ #{class_name}.new(...)
48
48
  end
49
49
  RUBY
50
50
  end
@@ -1,3 +1,3 @@
1
1
  module Screengem
2
- VERSION = "0.17.0"
2
+ VERSION = "0.18.1"
3
3
  end
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.0"
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.17.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: 2022-10-11 00:00:00.000000000 Z
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.0'
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.0'
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.3.22
249
+ rubygems_version: 3.4.7
249
250
  signing_key:
250
251
  specification_version: 4
251
252
  summary: Ruby implementation of the Screengem Pattern.