def constant_to_dashed_path(constant)
      const_segments = constant.split('::')
      path_segments  = []

      const_segments.each_with_index do |segment, index|
        segment = segment.snake_case

        # Use dashes for the first segment (= top level directory).
        if const_segments.length > 1 and index == 0
          segment = segment.gsub('_', '-')
        end

        path_segments << segment
      end

      return path_segments.join('/') + '.rb'
    end
def constant_to_dashed_path(constant)
      const_segments = constant.split('::')
      path_segments  = []

      const_segments.each_with_index do |segment, index|
        segment = segment.snake_case

        # Use dashes for the first segment (= top level directory).
        if const_segments.length > 1 and index == 0
          segment = segment.gsub('_', '-')
        end

        path_segments << segment
      end

      return path_segments.join('/') + '.rb'
    end
Returns a path similar to {#constant_to_path} but using dashes instead of
 underscores for the first directory.

 @example
  constant_to_dashed_path('FooBar::Baz') # => "foo-bar/baz.rb"

 @see [#constant_to_path]