gem_dating
gem_dating copied to clipboard
use bundler to parse the Gemfile?
Is there any particular reason to avoid having Bundler itself parse the gemfile? Bundler is already a runtime dependency of gem_dating
I think you could do something like the following at minimum
bundler_defintion = ::Bundler::Definition.build(path_to_gemfile, nil, nil)
result = GemDating::Result.new(bundler_definition.specs.map(&:name))
Correction - bundler_definition.specs will return ALL the resolved spec tree, I think what you would want is bundler_definition.dependencies
I agree that Bundler should be our first stop for validating a Gemfile!
When we discussed, other options came up first. Namely, using bundler outdated, or other gems like libyear-bundler.
We specifically wanted to avoid needing a valid Bundler definition, or even a parsable Gemfile. We wanted to avoid getting blocked by setting up really old rubies, gems that were privately hosted, or missing for other reasons (ex: Mimemagic pulling gems).
I'll update the readme with a section that highlights that better!
Totally understandable, bundler does do a bunch of other things under the covers.