diff options
author | Elvin Efendi <elvin.efendiyev@gmail.com> | 2016-01-04 10:47:29 -0500 |
---|---|---|
committer | Elvin Efendi <elvin.efendiyev@gmail.com> | 2016-01-04 10:47:29 -0500 |
commit | 52804b9f96a441c66cb957d001e71f48cc6a0811 (patch) | |
tree | e489c1d0a9d107be8c168b6074f259c37ce28736 /Rakefile | |
parent | 1ee130b83a28f822cdc3379c24d4965ceee86034 (diff) |
return back build related tasks
Diffstat (limited to 'Rakefile')
-rw-r--r-- | Rakefile | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -1,6 +1,14 @@ require 'bundler/gem_tasks' require 'rake/testtask' +gemspec = eval(File.read(Dir['*.gemspec'].first)) +file = [gemspec.name, gemspec.version].join('-') + '.gem' + +desc 'Validate gemspec' +task :gemspec do + gemspec.validate +end + desc 'Run minitest' task :test do Rake::TestTask.new do |t| @@ -11,4 +19,31 @@ task :test do end end +desc 'Build gem' +task :build do + system "gem build #{gemspec.name}.gemspec" + FileUtils.mkdir_p 'gems' + FileUtils.mv file, 'gems' +end + +desc 'Install gem' +task :install => :build do + system "sudo -Es sh -c \'umask 022; gem install gems/#{file}\'" +end + +desc 'Remove gems' +task :clean do + FileUtils.rm_rf 'gems' +end + +desc 'Tag the release' +task :tag do + system "git tag #{gemspec.version}" +end + +desc 'Push to rubygems' +task :push => :tag do + system "gem push gems/#{file}" +end + task default: :test |