Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ '3.2', '3.3', '3.4', '4.0' ]
ruby: [ '3.3', '3.4', '4.0' ]
gemfile: [rails.7.2.activerecord, rails.8.0.activerecord, rails.8.1.activerecord]
name: ${{ matrix.ruby }}-${{ matrix.gemfile }}

Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins:

AllCops:
NewCops: enable
TargetRubyVersion: 3.2
TargetRubyVersion: 3.3
SuggestExtensions: false

Layout/AccessModifierIndentation:
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

### Changes

* [#1029](https://github.com/toptal/chewy/pull/1029): **(Breaking)** Drop support for Ruby 3.2, which reached end-of-life on 2026-04-01. Chewy now requires Ruby `>= 3.3`. ([@mattmenefee][])

## 8.4.1 (2026-06-19)

### New Features
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ do so.

### Prerequisites

- Ruby 3.2+
- Ruby 3.3+
- Docker (for Elasticsearch)

### Starting Elasticsearch
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Chewy aims to support all Ruby and Rails versions that are currently maintained

### Ruby

Chewy is compatible with MRI 3.2-4.0.
Chewy is compatible with MRI 3.3-4.0.

### Elasticsearch compatibility matrix

Expand Down
2 changes: 1 addition & 1 deletion chewy.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
spec.description = 'Chewy provides functionality for Elasticsearch index handling, documents import mappings and chainable query DSL'
spec.homepage = 'https://github.com/toptal/chewy'
spec.license = 'MIT'
spec.required_ruby_version = '>= 3.2'
spec.required_ruby_version = '>= 3.3'

spec.files = Dir['CHANGELOG.md', 'LICENSE.txt', 'README.md', 'lib/**/*']
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
Expand Down
2 changes: 1 addition & 1 deletion docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ See [configuration.md](configuration.md#import-scope-clean-up-behavior) for deta
Some Chewy features require additional gems that are not listed as hard dependencies:

- **`parallel`** — required for `chewy:parallel:*` rake tasks. Install it with `gem 'parallel'` in your Gemfile.
- **`method_source`**, **`parser`** (or **`prism`** on Ruby 3.3+), **`unparser`** — required only for the deprecated `witchcraft!` path. Not needed for the default compiled compose path. Install them only if you still call `witchcraft!` from an index.
- **`method_source`** and **`unparser`** — required only for the deprecated `witchcraft!` path. Not needed for the default compiled compose path. Install them only if you still call `witchcraft!` from an index.

If these gems are missing you'll get a `LoadError` when the relevant feature is used.

Expand Down
3 changes: 1 addition & 2 deletions lib/chewy/index/compiled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ class Index
# per-field arity into the call site and inlines hash construction,
# removing the per-field iteration + dispatch overhead of the legacy
# plain compose path. Proc bodies are NOT inlined — procs are called
# via `.call`. In exchange there are no parser/unparser/method_source
# deps and no Ruby/Prism version coupling.
# via `.call`.
#
# `fields:` selection is supported: a dedicated method is generated
# and memoized per unique fields set.
Expand Down
17 changes: 2 additions & 15 deletions lib/chewy/index/witchcraft.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ def self.load_dependencies!
return if @dependencies_loaded

require 'method_source'
begin
require 'prism'
rescue LoadError
require 'parser/current'
end
require 'prism'
require 'unparser'
@dependencies_loaded = true
rescue LoadError
Expand All @@ -38,11 +34,6 @@ def witchcraft!
def check_requirements!
messages = []
messages << "MethodSource gem is required for the Witchcraft, please add `gem 'method_source'` to your Gemfile" unless Proc.method_defined?(:source)
if RUBY_VERSION >= '3.3'
messages << "Prism gem is required for the Witchcraft, please add `gem 'prism'` to your Gemfile" unless '::Prism'.safe_constantize
else
messages << "Parser gem is required for the Witchcraft, please add `gem 'parser'` to your Gemfile" unless '::Parser'.safe_constantize
end
messages << "Unparser gem is required for the Witchcraft, please add `gem 'unparser'` to your Gemfile" unless '::Unparser'.safe_constantize
messages = messages.join("\n")

Expand Down Expand Up @@ -211,11 +202,7 @@ def source_for(proc, nesting) # rubocop:disable Metrics/AbcSize
end

def ast_from_proc(proc)
if defined?(Prism)
Prism::Translation::ParserCurrent.parse(proc.source)
else
Parser::CurrentRuby.parse(proc.source)
end
Prism::Translation::ParserCurrent.parse(proc.source)
end

def extract_lambdas(node)
Expand Down
6 changes: 1 addition & 5 deletions lib/chewy/log_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ def render_action(action, event)

subject = payload[:type].presence || payload[:index]
action = "#{subject} #{action} (#{event.duration.round(1)}ms)"
action = if ActiveSupport.version >= Gem::Version.new('7.1')
color(action, GREEN, bold: true)
else
color(action, GREEN, true)
end
action = color(action, GREEN, bold: true)

debug(" #{action} #{description}")
end
Expand Down