Permalink
Browse files

Add Gem::PackageTask and `rake install` task

  • Loading branch information...
brynary committed Oct 2, 2011
1 parent 48c6234 commit a6d51650df77f74d4e0bb5cd3bf213a91f733df3
Showing with 13 additions and 3 deletions.
  1. +1 −1 .gitignore
  2. +12 −2 Rakefile
View
@@ -1,3 +1,3 @@
tmp
lib/melbourne.bundle
-melbourne-*.gem
+pkg/
View
@@ -1,4 +1,14 @@
-require 'rake/extensiontask'
+require "rake/extensiontask"
+require "rubygems/package_task"
-desc 'Compile the C extension'
+desc "Compile the C extension"
Rake::ExtensionTask.new('melbourne')
+
+gemspec = eval(File.read("melbourne.gemspec"))
+desc "Build the gem"
+Gem::PackageTask.new(gemspec).define
+
+desc "Install the gem"
+task :install => :repackage do
+ sh "gem install pkg/melbourne-*.gem"
+end

0 comments on commit a6d5165

Please sign in to comment.