Skip to content

Commit

Permalink
Warn if using Ruby < 3.1 or Rails < 7.0, which will not be supported …
Browse files Browse the repository at this point in the history
…by ViewComponent v4. (#2090)
  • Loading branch information
joelhawksley authored Sep 6, 2024
1 parent 8f30d27 commit 45ffb7a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ nav_order: 5

## main

* Warn if using Ruby < 3.1 or Rails < 7.0, which will not be supported by ViewComponent v4.

*Joel Hawksley*

* Add Kicksite to list of companies using ViewComponent.

*Adil Lari*
*Adil Lari*

* Allow overridden slot methods to use `super`.

Expand Down
4 changes: 4 additions & 0 deletions lib/view_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module ViewComponent
autoload :TestCase
autoload :SystemTestCase
autoload :Translatable

if defined?(Rails) && Rails.version < "7.0"
Kernel.warn("ViewComponent v4 will drop support for Rails < 7.0 in 2025.")
end
end

require "view_component/engine" if defined?(Rails::Engine)
2 changes: 2 additions & 0 deletions view_component.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "net-imap"
spec.add_development_dependency "net-pop"
spec.add_development_dependency "net-smtp"
else
spec.post_install_message = "ViewComponent v4 will drop support for Ruby < 3.1 in 2025."
end
end

0 comments on commit 45ffb7a

Please sign in to comment.