From d8a9a42bad52186b781199b77857113cc832a0d6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson and Tim Harper Date: Thu, 26 May 2011 14:46:23 -0700 Subject: [PATCH] adding a task to generate gems, and a conditional to the gemspec for windows machines --- Rakefile | 16 ++++++++++++++++ spork.gemspec | 9 +++++++++ 2 files changed, 25 insertions(+) diff --git a/Rakefile b/Rakefile index 1861180..9016e7d 100644 --- a/Rakefile +++ b/Rakefile @@ -42,6 +42,22 @@ task :install_bundles do end end +namespace :gem do + desc "build gems for deployment to rubygems.org" + task :build do + sh "rm -f spork-*.gem" + sh "gem build spork.gemspec" + sh "env PLATFORM=x86-mingw32 gem build spork.gemspec" + sh "env PLATFORM=x86-mswin32 gem build spork.gemspec" + end + + task :push do + Dir["spork-*.gem"].each do |g| + sh "gem push #{g}" + end + end +end + # PENDING: Get this to work with gem bundler # desc "Test all supported versions of rails" # task :test_rails do diff --git a/spork.gemspec b/spork.gemspec index f55dacd..a37f326 100644 --- a/spork.gemspec +++ b/spork.gemspec @@ -22,6 +22,15 @@ Gem::Specification.new do |s| s.summary = %q{spork} s.test_files = Dir["features/**/*"] + Dir["spec/**/*"] + case ENV['PLATFORM'] + when NilClass + when "x86-mingw32", "x86-mswin32" + s.platform = ENV['PLATFORM'] + s.add_dependency('win32-process') + else + STDERR.puts "Warning: no customization for #{ENV['PLATFORM']}" + end + if s.respond_to? :specification_version then current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION s.specification_version = 3