Skip to content

Commit

Permalink
adding a task to generate gems, and a conditional to the gemspec for …
Browse files Browse the repository at this point in the history
…windows machines
  • Loading branch information
tenderlove authored and timcharper committed May 27, 2011
1 parent 5aecd06 commit d8a9a42
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Rakefile
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions spork.gemspec
Expand Up @@ -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
Expand Down

0 comments on commit d8a9a42

Please sign in to comment.