Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropped support for Ruby <2.7. #5

Merged
merged 3 commits into from
Jul 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ jobs:
- name: Install the correct Ruby version
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 2.7
bundler-cache: true
rubygems: '3.3.26'
rubygems: '3.4.22'

- name: Prepare the virtual environment
uses: hausgold/actions/ci@master
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Ruby 2.5
- name: Install Ruby 2.7
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 2.7
bundler-cache: true
rubygems: '3.3.26'
rubygems: '3.4.22'

- name: Prepare the virtual environment
uses: hausgold/actions/ci@master
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['2.5', '2.6', '2.7', '3.0', '3.1']
rails: ['5.2', '6.0', '6.1', '7.0']
exclude:
# Rails 7.0 requires Ruby >=2.7
- ruby: '2.5'
rails: '7.0'
- ruby: '2.6'
rails: '7.0'
ruby: ['2.7', '3.0', '3.1']
rails: ['5.2', '6.1', '7.1']
env:
BUNDLE_GEMFILE: 'gemfiles/rails_${{ matrix.rails }}.gemfile'
steps:
Expand All @@ -36,7 +30,7 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: '3.3.26'
rubygems: '3.4.22'

- name: Prepare the virtual environment
uses: hausgold/actions/ci@master
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/pkg/
/spec/reports/
/tmp/
/log/
/vendor/
/gemfiles/vendor/
*.gemfile.lock
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ AllCops:
NewCops: enable
SuggestExtensions: false
DisplayCopNames: true
TargetRubyVersion: 2.5
TargetRubyVersion: 2.7
TargetRailsVersion: 5.2
Exclude:
- bin/**/*
Expand Down
14 changes: 4 additions & 10 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,14 @@ appraise 'rails-5.2' do
gem 'activesupport', '~> 5.2.0'
end

appraise 'rails-6.0' do
gem 'activejob', '~> 6.0.0'
gem 'activerecord', '~> 6.0.0'
gem 'activesupport', '~> 6.0.0'
end

appraise 'rails-6.1' do
gem 'activejob', '~> 6.1.0'
gem 'activerecord', '~> 6.1.0'
gem 'activesupport', '~> 6.1.0'
end

appraise 'rails-7.0' do
gem 'activejob', '~> 7.0.0'
gem 'activerecord', '~> 7.0.0'
gem 'activesupport', '~> 7.0.0'
appraise 'rails-7.1' do
gem 'activejob', '~> 7.1.0'
gem 'activerecord', '~> 7.1.0'
gem 'activesupport', '~> 7.1.0'
end
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
### next

* Moved the development dependencies from the gemspec to the Gemfile (#4)
* Dropped support for Ruby <2.7 (#5)

### 1.3.0

Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM hausgold/ruby:2.5
FROM hausgold/ruby:2.7
MAINTAINER Hermann Mayer <[email protected]>

# Update system gem
RUN gem update --system '3.3.26'
RUN gem update --system '3.4.22'

# Install system packages and the latest bundler
RUN apt-get update -yqqq && \
Expand All @@ -11,7 +11,7 @@ RUN apt-get update -yqqq && \
ca-certificates \
bash-completion inotify-tools && \
echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && /usr/sbin/locale-gen && \
gem install bundler -v '~> 2.3.0' --no-document --no-prerelease
gem install bundler -v '~> 2.4.22' --no-document --no-prerelease

# Add new web user
RUN mkdir /app && \
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ test-style: \
test-style-ruby:
# Run the static code analyzer (rubocop)
@$(call run-shell,$(BUNDLE) exec $(RUBOCOP) -a \
|| ($(TEST) $$($(RUBY_VERSION)) != '2.5' && true))
|| ($(TEST) $$($(RUBY_VERSION)) != '2.7' && true))

clean:
# Clean the dependencies
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ $ gem install boltless
## Requirements

* [neo4j](https://neo4j.com/) (>=3.5, all featured tested with 4.4.x)
* [Ruby](https://www.ruby-lang.org/) (>=2.5, tested on CRuby/MRI only, may work
* [Ruby](https://www.ruby-lang.org/) (>=2.7, tested on CRuby/MRI only, may work
with other implementations as well)

## Usage
Expand Down
2 changes: 1 addition & 1 deletion boltless.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.5'
spec.required_ruby_version = '>= 2.7'

spec.add_runtime_dependency 'activesupport', '>= 5.2'
spec.add_runtime_dependency 'colorize', '>= 0.8.0'
Expand Down
4 changes: 3 additions & 1 deletion config/docker/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ sudo sed -i 's/autostart=.*/autostart=false/g' /etc/supervisor/conf.d/*
sudo supervisord >/dev/null 2>&1 &

# Wait for supervisord
while ! supervisorctl status >/dev/null 2>&1; do sleep 1; done
while ! (sudo supervisorctl status | grep avahi) >/dev/null 2>&1; do
sleep 1
done

# Boot the mDNS stack
echo '# Start the mDNS stack'
Expand Down
22 changes: 0 additions & 22 deletions gemfiles/rails_7.0.gemfile

This file was deleted.

6 changes: 3 additions & 3 deletions gemfiles/rails_6.0.gemfile → gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ gem "rubocop-rspec", "~> 2.10"
gem "simplecov", ">= 0.22"
gem "yard", ">= 0.9.28"
gem "yard-activesupport-concern", ">= 0.0.1"
gem "activejob", "~> 6.0.0"
gem "activerecord", "~> 6.0.0"
gem "activesupport", "~> 6.0.0"
gem "activejob", "~> 7.1.0"
gem "activerecord", "~> 7.1.0"
gem "activesupport", "~> 7.1.0"

gemspec path: "../"
8 changes: 4 additions & 4 deletions lib/boltless/extensions/utilities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module Utilities
def build_cypher(**replacements)
# Process the given replacements in order to prevent Cypher
# injections from user given values
replacements = replacements \
replacements = replacements
.stringify_keys
.each_with_object({}) do |(key, val), memo|
val = prepare_label(val) if key.match?(/_labels?$|^labels?$/)
Expand Down Expand Up @@ -75,7 +75,7 @@ def prepare_label(*inputs)
raise ArgumentError, "Bad labels: #{inputs.inspect}" if list.empty?

list.map do |input|
res = input.to_s.underscore.gsub(/-/, '_').camelcase
res = input.to_s.underscore.gsub('-', '_').camelcase
res.match?(/[^a-z0-9]/i) ? "`#{res}`" : res
end.sort.uniq.join(':')
end
Expand All @@ -91,7 +91,7 @@ def prepare_type(*inputs)
raise ArgumentError, "Bad types: #{inputs.inspect}" if list.empty?

list.map do |input|
res = input.to_s.underscore.gsub(/-/, '_').upcase
res = input.to_s.underscore.gsub('-', '_').upcase
res.match?(/[^a-z0-9_]/i) ? "`#{res}`" : res
end.sort.uniq.join('|')
end
Expand All @@ -106,7 +106,7 @@ def prepare_string(*inputs)
return %("") if inputs.empty?

inputs.map do |input|
"\"#{input.to_s.gsub(/"/, '\"')}\""
"\"#{input.to_s.gsub('"', '\"')}\""
end.uniq.join(', ')
end

Expand Down
2 changes: 1 addition & 1 deletion spec/boltless/extensions/configuration_handling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
end

it 'returns a logger with the default info level' do
expect(described_class.logger.level).to be_eql(Logger::INFO)
expect(described_class.logger.level).to eql(Logger::INFO)
end
end
end
12 changes: 6 additions & 6 deletions spec/boltless/extensions/connection_pool_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,37 +38,37 @@
it 'returns a configured HTTP client (pool size)' do
Boltless.configuration.connection_pool_size = 1
reload.call
expect(action.size).to be_eql(1)
expect(action.size).to be(1)
end

it 'returns a configured HTTP client (connection aquire timeout)' do
Boltless.configuration.connection_pool_timeout = 1
reload.call
expect(action.instance_variable_get(:@timeout)).to be_eql(1)
expect(action.instance_variable_get(:@timeout)).to be(1)
end

it 'returns a configured HTTP client (persistent base URL)' do
Boltless.configuration.base_url = 'http://test:1234'
reload.call
expect(options.persistent).to be_eql('http://test:1234')
expect(options.persistent).to eql('http://test:1234')
end

it 'returns a configured HTTP client (username)' do
Boltless.configuration.username = 'test'
reload.call
expect(auth.first).to be_eql('test')
expect(auth.first).to eql('test')
end

it 'returns a configured HTTP client (password)' do
Boltless.configuration.password = 'test'
reload.call
expect(auth.last).to be_eql('test')
expect(auth.last).to eql('test')
end

it 'returns a configured HTTP client (request timeout)' do
Boltless.configuration.request_timeout = 7
reload.call
expect(options.timeout_options[:global_timeout]).to be_eql(7)
expect(options.timeout_options[:global_timeout]).to be(7)
end

it 'allows send requests' do
Expand Down
6 changes: 3 additions & 3 deletions spec/boltless/extensions/operations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,21 @@
context 'with an known index' do
it 'returns true' do
expect(described_class.component_name_present?('user_id')).to \
be_eql(true)
be(true)
end
end

context 'with an known constraint' do
it 'returns true' do
expect(described_class.component_name_present?('uniq_user_email')).to \
be_eql(true)
be(true)
end
end

context 'with an unknown name' do
it 'returns false' do
expect(described_class.component_name_present?('unknown')).to \
be_eql(false)
be(false)
end
end
end
Expand Down
Loading
Loading