Skip to content

Instantly share code, notes, and snippets.

@rboyd
Created February 9, 2011 05:20
Show Gist options
  • Select an option

  • Save rboyd/817927 to your computer and use it in GitHub Desktop.

Select an option

Save rboyd/817927 to your computer and use it in GitHub Desktop.
converts Gemfile gems to chef recipe format
#!/usr/bin/ruby
gems_list = Array.new
ARGF.each do |line|
md = /.*\"([^\"]+)\".*(\"[^\"]+\")/.match(line)
gem_name = md.captures[0]
version = md.captures[1]
puts "gem_package \"#{gem_name}\" do\n version #{version}\nend\n\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment