summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorElvin Efendi <elvin.efendiyev@gmail.com>2016-01-04 11:00:14 -0500
committerElvin Efendi <elvin.efendiyev@gmail.com>2016-01-04 11:00:14 -0500
commite41f7b429901eb38ad785ad1fc2527dd41f35959 (patch)
tree02ba46c4f7d43b5721f3eb7de38599e0e019e5cf /Rakefile
parentef1a59d2b29df5b00246ee34eba96b0cf4927fa2 (diff)
parentf339170c877ca296987d66c0c44223a8cad1d338 (diff)
Merge pull request #17 from Shopify/merge-upstream
Merge upstream
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
index 2dc5415..3a1be5e 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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