screengem 0.17.0 → 0.18.0

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: dc2caab1569220080738a833782fd78797d70da30e98e190559dca7896d11695
4
+ data.tar.gz: 2ae610d60ea958c002e0b1f1658257a906b790694478a1d01b0997b979bc8475
5
5
  SHA512:
6
- metadata.gz: 9e391d87bc90efc2153fb3cbfcd094d51c9676f94a7371111494a8d174b83f9a12d703a562470ae18be9533156f20b954286a003c1a8832947841599c57d62a1
7
- data.tar.gz: 548acebf1c946d4235a908a6c6f5d50a1f520bbf20373a8625254613f3fc58ad1f60300a82a6038d180d9f0a11deb3808925531381165b88dba3b8bb3d46a33c
6
+ metadata.gz: ebaced74c3f7ae2640252503e9c1dbee04b7b955b20a1d81c16777cf10b779a984acb5dd20c81c0e68bb356321f22314676f3efffe484147bf85a8ef82bab3df
7
+ data.tar.gz: 4ccaed09c6abfd214ff67ffdff7e96b3482626dd591f1ef2e293e5ada8e5ff8ec37a82bfe422c16e1d0cdaa16bf79199c259303d59e610d3a5fa4281b6e66582
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## main (unreleased)
4
4
 
5
+ ## 0.18.0 (2023-02-04)
6
+
7
+ * Support Ruby 3.x
8
+
5
9
  ## 0.17.0 (2022-10-11)
6
10
 
7
11
  ### 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 >= "2.7" ? "..." : "*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 >= "2.7" ? "..." : "*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 >= "2.7" ? "..." : "*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
@@ -1,3 +1,3 @@
1
1
  module Screengem
2
- VERSION = "0.17.0"
2
+ VERSION = "0.18.0"
3
3
  end
data/screengem.gemspec CHANGED
@@ -3,6 +3,8 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require "screengem/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
+ spec.metadata = { "rubygems_mfa_required" => "true" }
7
+
6
8
  spec.name = "screengem"
7
9
  spec.version = Screengem::VERSION
8
10
  spec.authors = ["Alistair McKinnell"]
@@ -29,7 +31,7 @@ Gem::Specification.new do |spec|
29
31
  spec.require_paths = ["lib"]
30
32
  spec.required_ruby_version = ">= 2.7"
31
33
 
32
- spec.add_runtime_dependency "activesupport", ">= 5.2", "< 7.0"
34
+ spec.add_runtime_dependency "activesupport", ">= 5.2", "< 7.1"
33
35
  spec.add_runtime_dependency "capybara", ">= 3.0", "< 4.0"
34
36
  spec.add_runtime_dependency "require_all", ">= 3.0", "< 4.0"
35
37
  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.0
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-02-04 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
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  - !ruby/object:Gem::Version
246
246
  version: '0'
247
247
  requirements: []
248
- rubygems_version: 3.3.22
248
+ rubygems_version: 3.4.5
249
249
  signing_key:
250
250
  specification_version: 4
251
251
  summary: Ruby implementation of the Screengem Pattern.