Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
extract_modules(name)
private
Extract modules from filesystem-style or ruby-style path:
good/fun/stuff
Good::Fun::Stuff
produce the same results.
# File railties/lib/rails_generator/base.rb, line 249
def extract_modules(name)
modules = name.include?('/') ? name.split('/') : name.split('::')
name = modules.pop
path = modules.map { |m| m.underscore }
file_path = (path + [name.underscore]).join('/')
nesting = modules.map { |m| m.camelize }.join('::')
[name, path, file_path, nesting, modules.size]
end