Skip to content

Instantly share code, notes, and snippets.

@rossta
Created October 13, 2011 11:42
Show Gist options
  • Select an option

  • Save rossta/1284035 to your computer and use it in GitHub Desktop.

Select an option

Save rossta/1284035 to your computer and use it in GitHub Desktop.
Custom gem method for local using gems locally (courtesy of ruby-amqp)
# Use local clones if possible.
# If you want to use your local copy, just symlink it to vendor.
def custom_gem(name, options = Hash.new)
local_path = File.expand_path("../vendor/#{name}", __FILE__)
if File.exist?(local_path)
gem name, options.merge(:path => local_path).delete_if { |key, _| [:git, :branch].include?(key) }
else
gem name, options
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment