Rakefile in jmongo-1.1.1 vs Rakefile in jmongo-1.1.2
- old
+ new
@@ -34,10 +34,14 @@
def replace_header(head, header_name)
head.sub!(/(\.#{header_name}\s*= ').*'/) { "#{$1}#{send(header_name)}'"}
end
+def jruby?
+ RUBY_PLATFORM.to_s == 'java'
+end
+
#############################################################################
#
# Custom tasks
#
#############################################################################
@@ -63,10 +67,19 @@
end
sh "git commit --allow-empty -a -m 'Release #{version}'"
sh "git tag v#{version}"
sh "git push origin master"
sh "git push origin v#{version}"
- sh "gem push pkg/#{name}-#{version}.gem"
+
+ command = "gem push pkg/#{name}-#{version}.gem"
+
+ if jruby?
+ puts "--------------------------------------------------------------------------------------"
+ puts "can't push to rubygems using jruby at the moment, so switch to mri and run: #{command}"
+ puts "--------------------------------------------------------------------------------------"
+ else
+ sh command
+ end
end
desc "Build #{gem_file} into the pkg directory"
task :build => :gemspec do
sh "mkdir -p pkg"