diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d047de..edb679e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,10 @@ jobs: strategy: max-parallel: 1 matrix: - ruby: ['2.7', '3.0', '3.1'] + ruby: ["3.0", "3.1", "3.4"] name: 💎 Ruby ${{ matrix.ruby }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # gives the commit linter access to previous commits @@ -21,10 +21,10 @@ jobs: bundler-cache: true - run: bundle exec rake rubocop - if: ${{ matrix.ruby == '2.7' }} + if: ${{ matrix.ruby == '3.4' }} - run: bundle exec srb tc - if: ${{ matrix.ruby == '2.7' }} + if: ${{ matrix.ruby == '3.4' }} - run: bundle exec rspec ./spec --require spec_helper env: diff --git a/.github/workflows/initiate_release.yml b/.github/workflows/initiate_release.yml index c92f1cb..0ca047a 100644 --- a/.github/workflows/initiate_release.yml +++ b/.github/workflows/initiate_release.yml @@ -12,7 +12,7 @@ jobs: name: 🚀 Create release PR runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # gives the changelog generator access to all previous commits diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b7991b..3b1ac57 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ jobs: if: github.event.pull_request.merged && startsWith(github.head_ref, 'release-') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 56eb1af..ca9efc1 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: diff --git a/.rubocop.yml b/.rubocop.yml index b5252f1..72100a7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ AllCops: DisabledByDefault: false NewCops: enable - TargetRubyVersion: 2.7 + TargetRubyVersion: 3.0 Exclude: - sorbet/**/*.rbi - vendor/bundle/**/* diff --git a/Gemfile b/Gemfile index 8416e05..9f46f9e 100644 --- a/Gemfile +++ b/Gemfile @@ -20,3 +20,5 @@ end group :test do gem 'rack', '~> 2.2.4' end + +ruby '>= 3.0.0' diff --git a/README.md b/README.md index e94ce7c..a5184e7 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,7 @@ For the client-side integrations (web and mobile) have a look at the JavaScript, ## ⚙️ Installation -[`stream-chat-ruby`](https://rubygems.org/gems/stream-chat-ruby) supports: - -- Ruby (2.7, 3.0, 3.1) +[`stream-chat-ruby`](https://rubygems.org/gems/stream-chat-ruby) supports Ruby version `3.0` and greater. We test against Ruby versions `3.0`, `3.1` and `3.4`. ```bash $ gem install stream-chat-ruby @@ -53,6 +51,7 @@ client = StreamChat::Client.new('STREAM_KEY', 'STREAM_SECRET') --- > Additionally, in a future major version, we would like to enforce symbol hash keys during runtime to conform to Ruby best practises. It's a good idea to prepare your application for that. +> > ```ruby > # Wrong: > user = { "user" => { "id" => "bob-1"}} @@ -108,11 +107,13 @@ chan.add_members(['bob-1', 'jane-77']) ``` ### Reactions + ```ruby chan.send_reaction(m1['id'], {type: 'like'}, 'bob-1') ``` ### Moderation + ```ruby chan.add_moderators(['jane-77']) chan.demote_moderators(['bob-1']) diff --git a/stream-chat.gemspec b/stream-chat.gemspec index 0c2af9e..0ecc866 100644 --- a/stream-chat.gemspec +++ b/stream-chat.gemspec @@ -16,7 +16,7 @@ Gem::Specification.new do |gem| gem.files = Dir.chdir(File.expand_path(__dir__)) do `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|sorbet|spec|\.github|scripts|assets)/}) } end - gem.required_ruby_version = '>=2.7.0' + gem.required_ruby_version = '>=3.0.0' gem.metadata = { 'rubygems_mfa_required' => 'false', 'homepage_uri' => 'https://getstream.io/chat/docs/', @@ -26,10 +26,10 @@ Gem::Specification.new do |gem| 'source_code_uri' => 'https://github.com/GetStream/stream-chat-ruby' } - gem.add_dependency 'faraday', '~> 2.0.1' - gem.add_dependency 'faraday-multipart', '~> 1.0.4' - gem.add_dependency 'faraday-net_http_persistent', '~> 2.0.1' - gem.add_dependency 'jwt', '~> 2.3' + gem.add_dependency 'faraday', '~> 2.12.2' + gem.add_dependency 'faraday-multipart', '~> 1.1.0' + gem.add_dependency 'faraday-net_http_persistent', '~> 2.3.0' + gem.add_dependency 'jwt', '~> 2.10' gem.add_dependency 'net-http-persistent', '~> 4.0' - gem.add_dependency 'sorbet-runtime', '~> 0.5.10539' + gem.add_dependency 'sorbet-runtime', '~> 0.5.11820' end