You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tl;dr Let's update the find_step.rb script instead of requiring very old ruby versions. It's easy to fix up!
Hello, I use cucumber within Spacemacs
In GNU Emacs 29.1 (build 1, x86_64-apple-darwin18.7.0, NS appkit-1671.60
Version 10.14.6 (Build 18G9323)) of 2023-08-17 built on
builder10-14.lan
Windowing system distributor 'Apple', version 10.3.2299
System Description: macOS 13.3.1
And would like to use the feature-goto-step-definition function. But it requires
And when I try to install that version of the ruby parser I get
~/Code/theapp (main)$ gem install ruby_parser -v 3.14.2
ERROR: Error installing ruby_parser:
ruby_parser-3.14.2 requires Ruby version ~> 2.2. The current ruby version is 3.1.4.
I didn't want to install such an old version of Ruby, but I tried anyway, but the build failed (I tried a few minor versions too)
WARNING: ruby-2.2.0 is past its end of life and is now unsupported.
It no longer receives bug fixes or critical security updates.
ruby-build: using readline from homebrew
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
BUILD FAILED (macOS 13.3.1 using ruby-build 20230428)
Inspect or clean up the working tree at /var/folders/3y/6_str63x5y951rxczj0939pr0000gn/T/ruby-build.20231026114030.41789.DjdOo0
Results logged to /var/folders/3y/6_str63x5y951rxczj0939pr0000gn/T/ruby-build.20231026114030.41789.log
Anyway, after that I failed I decided to just fix up the find_step script in my emacs packages directory and it was pretty easy.
After removing the version requirements for gherkin and ruby parser, simply change @ast[:feature] to @ast.feature and change node.try(:examples) to node.respond_to?(:examples) && node&.examples and the package works again for me!
e.g.
def step_at(line)
@ast.feature.children.each do |element|
node = element.scenario || element.background
next unless node
node.steps.each do |step|
next unless step.location.line == line
return step_result(step, node)
end
end
nil
end
# Return hash of step info
def step_result(step, node)
result = { 'name' => step.text }
return result unless node.respond_to?(:examples) && node&.examples
return result if node.examples[0].nil?
add_example_info(node, result)
end
I hope that helps someone who might be coming here trying to get this package to work without ruby 2.2
The text was updated successfully, but these errors were encountered:
tl;dr Let's update the
find_step.rb
script instead of requiring very old ruby versions. It's easy to fix up!Hello, I use cucumber within Spacemacs
And would like to use the
feature-goto-step-definition
function. But it requiresAnd when I try to install that version of the ruby parser I get
I didn't want to install such an old version of Ruby, but I tried anyway, but the build failed (I tried a few minor versions too)
Anyway, after that I failed I decided to just fix up the find_step script in my emacs packages directory and it was pretty easy.
After removing the version requirements for gherkin and ruby parser, simply change
@ast[:feature]
to@ast.feature
and changenode.try(:examples)
tonode.respond_to?(:examples) && node&.examples
and the package works again for me!e.g.
I hope that helps someone who might be coming here trying to get this package to work without ruby 2.2
The text was updated successfully, but these errors were encountered: