Skip to content

Instantly share code, notes, and snippets.

@jh3
Created October 13, 2010 19:29
Show Gist options
  • Save jh3/624706 to your computer and use it in GitHub Desktop.
Save jh3/624706 to your computer and use it in GitHub Desktop.
# This will search your config/deploy folder for *.rb files
# and add the basename without the extension to :stages.
#
# Now you don't need something like "set :stages, %w(dev prod stage)"
set(:stages) do
Dir[File.join('config', 'deploy') + '/*.rb'].map do |f|
f.match(/[^\/]+?(?=\.[^\/]+$)/)[0]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment