Skip to content

Commit

Permalink
Improve Rakefile
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurnn committed Oct 10, 2013
1 parent a25ed17 commit 0644da0
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'rake'
require 'rake/testtask'
require 'rubygems/package_task'
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require "liquid/version"

task :default => 'test'

Expand All @@ -29,14 +27,20 @@ task :test do
Rake::Task['base_test'].invoke
end

gemspec = eval(File.read('liquid.gemspec'))
Gem::PackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
task :gem => :build
task :build do
system "gem build liquid.gemspec"
end

task :install => :build do
system "gem install liquid-#{Liquid::VERSION}.gem"
end

desc "Build the gem and release it to rubygems.org"
task :release => :gem do
sh "gem push pkg/liquid-#{gemspec.version}.gem"
task :release => :build do
system "git tag -a v#{Liquid::VERSION} -m 'Tagging #{Liquid::VERSION}'"
system "git push --tags"
system "gem push liquid-#{Liquid::VERSION}.gem"
system "rm liquid-#{Liquid::VERSION}.gem"
end

namespace :benchmark do
Expand Down

0 comments on commit 0644da0

Please sign in to comment.