Class: Zeitwerk::GemInflector

Inherits:
Inflector show all
Defined in:
lib/zeitwerk/gem_inflector.rb

Instance Method Summary collapse

Methods inherited from Inflector

#inflect

Constructor Details

#initialize(root_file) ⇒ GemInflector

Returns a new instance of GemInflector.



6
7
8
9
10
# File 'lib/zeitwerk/gem_inflector.rb', line 6

def initialize(root_file)
  namespace     = File.basename(root_file, ".rb")
  lib_dir       = File.dirname(root_file)
  @version_file = File.join(lib_dir, namespace, "version.rb")
end

Instance Method Details

#camelize(basename, abspath) ⇒ Object



13
14
15
# File 'lib/zeitwerk/gem_inflector.rb', line 13

def camelize(basename, abspath)
  abspath == @version_file ? "VERSION" : super
end