Skip to content

Commit

Permalink
Revert "Revert "Updates for ruby 3.0 (#1)""
Browse files Browse the repository at this point in the history
This reverts commit 1b3f6ea.
  • Loading branch information
rortian committed Jul 10, 2024
1 parent 97b10b2 commit 6e541d1
Show file tree
Hide file tree
Showing 12 changed files with 100 additions and 163 deletions.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Expected Behavior


## Actual Behavior


## Steps to Reproduce the Problem

1.
2.
3.

## Specifications

- Version:
- Ruby version:
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or link to a
relevant issue. -->

## What is the new behavior?

<!-- Please describe the behavior or changes that are being added here. -->

## Checklist

Please make sure the following requirements are complete:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been reviewed and added / updated if needed (for bug fixes /
features)
- [ ] All automated checks pass (CI/CD)
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches:
- main
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
ruby: ['2.7', '3.0', '3.1']

steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- name: Runs code QA and tests
env:
COVERAGE: no
run: |
sudo apt-get update
sudo apt-get install openjdk-8-jdk
bundle
bundle exec rake rspec
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
/*.gem
/.bundle/*
/.idea/
Gemfile.lock
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ group :test do
gem 'rspec-collection_matchers'
gem 'rspec-wait'
gem 'simplecov'
gem 'byebug'
end

group :docs do
Expand Down
127 changes: 0 additions & 127 deletions Gemfile.lock

This file was deleted.

10 changes: 10 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,13 @@ Rake::TestTask.new(stress: :compile) do |t|
t.test_files = FileList['integration/stress_tests/*_test.rb']
t.verbose = true
end

desc 'Build the package and publish it to rubygems.pkg.github.com'
task publish: :build do
# Requires local setup of personal access token, see:
# 1. https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-rubygems-registry#authenticating-with-a-personal-access-token
system("gem push --key github --host https://rubygems.pkg.github.com/art19 " \
"pkg/cassandra-driver-#{Cassandra::VERSION}.gem")
end


3 changes: 2 additions & 1 deletion cassandra-driver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Gem::Specification.new do |s|
end

s.add_runtime_dependency 'ione', '~> 1.2'
s.add_runtime_dependency 'sorted_set', '~> 1.0'

s.add_development_dependency 'bundler', '~> 1.6'
s.add_development_dependency 'bundler'
s.add_development_dependency 'rake', '~> 13.0'
end
8 changes: 7 additions & 1 deletion lib/cassandra/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@
#++

module Cassandra
VERSION = '3.2.5'.freeze
##
# ART19 maintains a fork with patches applied on top of the upstream gem.
# We publish our fork with a revision number appended to the upstream version.
#
# @return [String] the ART19 revision number
ART19_REVISION = '1'.freeze
VERSION = "3.2.5.#{ART19_REVISION}".freeze
end
15 changes: 12 additions & 3 deletions spec/cassandra/protocol/coder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,20 @@ module Protocol
end

describe('RUBY-128') do
let(:permitted_classes) { [Cassandra::Protocol::CqlByteBuffer, Cassandra::Types::Map, Cassandra::Types::Simple, Symbol] }

it 'reads very large short strings and string' do
column_specs = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/cols.yml"))
buffer = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/buffer.yml"))
if Psych::VERSION.to_i >= 4
column_specs = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/cols.yml"), aliases: true, permitted_classes: permitted_classes)
buffer = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/buffer.yml"), permitted_classes: permitted_classes)

Coder.read_values_v1(buffer, column_specs)
else
column_specs = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/cols.yml"))
buffer = ::YAML::load(::File.open(::File.dirname(__FILE__) + "/buffer.yml"))

Coder.read_values_v1(buffer, column_specs)
Coder.read_values_v1(buffer, column_specs)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/cassandra/session_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ module Cassandra
bound_statement = double('bound statement')
options = double('options')

expect(session_options).to receive(:override).once.with(nil, arguments: [1, 2, 3, 4, 5]).and_return(options)
expect(session_options).to receive(:override).once.with(nil, { arguments: [1, 2, 3, 4, 5] }).and_return(options)
allow(options).to receive(:arguments).and_return([1, 2, 3, 4, 5])
expect(statement).to receive(:bind).with([1, 2, 3, 4, 5]).and_return(bound_statement)
expect(client).to receive(:execute).once.with(bound_statement, options).and_return(promise)
Expand Down

0 comments on commit 6e541d1

Please sign in to comment.