thoughtbot / appraisal

A Ruby library for testing your library against different versions of dependencies.
https://thoughtbot.com
MIT License
1.25k stars 107 forks source link

grep (used to ensure bundler availability) is not readily available on MS Windows #146

Closed mlt closed 4 years ago

mlt commented 5 years ago
'grep' is not recognized as an internal or external command,
operable program or batch file.
>> Reinstall Bundler into C:/tools/Ruby24-x64/lib/ruby/gems/2.4.0
Successfully installed bundler-1.16.4
Parsing documentation for bundler-1.16.4
Done installing documentation for bundler after 7 seconds
1 gem installed

https://github.com/thoughtbot/appraisal/blob/5d1edf642091ca38f83cf2ae1cf9624fa23546c8/lib/appraisal/command.rb#L44

nickcharlton commented 4 years ago

I've not used Windows in many, many years, but I agree that this is something we should be better about.

Is there a solution to this which is similar in spirit but could be done easily enough?

Asking around, I had findstr suggested, which would mean we change that line to:

gem list -q "^bundler$" | findstr "bundler"

But this is not something I can test. What do you think?

nickcharlton commented 4 years ago

Perhaps a better solution is to just do this in Ruby:

`gem list -q '^bundler'`.split(/\n/).any?
nickcharlton commented 4 years ago

I'm going to close this as #168 removes that reference of grep, which is nice!