lib/grape/path.rb in grape-0.11.0 vs lib/grape/path.rb in grape-0.12.0
- old
+ new
@@ -15,11 +15,11 @@
def mount_path
settings[:mount_path]
end
def root_prefix
- split_setting(:root_prefix, '/')
+ split_setting(:root_prefix)
end
def uses_specific_format?
!!(settings[:format] && settings[:content_types].size == 1)
end
@@ -36,11 +36,11 @@
raw_path && raw_path.to_s =~ /^\S/ && raw_path != '/'
end
def suffix
if uses_specific_format?
- ''
+ "(.#{settings[:format]})"
elsif !uses_path_versioning? || (has_namespace? || has_path?)
'(.:format)'
else
'(/.:format)'
end
@@ -66,10 +66,10 @@
parts << namespace.to_s
parts << raw_path.to_s
parts.flatten.reject { |part| part == '/' }
end
- def split_setting(key, delimiter)
+ def split_setting(key)
return if settings[key].nil?
settings[key].to_s.split('/')
end
end
end