Skip to content

Instantly share code, notes, and snippets.

@lardcanoe
Created September 30, 2014 16:50
Show Gist options
  • Save lardcanoe/7188f396aab80f1d2fba to your computer and use it in GitHub Desktop.
Save lardcanoe/7188f396aab80f1d2fba to your computer and use it in GitHub Desktop.
Require tasks from all gems in a group from a Gemfile
group :engines do
gem 'my_engine'
gem 'another_engine'
end
# Needed a way to require rake tasks for any gem in the :engines group
Bundler.definition.dependencies.each do |dep|
if dep.groups.any?{ |g| g == :engines }
require "#{dep.name}/tasks"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment