Skip to content

Commit

Permalink
build the gem in-process
Browse files Browse the repository at this point in the history
  • Loading branch information
godfat committed Sep 28, 2013
1 parent 89df50f commit 326c5ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions gemgem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,14 @@ def gitignore

desc 'Build gem'
task :build => [:spec] do
sh("#{Gem.ruby} -S gem build #{Gemgem.spec_path}")
sh("mkdir -p #{Gemgem.pkg_dir}")
sh("mv #{Gemgem.gem_path.sub(%r{/pkg/}, '/')} #{Gemgem.pkg_dir}/")
require 'fileutils'
require 'rubygems/package'
Dir.chdir(Gemgem.dir) do
gem = Gem::Package.build(Gem::Specification.load(Gemgem.spec_path))
FileUtils.mkdir_p(Gemgem.pkg_dir)
FileUtils.mv(gem, Gemgem.pkg_dir) # gem is relative path, but might be ok
puts "\e[35mGem built: \e[33m#{Gemgem.pkg_dir}/#{gem}\e[0m"
end
end

desc 'Generate gemspec'
Expand Down

0 comments on commit 326c5ed

Please sign in to comment.