Sha256: 1359a1e764de91a09d80103b828b3fc18cb52d3d66448d3ba8fb472f79e29dc3

Contents?: true

Size: 317 Bytes

Versions: 4

Compression:

Stored size: 317 Bytes

Contents

module EasySwaggerUi
  module RouteMatcher
    def self.matches?(request)
      return false unless request.params[:doc_path] =~ %r{\A[\w\-/]*\z}
      filepath = File.join(
        EasySwaggerUi.base_path,
        request.params[:doc_path],
        'swagger.yml'
      )
      File.file?(filepath)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
easy_swagger_ui-0.1.3 lib/easy_swagger_ui/route_matcher.rb
easy_swagger_ui-0.1.2 lib/easy_swagger_ui/route_matcher.rb
easy_swagger_ui-0.1.1 lib/easy_swagger_ui/route_matcher.rb
easy_swagger_ui-0.1.0 lib/easy_swagger_ui/route_matcher.rb