Rakefile in sensible-cinema-0.14.6 vs Rakefile in sensible-cinema-0.15.0
- old
+ new
@@ -40,11 +40,15 @@
def get_transitive_dependencies dependencies
new_dependencies = []
dependencies.each{|d|
gem d.name # make sure it's loaded so that it'll be in Gem.loaded_specs
- dependency_spec = Gem.loaded_specs.select{|name, spec| name == d.name}[0][1]
+ begin
+ dependency_spec = Gem.loaded_specs.select{|name, spec| name == d.name}[0][1]
+ rescue
+ raise 'possibly dont have that gem are you running jruby for sure?' + d.name
+ end
transitive_deps = dependency_spec.runtime_dependencies
new_dependencies << transitive_deps
}
new_dependencies.flatten
end
@@ -61,23 +65,25 @@
Gem.loaded_specs.select{|name, spec| name == 'os'}
FileUtils.rm_rf 'vendor/cache'
Dir.mkdir 'vendor/cache'
Dir.chdir 'vendor/cache' do
dependencies.each{|d|
- system("gem unpack #{d.name}")
+ system("#{Gem.ruby} -S gem unpack #{d.name}")
}
# add imagemagick
+ puts 'copying in imagemagick'
Dir.mkdir 'imagemagick'
- im_dir = RubyWhich.new.which('identify').select{|dir| dir =~ /ImageMagick/}[0]
+ im_identify_command = RubyWhich.new.which('identify').select{|dir| dir =~ /ImageMagick/}[0]
# "d:\\installs\\ImageMagick-6.6.2-Q16\\identify.EXE",
- Dir["#{File.dirname im_dir}/*"].each{|file|
- FileUtils.cp(file, 'imagemagick') rescue nil # some fail for some odd reason
+ Dir["#{File.dirname im_identify_command}/*"].each{|file|
+ FileUtils.cp_r(file, 'imagemagick') rescue nil # some fail for some odd reason
}
-
+ puts 'downloading in jruby-complete.jar file'
# jruby complete .jar file
Net::HTTP.start("jruby.org.s3.amazonaws.com") { |http|
resp = http.get("/downloads/1.5.5/jruby-complete-1.5.5.jar")
+ puts 'copying... '
open("jruby-complete-1.5.5.jar", "wb") { |file|
file.write(resp.body)
}
}
# create a shunt win32ole file, so that require 'win32ole' will work.
@@ -92,13 +98,15 @@
task 'create_distro_dir' do
raise 'need bundle_dependencies first' unless File.directory? 'vendor/cache'
require 'fileutils'
spec = eval File.read('sensible-cinema.gemspec')
dir_out = spec.name + "-" + spec.version.version + '/sensible-cinema'
- FileUtils.rm_rf dir_out + '/..' # in case it exists
+ FileUtils.rm_rf Dir['sensible-cinema-*'] # remove old versions
+ raise 'unable to delete' if Dir[spec.name + '-*'].length > 0
+
existing = Dir['*']
FileUtils.mkdir_p dir_out
FileUtils.cp_r(existing, dir_out)
# this one belongs in the trunk
FileUtils.cp("#{dir_out}/run_sensible_cinema.bat", "#{dir_out}/..")
- p 'created ' + dir_out
+ p 'created (still need to zip it) ' + dir_out
end