Extract Gemfile parsing code to a new class