2014-12-15 19:44:51 +00:00
|
|
|
require "rubygems/package_task"
|
2010-07-28 19:30:56 +00:00
|
|
|
|
|
|
|
namespace :gem do
|
|
|
|
|
2014-12-15 19:44:51 +00:00
|
|
|
desc "Build the gem"
|
|
|
|
task :build do
|
|
|
|
system "gem build signet.gemspec"
|
2011-11-16 12:21:22 +00:00
|
|
|
end
|
|
|
|
|
2014-12-15 19:44:51 +00:00
|
|
|
desc "Install the gem"
|
|
|
|
task :install => ["clobber", "gem:package"] do
|
2010-07-28 19:30:56 +00:00
|
|
|
sh "#{SUDO} gem install --local pkg/#{GEM_SPEC.full_name}"
|
|
|
|
end
|
|
|
|
|
2014-12-15 19:44:51 +00:00
|
|
|
desc "Uninstall the gem"
|
2010-07-28 19:30:56 +00:00
|
|
|
task :uninstall do
|
|
|
|
installed_list = Gem.source_index.find_name(PKG_NAME)
|
|
|
|
if installed_list &&
|
|
|
|
(installed_list.collect { |s| s.version.to_s}.include?(PKG_VERSION))
|
|
|
|
sh(
|
|
|
|
"#{SUDO} gem uninstall --version '#{PKG_VERSION}' " +
|
|
|
|
"--ignore-dependencies --executables #{PKG_NAME}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-12-15 19:44:51 +00:00
|
|
|
desc "Reinstall the gem"
|
2010-07-28 19:30:56 +00:00
|
|
|
task :reinstall => [:uninstall, :install]
|
|
|
|
end
|
|
|
|
|
2014-12-15 19:44:51 +00:00
|
|
|
desc "Alias to gem:package"
|
|
|
|
task "gem" => "gem:package"
|
2012-02-10 14:49:52 +00:00
|
|
|
|
2014-12-15 19:44:51 +00:00
|
|
|
task "clobber" => ["gem:clobber_package"]
|