Want to parse a Gemfile? This finely does it. How you may ask? This file replicates the entire Gemfile functions (aka source, gem and group) and then executes the Gemfile in Ruby.
As it executes the Gemfile, it can potentially contain malicious Ruby code. This could import your project and perform commands and I would recommend executing it in a safe/sandbox environment. An example would be through an external server and use an API. This way it is very easy to replicate your software and it is totally harmless.
<3 Have fun.
Example Gemfile: