Skip to content
Browse files

adding a task to generate gems, and a conditional to the gemspec for …

…windows machines
  • Loading branch information...
1 parent 5aecd06 commit d8a9a42bad52186b781199b77857113cc832a0d6 @tenderlove tenderlove committed with timcharper
Showing with 25 additions and 0 deletions.
  1. +16 −0 Rakefile
  2. +9 −0 spork.gemspec
View
16 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
View
9 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

0 comments on commit d8a9a42

Please sign in to comment.
Something went wrong with that request. Please try again.