From 5b6a8a06c2975e81cb501e6b34e86d195897586d Mon Sep 17 00:00:00 2001 From: Kevin McCormack Date: Tue, 7 Jun 2022 09:45:42 -0400 Subject: [PATCH] Set Ruby to 3.1.2 --- .bundle/config | 2 ++ .ruby-version | 2 +- Gemfile | 2 +- Gemfile.lock | 33 ++++++++++++++++----------------- lib/compiler.rb | 6 +++--- lib/compiler/utils.rb | 6 +++--- test/roundtrip/test_rubyc.rb | 4 ++-- 7 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 .bundle/config diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 000000000..d13a8592a --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_JOBS: "4" diff --git a/.ruby-version b/.ruby-version index bff6ce5c1..7bde84d06 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-2.7.1 +ruby-3.1.2 diff --git a/Gemfile b/Gemfile index b7e8b4cc5..074faaf0a 100644 --- a/Gemfile +++ b/Gemfile @@ -2,7 +2,7 @@ source 'https://rubygems.org' -ruby '2.7.1' +ruby '3.1.2' gem 'activesupport', '~> 6.0', '>= 6.0.3.2', require: 'active_support/all' gem 'minitest', '~> 5.14', '>= 5.14.1' diff --git a/Gemfile.lock b/Gemfile.lock index dd4e2a4e5..a557ba4b0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ GIT remote: https://github.com/kern/minitest-reporters.git - revision: 9cb9e78aed69bfe4eed6c27b5b795e8bb4ad708f + revision: 466b060a906298148836e368916aee930d28f618 specs: - minitest-reporters (1.4.2) + minitest-reporters (1.5.0) ansi builder minitest (>= 5.0) @@ -11,29 +11,28 @@ GIT GEM remote: https://rubygems.org/ specs: - activesupport (6.0.3.2) + activesupport (6.1.6) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - zeitwerk (~> 2.2, >= 2.2.2) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) ansi (1.5.0) builder (3.2.4) coderay (1.1.3) - concurrent-ruby (1.1.6) - i18n (1.8.3) + concurrent-ruby (1.1.10) + i18n (1.10.0) concurrent-ruby (~> 1.0) method_source (1.0.0) - minitest (5.14.1) + minitest (5.15.0) pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) - rake (13.0.1) - ruby-progressbar (1.10.1) - thread_safe (0.3.6) - tzinfo (1.2.7) - thread_safe (~> 0.1) - zeitwerk (2.4.0) + rake (13.0.6) + ruby-progressbar (1.11.0) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + zeitwerk (2.5.4) PLATFORMS mswin64 @@ -48,7 +47,7 @@ DEPENDENCIES rake (~> 13.0, >= 13.0.1) RUBY VERSION - ruby 2.7.1p83 + ruby 3.1.2p20 BUNDLED WITH 2.1.4 diff --git a/lib/compiler.rb b/lib/compiler.rb index 1839f95ff..1ce544861 100644 --- a/lib/compiler.rb +++ b/lib/compiler.rb @@ -487,7 +487,7 @@ def log(message = nil) warn message end - def stuff(library, &block) + def stuff(library, &) source = File.join PRJ_ROOT, 'vendor', library target = File.join @options[:tmpdir], library @@ -498,7 +498,7 @@ def stuff(library, &block) log "=> Stuffing #{library}..." @utils.capture_run_io "stuff_#{library}" do - @utils.chdir(target, &block) + @utils.chdir(target, &) end log "=> Stuffed #{library}" @@ -789,7 +789,7 @@ def local_toolchain_env { 'CI' => 'true', 'GEM_PATH' => File.join(@ruby_install, 'lib', 'ruby', 'gems', self.class.ruby_api_version), - 'PATH' => "#{File.join(@ruby_install, 'bin')}:#{ENV['PATH']}", + 'PATH' => "#{File.join(@ruby_install, 'bin')}:#{ENV.fetch('PATH', nil)}", 'ENCLOSE_IO_USE_ORIGINAL_RUBY' => 'true', 'ENCLOSE_IO_RUBYC_1ST_PASS' => 'true', 'ENCLOSE_IO_RUBYC_2ND_PASS' => nil diff --git a/lib/compiler/utils.rb b/lib/compiler/utils.rb index 00a1a024f..9ff39ca70 100644 --- a/lib/compiler/utils.rb +++ b/lib/compiler/utils.rb @@ -77,9 +77,9 @@ def run_allow_failures(*args) status end - def chdir(path, &block) + def chdir(path, &) warn "-> cd #{path}" unless @options[:quiet] - Dir.chdir(path, &block) + Dir.chdir(path, &) warn "-> cd #{Dir.pwd}" unless @options[:quiet] end @@ -90,7 +90,7 @@ def cp(from, to) def cp_r(from, to, options = {}) warn "-> cp -r #{from.inspect} #{to.inspect}" unless @options[:quiet] - FileUtils.cp_r(from, to, options) + FileUtils.cp_r(from, to, **options) end def rm(path) diff --git a/test/roundtrip/test_rubyc.rb b/test/roundtrip/test_rubyc.rb index d25e2a2ff..95b514831 100644 --- a/test/roundtrip/test_rubyc.rb +++ b/test/roundtrip/test_rubyc.rb @@ -30,14 +30,14 @@ def ruby(*args) Thread.new do until (raw_line = stdout.gets).nil? - parsed_line = Hash[timestamp: Time.now, line: raw_line.to_s] + parsed_line = { timestamp: Time.now, line: raw_line.to_s } $stdout.puts "rubyc's ruby STDOUT: #{parsed_line}" end end Thread.new do until (raw_line = stderr.gets).nil? - parsed_line = Hash[timestamp: Time.now, line: raw_line.to_s] + parsed_line = { timestamp: Time.now, line: raw_line.to_s } warn "rubyc's ruby STDERR: #{parsed_line}" end end