Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added did you mean to rake #221

Merged
merged 1 commit into from
Sep 9, 2017
Merged

Conversation

xtina-starr
Copy link

This is a follow up of an older PR that added a better message for invalid rake task names. The proposed change uses did you mean in order make a rake task suggestion in addition to the default error message.

@yuki24 yuki24 requested review from drbrain and zzak September 8, 2017 16:46
@drbrain
Copy link
Member

drbrain commented Sep 8, 2017

My name is Eric Hodel and I approve this pull request.

@yuki24
Copy link
Member

yuki24 commented Sep 8, 2017

I'm helping @xtina-starr contribute to a Ruby core project and paired on this PR. This change should work fine in all the Ruby versions Rake currently supports, and it should be good to merge.

asking @drbrain and @zzak for a review since you two were part of the conversation in the previous PR.

Copy link
Member

@drbrain drbrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@xtina-starr xtina-starr force-pushed the add-did-you-mean-to-rake branch from f831b47 to e40db1d Compare September 8, 2017 21:58
Signed-off-by: Yuki Nishijima <[email protected]>
@xtina-starr xtina-starr force-pushed the add-did-you-mean-to-rake branch from e40db1d to d54013d Compare September 8, 2017 22:00
@hsbt hsbt merged commit 7d0c08f into ruby:master Sep 9, 2017
@hsbt
Copy link
Member

hsbt commented Sep 9, 2017

Looks useful improvement. I will release rake-12.1.0 contained this pull request.

@hsbt
Copy link
Member

hsbt commented Sep 11, 2017

I released rake-12.1.0.

yuki24 added a commit to ruby/did_you_mean that referenced this pull request Sep 11, 2017
This reverts commit 36f4c9e. This has
been moved to the rake side: ruby/rake#221
@shreyasbharath
Copy link

shreyasbharath commented Jan 10, 2018

Is this functionality automatically invoked? @xtina-starr @hsbt

It doesn't seem to work for me, instead I get an error like below -

C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/task_manager.rb:59:in `[]': Don't know how to build task 'dxygen' (see --tasks) (RuntimeError)
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/application.rb:159:in `invoke_task'
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/application.rb:116:in `each'
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/application.rb:116:in `block in top_level'
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/application.rb:125:in `run_with_threads'
        from C:/tools/ruby24/lib/ruby/gems/2.4.0/gems/rake-12.2.1/lib/rake/application.rb:110:in `top_level'

@yuki24
Copy link
Member

yuki24 commented Jan 10, 2018

It is automatically invoked if the did_you_mean is available in the system.

  • What's the output of rake -T?
  • What version of did_you_mean you have installed? You can check ny running:
    gem list | grep did_you_mean
    

@shreyasbharath
Copy link

shreyasbharath commented Jan 10, 2018

No I don't have the gem installed. I figured it came with Ruby 2.4 as a default gem.

I have Ruby 2.4 installed (Windows) and according to the docs on did_you_mean Ruby 2.3 and later ships with this gem and it will automatically be required when a Ruby process starts up. No special setup is required.

rake -T lists a whole bunch of tasks that I have defined.

@yuki24
Copy link
Member

yuki24 commented Jan 10, 2018

Then it's an issue in the installer you used to install/compile Ruby. It's likely you are missing all the bundled gems in your system and you'd have to install them by yourself.

@shreyasbharath
Copy link

@yuki24 You are right, I tried installing v1.2.0 of did_you_mean but it looks like you need Ruby 2.5.

I installed v1.1.2 manually and the suggestions now work as expected!

Thanks for your help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants