Class: Zeitwerk::GemInflector

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

Instance Method Summary collapse

Constructor Details

#initialize(root_file) ⇒ GemInflector

Returns a new instance of GemInflector.

Parameters:

  • root_file (String)


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) ⇒ String

Parameters:

  • basename (String)
  • abspath (String)

Returns:

  • (String)


15
16
17
# File 'lib/zeitwerk/gem_inflector.rb', line 15

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