summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
Diffstat (limited to 'libexec')
-rwxr-xr-xlibexec/bundle11
-rwxr-xr-xlibexec/erb50
-rwxr-xr-xlibexec/irb9
-rwxr-xr-xlibexec/rdoc43
-rwxr-xr-xlibexec/ri12
-rwxr-xr-xlibexec/syntax_suggest2
6 files changed, 37 insertions, 90 deletions
diff --git a/libexec/bundle b/libexec/bundle
index 90c62627f8..92387bc2cf 100755
--- a/libexec/bundle
+++ b/libexec/bundle
@@ -15,15 +15,6 @@ end
require "bundler"
-if Gem.rubygems_version < Gem::Version.new("3.2.3") && Gem.ruby_version < Gem::Version.new("2.7.a") && !ENV["BUNDLER_NO_OLD_RUBYGEMS_WARNING"]
- Bundler.ui.warn \
- "Your RubyGems version (#{Gem::VERSION}) has a bug that prevents " \
- "`required_ruby_version` from working for Bundler. Any scripts that use " \
- "`gem install bundler` will break as soon as Bundler drops support for " \
- "your Ruby version. Please upgrade RubyGems to avoid future breakage " \
- "and silence this warning by running `gem update --system 3.2.3`"
-end
-
require "bundler/friendly_errors"
Bundler.with_friendly_errors do
@@ -34,5 +25,5 @@ Bundler.with_friendly_errors do
help_flag_used = ARGV.any? {|a| help_flags.include? a }
args = help_flag_used ? Bundler::CLI.reformatted_help_args(ARGV) : ARGV
- Bundler::CLI.start(args, :debug => true)
+ Bundler::CLI.start(args, debug: true)
end
diff --git a/libexec/erb b/libexec/erb
index 4381671f25..de7d5888c3 100755
--- a/libexec/erb
+++ b/libexec/erb
@@ -90,29 +90,49 @@ class ERB
when '-P'
disable_percent = true
when '--help'
- raise "print this help"
+ raise ''
when /\A-/
- raise "unknown switch #{switch.dump}"
+ raise "Unknown switch: #{switch.dump}"
else
var, val = *switch.split('=', 2)
(variables ||= {})[var] = val
end
end
rescue # usage
- STDERR.puts $!.to_s
- STDERR.puts File.basename($0) +
- " [switches] [var=value...] [inputfile]"
+ message = $!.to_s
+ STDERR.puts message unless message.empty?
+ STDERR.puts 'Usage:'
+ STDERR.puts " #{File.basename($0)} [options] [filepaths]"
STDERR.puts <<EOU
- -x print ruby script
- -n print ruby script with line number
- -v enable verbose mode
- -d set $DEBUG to true
- -r library load a library
- -E ex[:in] set default external/internal encodings
- -U set default encoding to UTF-8
- -T trim_mode specify trim_mode (0..2, -)
- -P disable ruby code evaluation for lines beginning with %
- var=value set variable
+
+Options:
+ -d --debug Set $DEBUG to enable debugging.
+ -E ex[:in] --encoding ex[:in]
+ Set default external and internal encodings.
+ -h --help Print this text and exit.
+ -n Print generated Ruby source code with line numbers;
+ ignored if given without option -x.
+ -P Disable execution tag shorthand (for lines beginning with '%').
+ -r library Load the named library.
+ -T trim_mode Specify trim_mode:
+ '0' means '%'; '1' means '%>'; '2' means '<>'; '-' means '%-'.
+ -U Set default encoding to UTF-8.
+ -v Set $VERBOSE to enable debugging,
+ --version Print ERB version string and exit.
+ -x Print generated Ruby source code.
+ -- Treat all following words as filepaths (not options).
+ name=value Set the variable named name to the given string value.
+
+Filepaths:
+ The erb program reads the text from all files at the filepaths as a single ERB template:
+ plain text, possibly with embedded ERB tags;
+ filepaths may be repeated.
+
+ The pseudo-filepath '-' (hyphen character) specifies the standard input.
+
+ If no filepaths are given, the sole input is the standard input.
+
+See details and examples at https://docs.ruby-lang.org/en/master/erb_executable_md.html
EOU
exit 1
end
diff --git a/libexec/irb b/libexec/irb
deleted file mode 100755
index 12f41e4f0a..0000000000
--- a/libexec/irb
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/env ruby
-#
-# irb.rb - interactive ruby
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
-#
-
-require "irb"
-
-IRB.start(__FILE__)
diff --git a/libexec/rdoc b/libexec/rdoc
deleted file mode 100755
index 95b6eea277..0000000000
--- a/libexec/rdoc
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env ruby
-#
-# RDoc: Documentation tool for source code
-# (see lib/rdoc/rdoc.rb for more information)
-#
-# Copyright (c) 2003 Dave Thomas
-# Released under the same terms as Ruby
-
-begin
- gem 'rdoc'
-rescue NameError => e # --disable-gems
- raise unless e.name == :gem
-rescue Gem::LoadError
-end
-
-require 'rdoc/rdoc'
-
-begin
- r = RDoc::RDoc.new
- r.document ARGV
-rescue Errno::ENOSPC
- $stderr.puts 'Ran out of space creating documentation'
- $stderr.puts
- $stderr.puts 'Please free up some space and try again'
-rescue SystemExit
- raise
-rescue Exception => e
- if $DEBUG_RDOC then
- $stderr.puts e.message
- $stderr.puts "#{e.backtrace.join "\n\t"}"
- $stderr.puts
- elsif Interrupt === e then
- $stderr.puts
- $stderr.puts 'Interrupted'
- else
- $stderr.puts "uh-oh! RDoc had a problem:"
- $stderr.puts e.message
- $stderr.puts
- $stderr.puts "run with --debug for full backtrace"
- end
-
- exit 1
-end
diff --git a/libexec/ri b/libexec/ri
deleted file mode 100755
index 7fbed0c099..0000000000
--- a/libexec/ri
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env ruby
-
-begin
- gem 'rdoc'
-rescue NameError => e # --disable-gems
- raise unless e.name == :gem
-rescue Gem::LoadError
-end
-
-require 'rdoc/ri/driver'
-
-RDoc::RI::Driver.run ARGV
diff --git a/libexec/syntax_suggest b/libexec/syntax_suggest
index e4a0b0b658..3dc8eb94d1 100755
--- a/libexec/syntax_suggest
+++ b/libexec/syntax_suggest
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
-require_relative "../lib/syntax_suggest/api"
+require "syntax_suggest/api"
SyntaxSuggest::Cli.new(
argv: ARGV