summaryrefslogtreecommitdiff
path: root/bin/erb
diff options
context:
space:
mode:
Diffstat (limited to 'bin/erb')
-rwxr-xr-xbin/erb9
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/erb b/bin/erb
index 86f7042..d060cab 100755
--- a/bin/erb
+++ b/bin/erb
@@ -75,6 +75,7 @@ class ERB
when '-r' # require
require ARGV.req_arg
when '-S' # security level
+ warn 'warning: -S option of erb command is deprecated. Please do not use this.'
arg = ARGV.req_arg
raise "invalid safe_level #{arg.dump}" unless arg =~ /\A[0-1]\z/
safe_level = arg.to_i
@@ -112,7 +113,6 @@ class ERB
-v enable verbose mode
-d set $DEBUG to true
-r library load a library
- -S safe_level set $SAFE (0..1)
-E ex[:in] set default external/internal encodings
-U set default encoding to UTF-8.
-T trim_mode specify trim_mode (0..2, -)
@@ -127,7 +127,12 @@ EOU
filename = $FILENAME
exit 2 unless src
trim = trim_mode_opt(trim_mode, disable_percent)
- erb = factory.new(src.untaint, safe_level, trim)
+ if safe_level.nil?
+ erb = factory.new(src.untaint, trim_mode: trim)
+ else
+ # [deprecated] This will be removed at Ruby 2.7.
+ erb = factory.new(src.untaint, safe_level, trim_mode: trim)
+ end
erb.filename = filename
if output
if number