Skip to content

Commit

Permalink
Cleanup Appraisals file
Browse files Browse the repository at this point in the history
  • Loading branch information
n-rodriguez committed Sep 6, 2024
1 parent 571dd9e commit 7c8025f
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 119 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,23 @@ jobs:
- postgis
# - trilogy
exclude:
- rails: rails_7.2.0
adapter: oracle_enhanced
# Rails 7.2 needs Ruby > 3.1
- rails: rails_7.2.0
ruby: '3.0'

# Disabled for now because of build error:
# /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/psych.rb:457:in
# `parse_stream': undefined method `parse' for #<Psych::Parser:0x000055b6cc7b6898
# @handler=#<Psych::Handlers::DocumentStream:0x000055b6cc7b69b0 @stack=[],
# @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil,
# @end_column=nil, @block=#<Proc:0x000055b6cc7b68e8
# /opt/hostedtoolcache/Ruby/3.0.7/x64/lib/ruby/3.0.0/psych.rb:391>>,
# @external_encoding=0> (NoMethodError)
# from
# /home/runner/work/ajax-datatables-rails/ajax-datatables-rails/vendor/bundle/ruby/3.0.0/gems/ruby-oci8-2.2.14/ext/oci8/apiwrap.rb:64:in
# `create_apiwrap'
- rails: rails_7.2.0
adapter: oracle_enhanced
- rails: rails_7.1.0
adapter: oracle_enhanced

Expand Down
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Style/TrailingCommaInHashLiteral:
##########

Layout/LineLength:
Max: 125
Exclude:
- ajax-datatables-rails.gemspec

Expand Down
115 changes: 93 additions & 22 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,26 +1,97 @@
# frozen_string_literal: true

require 'yaml'

rails_versions = YAML.safe_load_file('appraisal.yml')

rails_versions.each do |version, gems|
appraise "rails_#{version}" do
gem 'rails', version
gems.each do |name, opts|
if opts['install_if']
install_if opts['install_if'] do
if opts['version'].empty?
gem name
else
gem name, opts['version']
end
end
elsif opts['version'].empty?
gem name
else
gem name, opts['version']
end
end
appraise 'rails_7.0.8' do # rubocop:disable Metrics/BlockLength
gem 'rails', '7.0.8'

install_if '-> { ENV["DB_ADAPTER"] == "sqlite3" }' do
gem 'sqlite3', '~> 1.5.0'
end

install_if '-> { ENV["DB_ADAPTER"] == "mysql2" }' do
gem 'mysql2'
end

install_if '-> { ENV["DB_ADAPTER"] == "trilogy" }' do
gem 'activerecord-trilogy-adapter'
end

install_if '-> { ENV["DB_ADAPTER"] == "oracle_enhanced" }' do
gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter', '~> 7.0.0'
end

install_if '-> { ENV["DB_ADAPTER"] == "postgis" }' do
gem 'activerecord-postgis-adapter'
end

# Fix:
# warning: logger was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0
# Add logger to your Gemfile or gemspec.
install_if '-> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") }' do
gem 'base64'
gem 'bigdecimal'
gem 'benchmark'
gem 'drb'
gem 'logger'
gem 'mutex_m'
gem 'ostruct'
end
end

appraise 'rails_7.1.0' do
gem 'rails', '7.1.0'

install_if '-> { ENV["DB_ADAPTER"] == "sqlite3" }' do
gem 'sqlite3', '~> 1.5.0'
end

install_if '-> { ENV["DB_ADAPTER"] == "mysql2" }' do
gem 'mysql2'
end

install_if '-> { ENV["DB_ADAPTER"] == "trilogy" }' do
gem 'activerecord-trilogy-adapter'
end

install_if '-> { ENV["DB_ADAPTER"] == "oracle_enhanced" }' do
gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter', git: 'https://github.com/rsim/oracle-enhanced.git'
end

install_if '-> { ENV["DB_ADAPTER"] == "postgis" }' do
gem 'activerecord-postgis-adapter'
end

# Fix:
# warning: logger was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.5.0
# Add logger to your Gemfile or gemspec.
install_if '-> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.3.0") }' do
gem 'logger'
gem 'ostruct'
end
end

appraise 'rails_7.2.0' do
gem 'rails', '7.2.0'

install_if '-> { ENV["DB_ADAPTER"] == "sqlite3" }' do
gem 'sqlite3', '~> 1.5.0'
end

install_if '-> { ENV["DB_ADAPTER"] == "mysql2" }' do
gem 'mysql2'
end

install_if '-> { ENV["DB_ADAPTER"] == "trilogy" }' do
gem 'activerecord-trilogy-adapter'
end

install_if '-> { ENV["DB_ADAPTER"] == "oracle_enhanced" }' do
gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter', git: 'https://github.com/rsim/oracle-enhanced.git'
end

install_if '-> { ENV["DB_ADAPTER"] == "postgis" }' do
gem 'activerecord-postgis-adapter', git: 'https://github.com/rgeo/activerecord-postgis-adapter.git'
end
end
86 changes: 0 additions & 86 deletions appraisal.yml

This file was deleted.

7 changes: 5 additions & 2 deletions gemfiles/rails_7.0.8.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ install_if -> { ENV["DB_ADAPTER"] == "trilogy" } do
end

install_if -> { ENV["DB_ADAPTER"] == "oracle_enhanced" } do
gem "activerecord-oracle_enhanced-adapter", "~> 7.0.0"
gem "ruby-oci8"
gem "activerecord-oracle_enhanced-adapter", "~> 7.0.0"
end

install_if -> { ENV["DB_ADAPTER"] == "postgis" } do
Expand All @@ -47,8 +47,11 @@ end
install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") } do
gem "base64"
gem "bigdecimal"
gem "mutex_m"
gem "benchmark"
gem "drb"
gem "logger"
gem "mutex_m"
gem "ostruct"
end

gemspec path: "../"
13 changes: 8 additions & 5 deletions gemfiles/rails_7.1.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ install_if -> { ENV["DB_ADAPTER"] == "trilogy" } do
gem "activerecord-trilogy-adapter"
end

install_if -> { ENV["DB_ADAPTER"] == "oracle_enhanced" } do
gem "ruby-oci8"
gem "activerecord-oracle_enhanced-adapter", git: "https://github.com/rsim/oracle-enhanced.git"
end

install_if -> { ENV["DB_ADAPTER"] == "postgis" } do
gem "activerecord-postgis-adapter"
end

install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.4.0") } do
gem "base64"
gem "bigdecimal"
gem "mutex_m"
gem "drb"
install_if -> { Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.3.0") } do
gem "logger"
gem "ostruct"
end

gemspec path: "../"
7 changes: 6 additions & 1 deletion gemfiles/rails_7.2.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ install_if -> { ENV["DB_ADAPTER"] == "trilogy" } do
gem "activerecord-trilogy-adapter"
end

install_if -> { ENV["DB_ADAPTER"] == "oracle_enhanced" } do
gem "ruby-oci8"
gem "activerecord-oracle_enhanced-adapter", git: "https://github.com/rsim/oracle-enhanced.git"
end

install_if -> { ENV["DB_ADAPTER"] == "postgis" } do
gem "activerecord-postgis-adapter"
gem "activerecord-postgis-adapter", git: "https://github.com/rgeo/activerecord-postgis-adapter.git"
end

gemspec path: "../"
2 changes: 1 addition & 1 deletion lib/ajax-datatables-rails/datatable/column/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def use_regex?
# The solution is to bypass regex_search and use non_regex_search with :in operator
def regex_search
if use_regex?
::Arel::Nodes::Regexp.new((custom_field? ? field : table[field]), ::Arel::Nodes.build_quoted(formatted_value)) # rubocop:disable Layout/LineLength
::Arel::Nodes::Regexp.new((custom_field? ? field : table[field]), ::Arel::Nodes.build_quoted(formatted_value))
else
non_regex_search
end
Expand Down

0 comments on commit 7c8025f

Please sign in to comment.