diff --git a/.github/workflows/c-check.yml b/.github/workflows/c-check.yml index b1bdc66cc..eb8b0be58 100644 --- a/.github/workflows/c-check.yml +++ b/.github/workflows/c-check.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.4" + ruby-version: "4.0.0-preview2" bundler-cache: none - name: Set working directory as safe run: git config --global --add safe.directory $(pwd) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 976c781c8..6f8851fed 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -13,24 +13,24 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.1', '3.2', '3.3', '3.4', head] + ruby: ['3.2', '3.3', '3.4', '4.0.0-preview2', head] rubyopt: [""] job: - test include: - ruby: head job: stdlib_test rubocop - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: stdlib_test - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: test rubyopt: "--enable-frozen-string-literal" - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: stdlib_test rubyopt: "--enable-frozen-string-literal" - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: rubocop validate test_doc build test_generate_stdlib raap - - ruby: "3.4" + - ruby: "4.0.0-preview2" job: typecheck_test env: RANDOMIZE_STDLIB_TEST_ORDER: "true" @@ -94,7 +94,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.4', head] + ruby: ['4.0.0-preview2', head] steps: - uses: actions/checkout@v4 - name: Install dependencies @@ -116,4 +116,3 @@ jobs: run: | bin/setup - run: bundle exec rake clean compile_c99 - diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml index 5f737028a..a3f7d630f 100644 --- a/.github/workflows/typecheck.yml +++ b/.github/workflows/typecheck.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.3" + ruby-version: "3.4" bundler: none - name: Set working directory as safe run: git config --global --add safe.directory $(pwd) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 75aa8a716..a249e8ede 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['3.2', '3.3', ucrt, mswin] + ruby: ['3.4', ucrt, mswin] steps: - uses: actions/checkout@v4 - name: load ruby diff --git a/Gemfile b/Gemfile index 7b03f739f..a04a1b352 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ gem "fileutils" gem "raap" gem "activesupport", "~> 7.0" gem "extconf_compile_commands_json" +gem "irb" group :libs do # Libraries required for stdlib test @@ -30,7 +31,6 @@ group :libs do gem "dbm" gem "mutex_m" gem "nkf" - gem "pathname" end group :profilers do diff --git a/Gemfile.lock b/Gemfile.lock index 2fd1d6279..252c3a459 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -13,7 +13,7 @@ GEM remote: https://rubygems.org/ specs: abbrev (0.1.2) - activesupport (7.2.2.1) + activesupport (7.2.3) base64 benchmark (>= 0.3) bigdecimal @@ -25,23 +25,24 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.8.8) + public_suffix (>= 2.0.2, < 8.0) ast (2.4.3) - base64 (0.2.0) - benchmark (0.4.0) + base64 (0.3.0) + benchmark (0.5.0) benchmark-ips (2.14.0) - bigdecimal (3.1.9) + bigdecimal (3.3.1) concurrent-ruby (1.3.5) - connection_pool (2.5.3) - csv (3.3.4) + connection_pool (3.0.2) + csv (3.3.5) dbm (1.1.0) - diff-lcs (1.6.1) - digest (3.2.0) - drb (2.2.1) + diff-lcs (1.6.2) + digest (3.2.1) + drb (2.2.3) + erb (6.0.0) extconf_compile_commands_json (0.0.7) ffi (1.17.2) - fileutils (1.7.3) + fileutils (1.8.0) goodcheck (3.1.0) marcel (>= 1.0, < 2.0) psych (>= 3.1, < 5.0) @@ -49,70 +50,80 @@ GEM strong_json (>= 1.1, < 2.2) i18n (1.14.7) concurrent-ruby (~> 1.0) + io-console (0.8.1) + irb (1.15.3) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) json (2.10.2) - json-schema (5.1.1) + json-schema (6.0.0) addressable (~> 2.8) bigdecimal (~> 3.1) - language_server-protocol (3.17.0.4) + language_server-protocol (3.17.0.5) lint_roller (1.1.0) listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) logger (1.7.0) - marcel (1.0.4) + marcel (1.1.0) memory_profiler (1.1.0) - mini_portile2 (2.8.8) - minitest (5.25.5) + mini_portile2 (2.8.9) + minitest (5.26.2) mutex_m (0.3.0) net-protocol (0.2.2) timeout net-smtp (0.5.1) net-protocol nkf (0.2.0) - nokogiri (1.18.8) + nokogiri (1.18.10) mini_portile2 (~> 2.8.2) racc (~> 1.4) - ostruct (0.6.1) + ostruct (0.6.3) parallel (1.27.0) - parser (3.3.8.0) + parser (3.3.10.0) ast (~> 2.4.1) racc - pathname (0.4.0) - power_assert (2.0.5) - prism (1.4.0) + power_assert (3.0.1) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + prism (1.6.0) pstore (0.2.0) psych (4.0.6) stringio - public_suffix (6.0.2) - raap (1.2.0) - rbs (~> 3.0) + public_suffix (7.0.0) + raap (1.3.0) + rbs (~> 3.9.0) timeout (~> 0.4) racc (1.8.1) rainbow (3.1.1) - rake (13.2.1) + rake (13.3.1) rake-compiler (1.3.0) rake rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.16.0) + rdoc (6.17.0) erb psych (>= 4.0.0) - regexp_parser (2.10.0) - rspec (3.13.0) + tsort + regexp_parser (2.11.3) + reline (0.6.3) + io-console (~> 0.5) + rspec (3.13.2) rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.3) + rspec-core (3.13.6) rspec-support (~> 3.13.0) - rspec-expectations (3.13.4) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-mocks (3.13.4) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-support (3.13.3) - rubocop (1.75.5) + rspec-support (3.13.6) + rubocop (1.81.7) json (~> 2.3) language_server-protocol (~> 3.17.0.2) lint_roller (~> 1.1.0) @@ -120,13 +131,13 @@ GEM parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 2.9.3, < 3.0) - rubocop-ast (>= 1.44.0, < 2.0) + rubocop-ast (>= 1.47.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 4.0) - rubocop-ast (1.44.1) + rubocop-ast (1.48.0) parser (>= 3.3.7.2) prism (~> 1.4) - rubocop-on-rbs (1.6.0) + rubocop-on-rbs (1.8.0) lint_roller (~> 1.1) rbs (~> 3.5) rubocop (>= 1.72.1, < 2.0) @@ -156,22 +167,23 @@ GEM strscan (>= 1.0.0) terminal-table (>= 2, < 5) uri (>= 0.12.0) - stringio (3.1.7) + stringio (3.1.9) strong_json (2.1.2) strscan (3.1.5) tempfile (0.3.1) terminal-table (4.0.0) unicode-display_width (>= 1.1.1, < 4) - test-unit (3.6.8) + test-unit (3.7.3) power_assert - timeout (0.4.3) + timeout (0.5.0) + tsort (0.2.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (3.1.4) - unicode-emoji (~> 4.0, >= 4.0.4) - unicode-emoji (4.0.4) - uri (1.0.3) - zlib (3.2.1) + unicode-display_width (3.2.0) + unicode-emoji (~> 4.1) + unicode-emoji (4.1.0) + uri (1.1.1) + zlib (3.2.2) PLATFORMS ruby @@ -188,6 +200,7 @@ DEPENDENCIES extconf_compile_commands_json fileutils goodcheck + irb json (~> 2.10.2) json-schema memory_profiler @@ -196,7 +209,6 @@ DEPENDENCIES net-smtp nkf ostruct - pathname pstore raap rake @@ -215,4 +227,4 @@ DEPENDENCIES test-unit BUNDLED WITH - 2.6.3 + 4.0.0.dev diff --git a/Rakefile b/Rakefile index 06792575d..343704e8a 100644 --- a/Rakefile +++ b/Rakefile @@ -212,7 +212,14 @@ task :validate => :compile do end libs.each do |lib| - sh "#{ruby} #{rbs} -r #{lib} validate --exit-error-on-syntax-error" + args = ["-r", lib] + + if lib == "rbs" + args << "-r" + args << "prism" + end + + sh "#{ruby} #{rbs} #{args.join(' ')} validate --exit-error-on-syntax-error" end end diff --git a/bin/benchmark-parse.rb b/bin/benchmark-parse.rb index 98e4ce16d..64d4fd530 100644 --- a/bin/benchmark-parse.rb +++ b/bin/benchmark-parse.rb @@ -1,7 +1,6 @@ require "rbs" require "benchmark/ips" require "csv" -require "pathname" files = {} ARGV.each do |file| diff --git a/lib/rbs.rb b/lib/rbs.rb index d0b8d24d4..02bb50e4b 100644 --- a/lib/rbs.rb +++ b/lib/rbs.rb @@ -4,7 +4,7 @@ require "set" require "json" -require "pathname" +require "pathname" unless defined?(Pathname) require "pp" require "ripper" require "logger" diff --git a/steep/Gemfile.lock b/steep/Gemfile.lock index 4ca31fc47..a60d87257 100644 --- a/steep/Gemfile.lock +++ b/steep/Gemfile.lock @@ -80,4 +80,4 @@ DEPENDENCIES steep (~> 1.10.pre) BUNDLED WITH - 2.6.3 + 4.0.0.dev diff --git a/test/stdlib/Marshal_test.rb b/test/stdlib/Marshal_test.rb index 945ffa78a..f0d03fa0f 100644 --- a/test/stdlib/Marshal_test.rb +++ b/test/stdlib/Marshal_test.rb @@ -1,5 +1,4 @@ require_relative "test_helper" -require "pathname" require "tmpdir" class MarshalSingletonTest < Test::Unit::TestCase diff --git a/test/stdlib/zlib/GzipReader_test.rb b/test/stdlib/zlib/GzipReader_test.rb index d105a797c..6d2e288b6 100644 --- a/test/stdlib/zlib/GzipReader_test.rb +++ b/test/stdlib/zlib/GzipReader_test.rb @@ -1,7 +1,6 @@ require_relative "../test_helper" require "zlib" require "tempfile" -require "pathname" class ZlibGzipReaderSingletonTest < Test::Unit::TestCase include TestHelper