synvert-ruby icon indicating copy to clipboard operation
synvert-ruby copied to clipboard

Do we really need to require the bundler?

Open bibendi opened this issue 1 year ago • 3 comments

Hi! Do we really need to require the bundler here? https://github.com/synvert-hq/synvert-ruby/blob/03e942d543b2fd8c9f7863f11ac4e675c97254fc/lib/synvert.rb#L4 It is not in the gemspec list, actually.

We want to get the list of snippets by running synvert-ruby --list --format json and get the following output

Resolving dependencies...
[{"group":"rails-template","name":"prepare", blablabla

which breaks JSON.parse

Even if we run synvert-ruby -v we get

Resolving dependencies...
1.10.3 (with synvert-core 2.0.1)

bibendi avatar May 30 '24 09:05 bibendi

@bibendi I don't need to require the bundler here, yes, I will remove it.

But I do need bundler to parse gem versions in synvert-core-ruby https://github.com/synvert-hq/synvert-core-ruby/blob/main/lib/synvert/core/rewriter/gem_spec.rb#L35, so even I remove the line here, it may still get "Resolving dependencies..." in output when analyzing code.

I think it's a bug in the bunlder.

flyerhzm avatar May 30 '24 11:05 flyerhzm

But I do need bundler to parse gem versions in synvert-core-ruby

But it is only used in tests? It shouldn't affect the running of synvert itself, should it?

mehanoid avatar May 30 '24 12:05 mehanoid

@mehanoid no, it's not for test, synvert has a dsl if_gem, it will check if the current gem version matches, and I use bundler gem to read Gemfile.lock to get current gem versions.

flyerhzm avatar May 30 '24 14:05 flyerhzm