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

Update UPGRADE_FROM_FACTORY_GIRL.md #1084

Closed
wants to merge 1 commit into from

Conversation

diei
Copy link

@diei diei commented Nov 27, 2017

At my OS X Yosemite 10.10.5 the grep commands does not work. I have updated them with the versions working for me.

At my OS X Yosemite 10.10.5 the grep commands does not work. I have updated them with the versions working for me.
@@ -35,7 +35,7 @@ to replace all references with the new constant should do the trick. For
example, on OS X:

```sh
grep -e FactoryGirl **/*.rake **/*.rb -s -l | xargs sed -i "" "s|FactoryGirl|FactoryBot|"
grep -rl -e FactoryGirl --include="*.rake" --include="*.rb" . | xargs sed -i "" "s|FactoryGirl|FactoryBot|"

Choose a reason for hiding this comment

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

The include could also be --include=\*.{rb,rake} what do you think?

Copy link
Author

Choose a reason for hiding this comment

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

That works as well.

Copy link

Choose a reason for hiding this comment

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

This removes the -s flag in the first but not the second command. It should probably stay.

@tf
Copy link

tf commented Jan 10, 2018

On Ubuntu, I also had to remove the first "" from the sed command (and add a g to the command, see #1083):

grep -rls -e factory_girl --include="*.rb" --include="*.rake" | xargs sed -i "s|factory_girl|factory_bot|g"                      

Leaving it in results in

sed: can't read s|factory_girl|factory_bot|: No such file or director

@composerinteralia
Copy link
Collaborator

Thanks for this PR! The example we gave was really intended to be an example, not necessarily a perfect solution that would work for everyone. We have had lots of PRs suggesting alternatives (#1070, #1075, #1084, #1095, #1102), but to reduce churn on this file I have decided to close these issues. I appreciate your help!

@thoughtbot thoughtbot locked as resolved and limited conversation to collaborators Aug 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants