Class: Karafka::Web::Inflector
- Inherits:
-
Zeitwerk::GemInflector
- Object
- Zeitwerk::GemInflector
- Karafka::Web::Inflector
- Defined in:
- lib/karafka/web/inflector.rb
Overview
Web UI Zeitwerk Inflector that allows us to have time prefixed files with migrations, similar to how Rails does that.
Instance Method Summary collapse
-
#camelize(basename, abspath) ⇒ String
Constant name to be used for given file.
Instance Method Details
#camelize(basename, abspath) ⇒ String
Returns Constant name to be used for given file.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/karafka/web/inflector.rb', line 19 def camelize(basename, abspath) # If not migration directory with proper migration files, use defaults return super unless abspath.match?(MIGRATION_ABSPATH_REGEXP) # If base name is not of a proper name in migrations, use defaults return super unless basename.match?(MIGRATION_BASENAME_REGEXP) super( # Extract only the name without the timestamp basename.match(MIGRATION_BASENAME_REGEXP).to_a.last, abspath ) end |