Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 856 Bytes
require "rake"
require "rake/clean"
require "rake/gempackagetask"
require 'rubygems'
################################################################################
### Gem
################################################################################
begin
# Parse gemspec using the github safety level.
file = Dir['*.gemspec'].first
data = File.read(file)
spec = nil
Thread.new { spec = eval("$SAFE = 3\n%s" % data)}.join
# Create the gem tasks
Rake::GemPackageTask.new(spec) do |package|
package.gem_spec = spec
end
rescue Exception => e
printf "WARNING: Error caught (%s): %s\n%s", e.class.name, e.message, e.backtrace[0...5].map {|l| ' %s' % l}.join("\n")
end
desc 'Package and install the gem for the current version'
task :install => :gem do
system "sudo gem install -l pkg/%s-%s.gem" % [spec.name, spec.version]
end
Jump to Line
Something went wrong with that request. Please try again.