diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e288cc46c..03170d056 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: uses: ruby/setup-ruby@v1 with: bundler-cache: true - rubygems: 3.5.23 + rubygems: 3.6.1 - name: Run type check run: bin/typecheck - name: Lint Ruby files @@ -36,6 +36,7 @@ jobs: matrix: ruby: ["3.1", "3.2", "3.3", "head"] rails: ["7.0", "current", "main"] + rubygems: ["3.6.1"] exclude: - ruby: "3.1" rails: "main" @@ -44,6 +45,8 @@ jobs: experimental: true - ruby: "head" experimental: true + - ruby: "3.3" + rubygems: "3.5.23" name: Ruby ${{ matrix.ruby }} - Rails ${{ matrix.rails }} env: RAILS_VERSION: ${{ matrix.rails }} @@ -63,7 +66,7 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - rubygems: 3.5.23 + rubygems: ${{ matrix.rubygems }} - name: Run tests run: bin/test continue-on-error: ${{ !!matrix.experimental }} diff --git a/Gemfile.lock b/Gemfile.lock index f7087e409..7d72a4ca0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -412,4 +412,4 @@ DEPENDENCIES xpath BUNDLED WITH - 2.5.23 + 2.6.1 diff --git a/lib/tapioca/gemfile.rb b/lib/tapioca/gemfile.rb index db67241e5..dd49b076d 100644 --- a/lib/tapioca/gemfile.rb +++ b/lib/tapioca/gemfile.rb @@ -67,14 +67,23 @@ def load_dependencies sig { returns([T::Enumerable[Spec], T::Array[String]]) } def materialize_deps deps = definition.locked_gems.dependencies.except(*@excluded_gems).values - materialized_dependencies = definition.resolve.materialize(deps) - missing_spec_names = materialized_dependencies.missing_specs.map(&:name).to_set - missing_specs = materialized_dependencies.missing_specs.map do |spec| - "#{spec.name} (#{spec.version})" - end - materialized_dependencies = materialized_dependencies.to_a.reject do |spec| - missing_spec_names.include?(spec.name) + resolve = definition.resolve + materialized_dependencies = resolve.materialize(deps) + + if Bundler::VERSION >= "2.6.0" + missing_specs = resolve.missing_specs.map do |spec| + "#{spec.name} (#{spec.version})" + end + else + missing_spec_names = materialized_dependencies.missing_specs.map(&:name).to_set + missing_specs = materialized_dependencies.missing_specs.map do |spec| + "#{spec.name} (#{spec.version})" + end + materialized_dependencies = materialized_dependencies.to_a.reject do |spec| + missing_spec_names.include?(spec.name) + end end + [materialized_dependencies, missing_specs] end