Created
August 18, 2010 00:49
-
-
Save chebyte/532846 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
#install rake: sake -i apt.rake apt:plugins:install | |
#sake apt:plugins:install set=common #=> installs using script/plugin install | |
#sake apt:plugins:install set=common method=external # => installas using script/plugin install -x | |
#sake apt:plugins:install set=common method=clone # => installs via git clone | |
namespace :apt do | |
namespace :plugins do | |
desc "instala plugins de forma automatica con apt para rails :)" | |
task :install do | |
sets = { | |
:auto_admin => { | |
:administrate_me => "git://github.com/insignia/administrate_me.git", | |
}, | |
:auth => { | |
:restful_authentication => "git://github.com/technoweenie/restful-authentication.git", | |
:role_requirement => "git://github.com/timcharper/role_requirement.git" | |
}, | |
:common => { | |
:asset_packager => "git://github.com/sbecker/asset_packager.git" | |
:paperclip => "git://github.com/thoughtbot/paperclip.git", | |
:will_paginate => "git://github.com/mislav/will_paginate.git", | |
:annotate_models => "git://github.com/collectiveidea/annotate_models.git", | |
:exception_notification => "git://github.com/rails/exception_notification.git", | |
}, | |
} | |
raise "Debes especificar set=[#{sets.keys.join(",")}]" unless sets.keys.map{|k|k.to_s}.include?(ENV['set']) | |
set = sets[ENV['set'].to_sym] | |
plugins = set.to_a.map | |
text = set.to_a.map{|a|a.first}.join("\n * ") | |
run_method = ENV['pretend'] == "true" ? :p : :system | |
install_method = (ENV['method'] || "rails").to_sym | |
set.each do |name,url| | |
if install_method == :clone | |
send run_method, "git clone #{url} vendor/plugins/#{name} && rm -rf vendor/plugins/#{name}/.git" | |
elsif install_method == :external | |
send run_method, "script/plugin install #{url} -x" | |
else | |
send run_method, "script/plugin install #{url} --force" | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment