Sha256: 030b795ac46facd2e023dd62c11f42a5a6b6d8130fcb9f8faf9cd836edee97da

Contents?: true

Size: 328 Bytes

Versions: 4

Compression:

Stored size: 328 Bytes

Contents

module Yoda
  class Server
    module UriDecoder
      # @param uri_string [String]
      # @return [String, nil]
      def self.path_of_uri(uri_string)
        uri = URI.parse(uri_string)
        return nil unless uri.scheme == 'file'
        uri.path
      rescue URI::InvalidURIError
        nil
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
yoda-language-server-0.10.1 lib/yoda/server/uri_decoder.rb
yoda-language-server-0.10.0 lib/yoda/server/uri_decoder.rb
yoda-language-server-0.9.0 lib/yoda/server/uri_decoder.rb
yoda-language-server-0.8.0 lib/yoda/server/uri_decoder.rb