Method: Grape::Router.normalize_path

Defined in:
lib/grape/router.rb

.normalize_path(path) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/grape/router.rb', line 19

def self.normalize_path(path)
  path = +"/#{path}"
  path.squeeze!('/')
  path.sub!(%r{/+\Z}, '')
  path = '/' if path == ''
  path
end