lib/sorbet-rails/utils.rb in sorbet-rails-0.5.3 vs lib/sorbet-rails/utils.rb in sorbet-rails-0.5.4
- old
+ new
@@ -10,6 +10,11 @@
# Rails 6.0 change the loading logic to use Zeitwerk
# https://github.com/rails/rails/blob/master/railties/lib/rails/application/finisher.rb#L116
# But this is not applied to Rails.application.eager_load! method
Zeitwerk::Loader.eager_load_all if defined?(Zeitwerk)
end
+
+ sig { params(method_name: String).returns(T::Boolean) }
+ def self.valid_method_name?(method_name)
+ !!method_name.match(/^[A-z][A-z0-9_]*[!?=]?$/)
+ end
end