For example, in Ruby we did a class called Dispatcher. This class has the responsibility to render the detected features. This class get the Gemfile path and pass it on to Parser class that gets the gems with their versions.
The whole architecture of how of doing things, i leave that to your criteria. You can add more tasks if you find it necessary.