-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use POSIX.2 compatible sed -E for duplicate slash removal #4711
Conversation
@mpapis what you think? |
@trinitronx thanks for pointing this out - I was so bent on saving the code from breaking apart in the rare cases I lost the real issue from my eyes - calling to sed to do a shell operation, in 99.99% cases it's faster to run something in shell then to subprocess to other tool like sed or whatever # x=a///////b
# echo $x
a///////b
# while [[ "$x" == *"//"* ]] ; do x="${x/\/\///}" ; done ; echo $x
a/b |
@trinitronx can you apply @mpapis suggestion? |
@pkuczynski: Sure, I'll try to find some time to implement this. @mpapis: Just to be clear, we're talking about sidestepping the issue using plain Bash substring manipulation instead of a call to |
Looks like it's correct in this case:
|
Implemented using @mpapis' example above Pushed alternate solution in bda5875 |
Conflicts: CHANGELOG.md
@mpapis, @pkuczynski : Merge conflicts fixed for |
@trinitronx Thank you, pushed it one step further - dropped the unnecessary |
@trinitronx I'm on OS X El Capitan, upgraded RVM to 1.29.8 and also stuck with this problem (sed: illegal option -- r). Thank you a lot! |
I’m coming from #4711 Maybe the following will be nothing new to you. Let’s make it sure. I experienced this issue for the first time only today even though I’ve been using the same RVM, Ruby, Rails, and macOS version for a long time. It was triggered only by a new Rails project. The issue appears only if the Rails project has either a .ruby-version file or a ruby line in the Gemfile. As these two are amongst the few things I always delete before I add a new Rails project into the repository, my existing Rails project worked fine. In case someone is looking for a solution now, delete these unless you rely on them. I don’t. Moreover, the only issues I’ve ever had with RVM were also related to this file and Gemfile line. Usually, I use different Ruby versions on my development machines, and another version on the CI and the production servers. (I have the same Ruby version as well as the same OS on the CI and the production servers). On a specific machine, all my projects are running under the same Ruby version though. I’m not sure why we have them. I would think it’s more likely that one needs to use a different Ruby version on another platform than that one needs to use a different Ruby version for another Ruby/Rails project. Maybe they are needed for some commercial hosting service. I don’t know. But as soon as you deploy to your servers, the .ruby-version file is only noise in the VCS at best, and once in a while, a source of issues. (I guess RVM doesn't create them, but Rails does. I never looked into it. I delete them for my mental peace.) |
Fixes #4618
Changes proposed in this pull request:
sed -r
callsed -E
instead