diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 90ec5d8c6..7988b36c5 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,10 @@ nav_order: 5 ## main +* Deprecate support for Ruby < 2.7 for removal in v3.0.0. + + *Joel Hawksley* + * Add `changelog_uri` to gemspec. *Joel Hawksley* diff --git a/lib/view_component/compiler.rb b/lib/view_component/compiler.rb index 49e975558..ca6faadfd 100644 --- a/lib/view_component/compiler.rb +++ b/lib/view_component/compiler.rb @@ -33,6 +33,10 @@ def compile(raise_errors: false, force: false) return if compiled? && !force return if component_class == ViewComponent::Base + if RUBY_VERSION < "2.7.0" + ViewComponent::Deprecation.warn("Support for Ruby versions < 2.7.0 will be removed in v3.0.0.") + end + component_class.superclass.compile(raise_errors: raise_errors) if should_compile_superclass? with_write_lock do