Description
the gemspec lists the minimum requirement for the gem release 4.0.0 as 2.7.0
the dynamic matcher implementation makes use of a feature introduced with 2.7.0 (according to the changelog)
however: loading the gem with ruby 2.7.0 leads to a syntax
error:
$ ruby --version
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
$ gem install --silent --version ">7" puppet>4" rspec-puppet
$ gem install --silent --version "
$ ruby -e "require 'rspec-puppet'"
...
/usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:inrequire': /usr/local/bundle/gems/rspec-puppet-4.0.0/lib/rspec-puppet/matchers/dynamic_matchers.rb:29: syntax error, unexpected (... (SyntaxError) ... def method_missing(method, ...) ... ^~~ /usr/local/bundle/gems/rspec-puppet-4.0.0/lib/rspec-puppet/matchers/dynamic_matchers.rb:30: syntax error, unexpected ')' ...:CreateGeneric.new(method, ...) if method == :be_valid_type ... ^ /usr/local/bundle/gems/rspec-puppet-4.0.0/lib/rspec-puppet/matchers/dynamic_matchers.rb:35: syntax error, unexpected
end', expecting end-of-input
whereas loading the gem with ruby 2.7.4 succeeds:
$ ruby --version
ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]
$ gem install --silent --version ">7" puppet>4" rspec-puppet
$ gem install --silent --version "
$ ruby -e "require 'rspec-puppet'"
$ echo $?
0
i came across this issues, as ruby 2.7.0 is the version shipped with Ubuntu 20.04 (EOL in 2025)