Skip to content

Instantly share code, notes, and snippets.

@eric
Created June 28, 2010 06:49
Show Gist options
  • Save eric/455520 to your computer and use it in GitHub Desktop.
Save eric/455520 to your computer and use it in GitHub Desktop.
module BundlerSupport
def bundler_dependencies(options = {})
root = options.delete(:root)
# WARNING: This is highly Bundler 0.9 -specific
YAML::load_file(File.join(root, 'Gemfile.lock'))['specs'].each do |spec|
gem_name = spec.keys.first
dependent_recipe = "#{gem_name.gsub(/-/, '_')}_gem_dependencies".to_sym
if method_defined?(dependent_recipe)
recipe(dependent_recipe, options)
end
end
end
end
# If you're running bundler in moonshine
recipe :bundler_dependencies, :root => rails_root, :before => exec("rails bundler")
# If you're not running bundler in moonshine
recipe :bundler_dependencies, :root => rails_root
# Gem dependency
def typhoeus_gem_dependencies(options = {})
package 'libcurl', options.reverse_merge(:ensure => :installed)
package 'libcurl-devel', options.reverse_merge(:ensure => :installed)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment