Skip to content

Commit

Permalink
Fix building with 1.8 BASERUBY
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed May 28, 2019
1 parent f3bddc1 commit 05bc14d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions common.mk
Expand Up @@ -785,9 +785,9 @@ extconf: $(PREP)

$(RBCONFIG): $(srcdir)/tool/mkconfig.rb config.status $(srcdir)/version.h
$(Q)$(BOOTSTRAPRUBY) -n \
-e 'BEGIN{version=ARGV.shift;mis=ARGV.dup}' \
-e 'END{abort "UNICODE version mismatch: #{mis}" unless mis.empty?}' \
-e '(mis.delete(ARGF.path); ARGF.close) if /ONIG_UNICODE_VERSION_STRING +"#{Regexp.quote(version)}"/o' \
-e 'BEGIN{VERSION=ARGV.shift;MIS=ARGV.dup}' \
-e 'END{abort "UNICODE version mismatch: #{MIS}" unless MIS.empty?}' \
-e '(MIS.delete(ARGF.path); ARGF.close) if /ONIG_UNICODE_VERSION_STRING +"#{Regexp.quote(VERSION)}"/o' \
$(UNICODE_VERSION) $(UNICODE_DATA_HEADERS)
$(Q)$(BOOTSTRAPRUBY) $(srcdir)/tool/mkconfig.rb \
-arch=$(arch) -version=$(RUBY_PROGRAM_VERSION) \
Expand Down
2 changes: 1 addition & 1 deletion tool/colorize.rb
Expand Up @@ -4,7 +4,7 @@ class Colorize
def initialize(color = nil)
@colors = @reset = nil
if color or (color == nil && STDOUT.tty?)
if (/\A\e\[.*m\z/ =~ IO.popen("tput smso", "r", err: IO::NULL, &:read) rescue nil)
if (/\A\e\[.*m\z/ =~ IO.popen("tput smso", "r", :err => IO::NULL, &:read) rescue nil)
@beg = "\e["
@colors = (colors = ENV['TEST_COLORS']) ? Hash[colors.scan(/(\w+)=([^:\n]*)/)] : {}
@reset = "#{@beg}m"
Expand Down
4 changes: 2 additions & 2 deletions tool/downloader.rb
@@ -1,4 +1,4 @@
# Used by configure and make to download or update mirrored Ruby and GCC
#6 Used by configure and make to download or update mirrored Ruby and GCC
# files. This will use HTTPS if possible, falling back to HTTP.

require 'fileutils'
Expand Down Expand Up @@ -173,7 +173,7 @@ def self.download(url, name, dir = nil, since = true, options = {})
if cache_save
save_cache(cache, file, name)
end
return file.to_path
return file.respond_to?(:to_path) ? file.to_path : file.to_s
end
if dryrun
puts "Download #{url} into #{file}"
Expand Down
5 changes: 3 additions & 2 deletions tool/generic_erb.rb
Expand Up @@ -33,8 +33,9 @@
updated = color.fail("updated")

result = templates.map do |template|
if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+
erb = ERB.new(File.read(template), trim_mode: '%-')
method = ERB.instance_method(:initialize)
if method.respond_to?(:parameters) && method.parameters.assoc(:key) # Ruby 2.6+
erb = ERB.new(File.read(template), :trim_mode => '%-')
else
erb = ERB.new(File.read(template), nil, '%-')
end
Expand Down

0 comments on commit 05bc14d

Please sign in to comment.