Rakefile in getopt-1.4.0 vs Rakefile in getopt-1.4.1
- old
+ new
@@ -1,34 +1,40 @@
require 'rake'
+require 'rake/clean'
require 'rake/testtask'
-desc "Install the getopt package (non-gem)"
-task :install do
- dest = File.join(Config::CONFIG['sitelibdir'], 'getopt')
- Dir.mkdir(dest) unless File.exists? dest
- cp 'lib/getopt/std.rb', dest, :verbose => true
- cp 'lib/getopt/long.rb', dest, :verbose => true
-end
+CLEAN.include("**/*.gem", "**/*.rbc")
-desc "Install the getopt package as a gem"
-task :install_gem do
- ruby 'getopt.gemspec'
- file = Dir["*.gem"].first
- sh "gem install #{file}"
+namespace :gem do
+ desc "Create the getopt gem"
+ task :create => [:clean] do
+ spec = eval(IO.read('getopt.gemspec'))
+ Gem::Builder.new(spec).build
+ end
+
+ desc "Install the getopt gem"
+ task :install => [:create] do
+ file = Dir["*.gem"].first
+ sh "gem install #{file}"
+ end
end
Rake::TestTask.new do |t|
- t.warning = true
- t.verbose = true
+ t.warning = true
+ t.verbose = true
end
-Rake::TestTask.new('test_getopt_long') do |t|
- t.test_files = 'test/test_getopt_long.rb'
- t.warning = true
- t.verbose = true
-end
+namespace :test do
+ Rake::TestTask.new('getopt_long') do |t|
+ t.test_files = 'test/test_getopt_long.rb'
+ t.warning = true
+ t.verbose = true
+ end
-Rake::TestTask.new('test_getopt_std') do |t|
- t.test_files = 'test/test_getopt_std.rb'
- t.warning = true
- t.verbose = true
+ Rake::TestTask.new('getopt_std') do |t|
+ t.test_files = 'test/test_getopt_std.rb'
+ t.warning = true
+ t.verbose = true
+ end
end
+
+task :default => :test