Rakefile in crypt-fog-1.0.1 vs Rakefile in crypt-fog-1.0.2

- old
+ new

@@ -1,31 +1,31 @@ require 'rake' require 'rake/testtask' -include Config +require 'rake/clean' -desc "Install the crypt-fog package (non-gem) and the fogenc program" -task :install do - dest = File.join(CONFIG['sitelibdir'], 'crypt') - Dir.mkdir(dest) unless File.exists? dest - cp 'lib/crypt/fog.rb', dest, :verbose => true - cp 'bin/fogenc', CONFIG['bindir'], :verbose => true -end +CLEAN.include("*.gem", "*.rbc") -desc "Install the crypt-fog library (non-gem) only" -task :install_lib do - dest = File.join(CONFIG['sitelibdir'], 'crypt') - Dir.mkdir(dest) unless File.exists? dest - cp 'lib/crypt/fog.rb', dest, :verbose => true -end +namespace :gem do + desc 'Build the crypt-fog gem' + task :create => [:clean] do + spec = eval(IO.read('crypt-fog.gemspec')) + require 'rubygems/package' + if Gem::VERSION < "2.0" + Gem::Builder.new(spec).build + else + Gem::Package.build(spec) + end + end -desc "Install the crypt-fog package as a gem" -task :install_gem do - ruby 'crypt-fog.gemspec' - file = Dir["*.gem"].first - sh "gem install #{file}" + desc 'Install the crypt-fog library as a gem' + task :install => [:create] do + file = Dir["*.gem"].first + sh "gem install -l #{file}" + end end Rake::TestTask.new do |t| - t.libs << 'lib' - t.warning = true - t.test_files = FileList['test/tc*'] + t.warning = true + t.verbose = true end + +task :default => :test