-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[CLI::Gem] Store the VERSION in a separate file #6451
Conversation
Do you have any examples of this unexpected behavior? |
@colby-swandale in my experience, it has been any code that evaluates gemspecs (especially from path gems) and then does not actually activate that gem after examining the gemspec. At that point, it's too late, and the gem's |
What's advantage to use |
I was beaten by |
…colby-swandale [CLI::Gem] Add a --rubocop option Based upon #6451. ### What was the end-user problem that led to this PR? The problem was I always have to remember how to add RuboCop to my Rakefile when I set up a new gem. ### What was your diagnosis of the problem? My diagnosis was that RuboCop has become enough of a community standard that it makes sense to offer it in `bundle gem`. ### What is your fix for the problem, implemented in this PR? My fix adds an option to `bundle gem` to add in RuboCop, in the same way options like `:coc`and `:mit` are handled. ### Why did you choose this fix out of the possible options? I chose this fix because it does not require bundler have an opinion on _how_ rubocop is configured.
880d379
to
ea0a09b
Compare
☔ The latest upstream changes (presumably #6503) made this pull request unmergeable. Please resolve the merge conflicts. |
This way, the gemspec does not need to change the load path
ea0a09b
to
225c68e
Compare
@indirect r? |
No more load path seems great, but won't |
…indirect [CLI::Gem] Add a --rubocop option Based upon #6451. ### What was the end-user problem that led to this PR? The problem was I always have to remember how to add RuboCop to my Rakefile when I set up a new gem. ### What was your diagnosis of the problem? My diagnosis was that RuboCop has become enough of a community standard that it makes sense to offer it in `bundle gem`. ### What is your fix for the problem, implemented in this PR? My fix adds an option to `bundle gem` to add in RuboCop, in the same way options like `:coc`and `:mit` are handled. ### Why did you choose this fix out of the possible options? I chose this fix because it does not require bundler have an opinion on _how_ rubocop is configured.
Exactly that. No having to write regular expressions to update the gem version |
…indirect [CLI::Gem] Add a --rubocop option Based upon #6451. ### What was the end-user problem that led to this PR? The problem was I always have to remember how to add RuboCop to my Rakefile when I set up a new gem. ### What was your diagnosis of the problem? My diagnosis was that RuboCop has become enough of a community standard that it makes sense to offer it in `bundle gem`. ### What is your fix for the problem, implemented in this PR? My fix adds an option to `bundle gem` to add in RuboCop, in the same way options like `:coc`and `:mit` are handled. ### Why did you choose this fix out of the possible options? I chose this fix because it does not require bundler have an opinion on _how_ rubocop is configured.
…indirect [CLI::Gem] Add a --rubocop option Based upon #6451. ### What was the end-user problem that led to this PR? The problem was I always have to remember how to add RuboCop to my Rakefile when I set up a new gem. ### What was your diagnosis of the problem? My diagnosis was that RuboCop has become enough of a community standard that it makes sense to offer it in `bundle gem`. ### What is your fix for the problem, implemented in this PR? My fix adds an option to `bundle gem` to add in RuboCop, in the same way options like `:coc`and `:mit` are handled. ### Why did you choose this fix out of the possible options? I chose this fix because it does not require bundler have an opinion on _how_ rubocop is configured.
Any feedback on this? |
I would personally fix the problem by using Maybe a separate file aligns us with the standard |
6455: [CLI::Gem] Add a --rubocop option r=deivid-rodriguez a=segiddins Based upon #6451. ### What was the end-user problem that led to this PR? The problem was I always have to remember how to add RuboCop to my Rakefile when I set up a new gem. ### What was your diagnosis of the problem? My diagnosis was that RuboCop has become enough of a community standard that it makes sense to offer it in `bundle gem`. ### What is your fix for the problem, implemented in this PR? My fix adds an option to `bundle gem` to add in RuboCop, in the same way options like `:coc`and `:mit` are handled. ### Why did you choose this fix out of the possible options? I chose this fix because it does not require bundler have an opinion on _how_ rubocop is configured. Co-authored-by: Samuel Giddins <[email protected]>
What was the end-user problem that led to this PR?
The problem was the
bundle gem
template generates agemspec
file that manipulates$LOAD_PATH
, which can lead to unexpected behavior.What was your diagnosis of the problem?
My diagnosis was we should continue storing the version in a single place, but one that is not a ruby file.
What is your fix for the problem, implemented in this PR?
My fix puts the version in a
VERSION
file in the top level of the generated repo. That file is then read by both the gemspec andversion.rb
.Why did you choose this fix out of the possible options?
I chose this fix because the alternatives seemed like string parsing
version.rb
, and string parsing is best avoided.This will also make tooling around version management easier, as it's easier to manipulate a plain text file that contains only the version than an entire ruby file.