Skip to content

Support for Gemfiles with arbitrary ruby code #15

@gsaslis

Description

@gsaslis

Hi folks 👋

I am looking for a solution that allows me to parse the dependencies of some ruby project that uses bundler and Gemfileparser looks promising.

What Happened

I tried running against https://github.com/3scale/porta/blob/master/Gemfile , but I only get 2 results:

development :
runtime :
	 <gemfileparser.Dependency object at 0x10457f2e0>
	 <gemfileparser.Dependency object at 0x10457f370>
dependency :
test :
production :
metrics :

Presumably this is because https://github.com/3scale/porta/blob/master/Gemfile#L3 includes another Gemfile.

What I Expected to Happen

I would like the list of results to include both the results in Gemfile, but also those from Gemfile.base.

Potential Solutions Considered

I am wondering if you have already considered parsing Gemfile.lock rather than Gemfile, as a way of parsing a more standard format that doesn't, essentially, require Gemfileparser to support evaluating arbitrary ruby code (this would open up to a series of other issues).

Of course, parsing just Gemfile.lock would mean no support for dependency groups, but perhaps that is an acceptable tradeoff.. ?

Any thoughts on this topic?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions