Closed skalee closed 5 years ago
Alternatively, a --skip-gemspec-validation
command line option could be added.
Pros: Gemfile is free of initial development setup. Preference to skip gemspec validation is local.
Cons: This option must be somehow set in CI anyway. Hence, people will probably write it in .travis.yml
etc, making this setting not local.
Thanks for the suggestion! If you are interested in having the team possibly accept this idea, please submit a pull request containing an RFC, as described in the readme for this repository.
When I creating a new gem with Bundler, the autogenerated gemspec is not valid. It is generally expected and correct, however it prevents gem from being loaded in development.
Actual behaviour
Given freshly created gem named "store":
When I run specs with:
Then it crashes without running any test, printing following message:
Also, when I load IRB console:
It crashes with following output:
This issue is not limited to
homepage_uri
metadata. More values are invalid.Expected behaviour
No matter if all attributes in gemspec have valid values or not,
bin/console
launches IRB session, andbundle exec rspec
runs tests. Moreover, yet another test is added to the autogenerated test suite, which succeeds if and only if gemspec is all valid.Rationale
Gem validation is a good thing in general. However, in the first phases of development, I may be unwilling to fill in all the details. Possible reasons include:
Currently, Bundler requiers me to provide all the metadata in advance. But in fact, it actually encourages to either remove invalid entries, or to replace placeholders with gibberish which passes validations, "just for now". In my opinion, both are bad practices, which shouldn't be promoted.
Note that in Ruby Gems these validations can be overriden, as
gem
executable allows for building from invalid (but syntatically correct) gemspecs with--force
option. Perhaps a similar option should be added to theBundler.require
andBundler.setup
methods, e.g.:The exact synopsis is to be defined though, I'm not proficient with Bundler's internals.