From 06e5f68db6cfcbd80295874db1f00a25e8ba1229 Mon Sep 17 00:00:00 2001 From: Saku Ytti Date: Thu, 20 Feb 2014 15:31:26 +0200 Subject: Figure out which parent class we rescued Rakefile changes Bump up gemspec version --- Rakefile | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 6801079..2e3c604 100644 --- a/Rakefile +++ b/Rakefile @@ -1,35 +1,47 @@ begin + require 'rake/testtask' require 'bundler' - require 'rspec/core/rake_task' Bundler.setup rescue LoadError - warn 'missing dependencies' + warn 'bunler missing' exit 42 end gemspec = eval(File.read(Dir['*.gemspec'].first)) +file = [gemspec.name, gemspec.version].join('-') + '.gem' -desc 'Validate the gemspec' +desc 'Validate gemspec' task :gemspec do gemspec.validate end -RSpec::Core::RakeTask.new(:spec) +desc 'Run minitest' +task :test do + Rake::TestTask.new do |t| + t.libs.push "lib" + t.test_files = FileList['spec/*_spec.rb'] + t.verbose = true + end +end -desc "Build gem locally" -#task :build => [:spec, :gemspec] do -task :build => [:gemspec] do +desc 'Build gem' +task :build do system "gem build #{gemspec.name}.gemspec" - FileUtils.mkdir_p "gems" - FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "gems" + FileUtils.mkdir_p 'gems' + FileUtils.mv file, 'gems' end -desc "Install gem locally" +desc 'Install gem' task :install => :build do - system "sudo sh -c \'umask 022; gem install gems/#{gemspec.name}-#{gemspec.version}\'" + system "sudo -E sh -c \'umask 022; gem install gems/#{file}\'" end -desc "Clean automatically generated files" +desc 'Remove gems' task :clean do - FileUtils.rm_rf "gems" + FileUtils.rm_rf 'gems' +end + +desc 'Push to rubygems' +task :push do + system "gem push gems/#{file}" end -- cgit v1.2.1