Skip to content

Commit 524b5fe

Browse files
committed
Pregenerate bin/ruby and bin/ruby.bat
This modifies our bin/ruby script to be exactly the same as the bin/jruby.sh script, in order to avoid shipping symlinks in our dist archives. This also avoids traversing a symlink when running the `ruby` command instead of `jruby`. This also introduces bin/ruby.bat that relaunches from bin/jruby.exe. These fixes are intended to avoid requiring workarounds as described in jruby/jruby-launcher#29 here: jruby/jruby-launcher#29 (comment)
1 parent 63db5b3 commit 524b5fe

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

bin/ruby

Lines changed: 0 additions & 1 deletion
This file was deleted.

bin/ruby.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REM Relaunch with jruby.exe
2+
@ECHO OFF
3+
@\"%~dp0jruby.exe\" %*

core/pom.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@
295295
])
296296
end
297297

298-
copy_goal = [:exec, :executable => '/bin/sh', :arguments => ['-c', 'cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/jruby']]
298+
copy_goal = [:exec, :executable => '/bin/sh', :arguments => ['-c', 'cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/jruby ; cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/ruby']]
299299

300300
profile :clean do
301301
activation do
@@ -350,6 +350,7 @@
350350

351351
activation do
352352
file( :missing => '../bin/jruby' )
353+
file( :missing => '../bin/ruby' )
353354
end
354355
activation do
355356
# hack to get the os triggeer into the model

core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ DO NOT MODIFY - GENERATED CODE
670670
<executable>/bin/sh</executable>
671671
<arguments>
672672
<argument>-c</argument>
673-
<argument>cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/jruby</argument>
673+
<argument>cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/jruby ; cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/ruby</argument>
674674
</arguments>
675675
</configuration>
676676
</execution>
@@ -760,7 +760,7 @@ DO NOT MODIFY - GENERATED CODE
760760
<executable>/bin/sh</executable>
761761
<arguments>
762762
<argument>-c</argument>
763-
<argument>cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/jruby</argument>
763+
<argument>cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/jruby ; cp ${jruby.basedir}/bin/jruby.sh ${jruby.basedir}/bin/ruby</argument>
764764
</arguments>
765765
</configuration>
766766
</execution>

lib/pom.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,8 @@ def installer.ensure_required_ruby_version_met; end
423423
jruby_complete = ctx.project.properties.get_property( 'jruby.complete.home' )
424424
FileUtils.cp( File.join( jruby_complete, 'bin', 'jruby.sh' ),
425425
File.join( jruby_complete, 'bin', 'jruby' ) )
426+
FileUtils.cp( File.join( jruby_complete, 'bin', 'jruby.sh' ),
427+
File.join( jruby_complete, 'bin', 'ruby' ) )
426428
end
427429

428430
execute 'jrubydir', 'prepare-package' do |ctx|

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy