lib/ruboto/util/update.rb in ruboto-0.5.3 vs lib/ruboto/util/update.rb in ruboto-0.5.4
- old
+ new
@@ -132,18 +132,27 @@
end
def update_jruby(force=nil)
jruby_core = Dir.glob("libs/jruby-core-*.jar")[0]
jruby_stdlib = Dir.glob("libs/jruby-stdlib-*.jar")[0]
- new_jruby_version = JRubyJars::VERSION
unless force
if !jruby_core || !jruby_stdlib
puts "Cannot find existing jruby jars in libs. Make sure you're in the root directory of your app."
return false
end
+ end
+ begin
+ require 'jruby-jars'
+ rescue LoadError
+ puts "Could not find the jruby-jars gem. You need it to include JRuby in your app. Please install it using\n\n gem install jruby-jars\n\n"
+ return false
+ end
+ new_jruby_version = JRubyJars::VERSION
+
+ unless force
current_jruby_version = jruby_core ? jruby_core[16..-5] : "None"
if current_jruby_version == new_jruby_version
puts "JRuby is up to date at version #{new_jruby_version}. Make sure you 'gem update jruby-jars' if there is a new version."
return false
end
@@ -177,11 +186,11 @@
if File.exists? old_scripts_dir
FileUtils.mv Dir["#{old_scripts_dir}/*"], SCRIPTS_DIR
FileUtils.rm_rf old_scripts_dir
end
# FIXME end
-
+
end
def update_icons(force = nil)
copier = Ruboto::Util::AssetCopier.new Ruboto::ASSETS, '.', force
log_action('icons') do
@@ -349,10 +358,10 @@
# Uncomment this section to get a jar for each top level package in the core
#Dir['**/*'].select{|f| !File.directory?(f)}.map{|f| File.dirname(f)}.uniq.sort.reverse.each do |dir|
# `jar -cf ../jruby-core-#{dir.gsub('/', '.')}-#{jruby_core_version}.jar #{dir}`
# FileUtils.rm_rf dir
#end
-
+
`jar -cf ../#{jruby_core} .`
end
FileUtils.remove_dir "tmp", true
end
end