File: inflector_fixes.rb

package info (click to toggle)
ruby-versionist 2.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 244 kB
  • sloc: ruby: 798; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Versionist
  # Various fixes for quirks in Rails' inflector
  module InflectorFixes
    # Transforms a module name for use in a route
    def module_name_for_route(module_name)
      module_name.gsub(/_{1}/, "__")
    end

    # Transforms a module name for use in a file path
    def module_name_for_path(module_name)
      module_name.underscore
    end
  end
end