Created
June 28, 2010 06:49
-
-
Save eric/455520 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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