From 6b2f45852147d5f826ba1001750c5f6c84943ae5 Mon Sep 17 00:00:00 2001 From: Max Chernyak Date: Thu, 3 Aug 2023 22:47:10 -0400 Subject: [PATCH] Support Ruby 3.x --- .github/workflows/rspec.yml | 20 ++++++++++---------- lib/wordmap.rb | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/rspec.yml b/.github/workflows/rspec.yml index 6d68ca0..6bc4228 100644 --- a/.github/workflows/rspec.yml +++ b/.github/workflows/rspec.yml @@ -9,16 +9,16 @@ on: jobs: test: runs-on: ubuntu-latest + name: Ruby ${{ matrix.ruby }} strategy: matrix: - ruby: [ '2.5', '2.6', '2.7' ] - - name: Ruby ${{ matrix.ruby }} + ruby: [ '2.5', '2.6', '2.7', '3.0', '3.1', '3.2' ] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - - run: gem install bundler - - run: bundle install - - run: bundle exec rake + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + - name: Run RSpec + run: bundle exec rspec diff --git a/lib/wordmap.rb b/lib/wordmap.rb index 28198d8..b4bafcf 100644 --- a/lib/wordmap.rb +++ b/lib/wordmap.rb @@ -14,7 +14,7 @@ class Wordmap class << self def create(path, hash, index_names = []) - raise ArgumentError, "Path already exists: #{path}" if Dir.exists?(path) + raise ArgumentError, "Path already exists: #{path}" if Dir.exist?(path) index_data = index_names.map { |name| [name, {}] }.to_h vecs = Builder.build_vectors(hash)