Rakefile in win32-event-0.5.1 vs Rakefile in win32-event-0.5.2

- old
+ new

@@ -1,19 +1,28 @@ require 'rake' require 'rake/testtask' require 'rbconfig' include Config -desc 'Install the win32-event package (non-gem)' -task :install do - sitelibdir = CONFIG['sitelibdir'] - installdir = File.join(sitelibdir, 'win32') - file = 'lib\win32\event.rb' +namespace 'gem' do + desc 'Remove existing .gem file from the current directory' + task :clean do + Dir['*.gem'].each{ |f| File.delete(f) } + end - Dir.mkdir(installdir) unless File.exists?(installdir) - FileUtils.cp(file, installdir, :verbose => true) + desc 'Create the win32-event gem' + task :create do + spec = eval(IO.read('win32-event.gemspec')) + Gem::Builder.new(spec).build + end + + desc 'Install the win32-event gem' + task :install => [:clean, :create] do + file = Dir['*.gem'].first + sh "gem install #{file}" + end end Rake::TestTask.new do |t| - t.verbose = true - t.warning = true + t.verbose = true + t.warning = true end