Sha256: 6713e8e419c4a6454f6074b01b8f227d8df92642ac24d36a34522e55394ce1b4
Contents?: true
Size: 1.45 KB
Versions: 4
Compression:
Stored size: 1.45 KB
Contents
# frozen_string_literal: true require 'rubygems' require 'fileutils' # Running JRuby on OS X requires options passed at the start. To pass those # options and avoid double JVM startup, we want 'shoes' to be a bash script on # Unix systems, but Rubygems only supports installing Ruby to the bin. # We work around this by installing our script as shoes-stub, then acting like # a "native extension" via this Rakefile, we manually generate the right script # (a copy of shoes-stub) in the Gem.bindir. # Because we don't actually declare shoes as an executable, we also have to # copy our shoes.bat into place as well on Windows systems. # We also provide a Rubygems plugin to clean up our manual file on uninstall. # Post-install hooks didn't seem to work, though, hence the extension trick. task default: ['install_script'] task :install_script do # If we're run via jruby-complete.jar, bindir is within the jar itself so # look for bin based on user directory. Otherwise, prefer Gem.bindir. dest_dir = if Gem.bindir.start_with?("uri:classloader") Gem.bindir(Gem.user_dir) else Gem.bindir end if Gem.win_platform? source_path = File.join(Dir.pwd, "shoes.bat") dest_path = File.join(dest_dir, "shoes.bat") else source_path = File.join(Dir.pwd, "..", "..", "bin", "shoes-stub") dest_path = File.join(dest_dir, "shoes") end FileUtils.mkdir_p(dest_dir) FileUtils.cp(source_path, dest_path) end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
shoes-4.0.0.pre12 | ext/install/Rakefile |
shoes-4.0.0.pre11 | ext/install/Rakefile |
shoes-4.0.0.pre10 | ext/install/Rakefile |
shoes-4.0.0.pre9 | ext/install/Rakefile |