-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
uniq Gemfile#source #85
Conversation
I think this patch make sense, yeah. We definitely wouldn't want duplicate source. |
@@ -14,7 +14,15 @@ | |||
gemfile = Appraisal::Gemfile.new | |||
gemfile.source "one" | |||
gemfile.source "two" | |||
expect(gemfile.to_s.strip).to eq %{source "one"\nsource "two"} | |||
expect(gemfile.to_s.strip).to match %r{source "one"} | |||
expect(gemfile.to_s.strip).to match %r{source "two"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why these two lines has to be changed? Is it the case now that the order are nondeterministic?
If so, I'd rather keep the array then .uniq
it, as we can't be sure if user will be getting the same order every time they run appraisal generate
or not, and it's annoying when you didn't touch anything, upgrade appraisal, then your source
lines get swapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense. fixed that way
@sikachu also fixed commit's message |
Do not write duplicate sources in the Gemfile.
Thanks! |
I'm author of a library https://github.com/razum2um/lurker with multi-rails suport which I migrate to use appraisal.
I want the lib to be tested and used without appraisal as well, that's why I use regular
Gemfile
for:development
gems, and I doeval ::File.read('Gemfile')
to import it intoappraise
section.I don't want to transfer them to
Appraisal
file as it seems unintuitive to me and prevents proper using without appraisal prefix at all. Currently I'm gettingsource
line twice (one evaled from Gemfile)This fixes it.
Anyway it doesn't make sense to have identical sources, is it?