Why use GemSpec + GemFile when checking dependencies?

Whenever you develop gems, I see no reason why the Gemfile is not tested directly for dependencies.

In fact, why use a .gemspec file to list them? Is there any real benefit?

+6
source share
1 answer

Good, because the Gemfile not a file from Rubygems, but a file from Bundler. Therefore, Rubygem developers would have to expand the files used to support the Gemfile. Since the .gemspec file already exists, there is no good reason why they should. (there are enough gems that work well without a Gemfile )

In fact, it is recommended to use gemstones as the sole content of the Gemfile :

 source 'https://rubygems.org' gemspec 

He will instruct the bundles to use the .gemspec file as the source of the gemstones.

+16
source

Source: https://habr.com/ru/post/919527/


All Articles