lib/grape/path.rb in grape-0.16.2 vs lib/grape/path.rb in grape-0.17.0

- old
+ new

@@ -20,14 +20,22 @@ def root_prefix split_setting(:root_prefix) end def uses_specific_format? - !!(settings[:format] && Array(settings[:content_types]).size == 1) + if settings.key?(:format) && settings.key?(:content_types) + (settings[:format] && Array(settings[:content_types]).size == 1) + else + false + end end def uses_path_versioning? - !!(settings[:version] && settings[:version_options][:using] == :path) + if settings.key?(:version) && settings[:version_options] && settings[:version_options].key?(:using) + (settings[:version] && settings[:version_options][:using] == :path) + else + false + end end def namespace? namespace && namespace.to_s =~ /^\S/ && namespace != '/' end