Skip to content

Commit b9c3574

Browse files
committed
Update bin
1 parent 54c7a78 commit b9c3574

File tree

7 files changed

+108
-0
lines changed

7 files changed

+108
-0
lines changed

bin/bundle

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
# ignored by Ruby interpreter
3+
4+
# get the absolute path of the executable and resolve symlinks
5+
SELF_PATH=$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")
6+
while [ -h "$SELF_PATH" ]; do
7+
# 1) cd to directory of the symlink
8+
# 2) cd to the directory of where the symlink points
9+
# 3) get the pwd
10+
# 4) append the basename
11+
DIR=$(dirname "$SELF_PATH")
12+
SYM=$(readlink "$SELF_PATH")
13+
SELF_PATH=$(cd "$DIR" && cd "$(dirname "$SYM")" && pwd)/$(basename "$SYM")
14+
done
15+
exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
16+
17+
#!ruby
18+
# ^ marks start of Ruby interpretation
19+
20+
# from libexec/bundler (not libexec/bundle)
21+
22+
# Exit cleanly from an early interrupt
23+
Signal.trap("INT") do
24+
Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
25+
exit 1
26+
end
27+
28+
require "bundler"
29+
# Check if an older version of bundler is installed
30+
$LOAD_PATH.each do |path|
31+
next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
32+
err = String.new
33+
err << "Looks like you have a version of bundler that's older than 0.9.\n"
34+
err << "Please remove your old versions.\n"
35+
err << "An easy way to do this is by running `gem cleanup bundler`."
36+
abort(err)
37+
end
38+
39+
require "bundler/friendly_errors"
40+
Bundler.with_friendly_errors do
41+
require "bundler/cli"
42+
43+
# Allow any command to use --help flag to show help for that command
44+
help_flags = %w[--help -h]
45+
help_flag_used = ARGV.any? {|a| help_flags.include? a }
46+
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
47+
48+
Bundler::CLI.start(args, :debug => true)
49+
end

bin/bundler

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
# ignored by Ruby interpreter
3+
4+
# get the absolute path of the executable and resolve symlinks
5+
SELF_PATH=$(cd "$(dirname "$0")" && pwd -P)/$(basename "$0")
6+
while [ -h "$SELF_PATH" ]; do
7+
# 1) cd to directory of the symlink
8+
# 2) cd to the directory of where the symlink points
9+
# 3) get the pwd
10+
# 4) append the basename
11+
DIR=$(dirname "$SELF_PATH")
12+
SYM=$(readlink "$SELF_PATH")
13+
SELF_PATH=$(cd "$DIR" && cd "$(dirname "$SYM")" && pwd)/$(basename "$SYM")
14+
done
15+
exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
16+
17+
#!ruby
18+
# ^ marks start of Ruby interpretation
19+
20+
# from libexec/bundler
21+
22+
# Exit cleanly from an early interrupt
23+
Signal.trap("INT") do
24+
Bundler.ui.debug("\n#{caller.join("\n")}") if defined?(Bundler)
25+
exit 1
26+
end
27+
28+
require "bundler"
29+
# Check if an older version of bundler is installed
30+
$LOAD_PATH.each do |path|
31+
next unless path =~ %r{/bundler-0\.(\d+)} && $1.to_i < 9
32+
err = String.new
33+
err << "Looks like you have a version of bundler that's older than 0.9.\n"
34+
err << "Please remove your old versions.\n"
35+
err << "An easy way to do this is by running `gem cleanup bundler`."
36+
abort(err)
37+
end
38+
39+
require "bundler/friendly_errors"
40+
Bundler.with_friendly_errors do
41+
require "bundler/cli"
42+
43+
# Allow any command to use --help flag to show help for that command
44+
help_flags = %w[--help -h]
45+
help_flag_used = ARGV.any? {|a| help_flags.include? a }
46+
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
47+
48+
Bundler::CLI.start(args, :debug => true)
49+
end

bin/irb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
1717
#!ruby
1818
# ^ marks start of Ruby interpretation
1919

20+
# from libexec/irb
21+
2022
#
2123
# irb.rb - interactive ruby
2224
# $Release Version: 0.9.6 $

bin/rdoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
1717
#!ruby
1818
# ^ marks start of Ruby interpretation
1919

20+
# from libexec/rdoc
21+
2022
#
2123
# RDoc: Documentation tool for source code
2224
# (see lib/rdoc/rdoc.rb for more information)

bin/ri

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ exec "$(dirname $SELF_PATH)/ruby" "$SELF_PATH" "$@"
1717
#!ruby
1818
# ^ marks start of Ruby interpretation
1919

20+
# from libexec/ri
21+
2022
begin
2123
gem 'rdoc'
2224
rescue NameError => e # --disable-gems

mx.truffleruby/mx_truffleruby.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ def ruby_testdownstream_sulong(args):
145145
'truffleruby:TRUFFLERUBY_GRAALVM_SUPPORT',
146146
],
147147
provided_executables=[
148+
'bin/bundle',
149+
'bin/bundler',
148150
'bin/gem',
149151
'bin/irb',
150152
'bin/rake',

mx.truffleruby/suite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@
384384
"LICENSE_TRUFFLERUBY.md": "file:LICENCE.md",
385385
"3rd_party_licenses_truffleruby.txt": "file:3rd_party_licenses.txt",
386386
"bin/": [
387+
"file:bin/bundle",
388+
"file:bin/bundler",
387389
"file:bin/gem",
388390
"file:bin/irb",
389391
"file:bin/rake",

0 commit comments

Comments
 (0)