Skip to content

Commit

Permalink
Exclude incompatible rails versions (#41)
Browse files Browse the repository at this point in the history
Rails has shipped an incompatible change in ActiveView, that was reverted in later versions.

See more here: 
rails/rails#51023
  • Loading branch information
skatkov committed Feb 13, 2024
1 parent 36041df commit d8e8c01
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: 3.3.0
bundler-cache: true

- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.3
3.3.0
4 changes: 2 additions & 2 deletions lib/rails_twirp/mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def initialize(route_set)
@module = nil
end

def service(service_definition, **options, &block)
def service(service_definition, **, &block)
service_route_set = @route_set.services[service_definition]
service_mapper = ServiceMapper.new(service_route_set, self)
scope(**options) { service_mapper.instance_exec(&block) }
scope(**) { service_mapper.instance_exec(&block) }
end

def scope(**options)
Expand Down
7 changes: 5 additions & 2 deletions rails_twirp.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ Gem::Specification.new do |spec|

spec.files = `git ls-files`.split("\n")

spec.add_dependency "rails", ">= 6.1.3"
spec.add_dependency "twirp", ">= 1.9", "< 1.11"
# Rails has shipped an incompatible change in ActiveView, that was reverted in later versions.
# @see https://github.com/rails/rails/pull/51023
excluded_versions = ["7.1.0", "7.1.1", "7.1.2", "7.1.3"].map { |v| "!= #{v}" }
spec.add_runtime_dependency "rails", ">= 6.1.3", *excluded_versions
spec.add_runtime_dependency "twirp", ">= 1.9", "< 1.11"
spec.required_ruby_version = ">= 3"
end

0 comments on commit d8e8c01

Please sign in to comment.