Sha256: eb6b6bb10192fa320e39c60afb24fbc235bb796fd8a292df9502d4b0508ca79c

Contents?: true

Size: 636 Bytes

Versions: 56

Compression:

Stored size: 636 Bytes

Contents

require 'uri'

module URI

  # Ruby does not have built-in support for filesystem URIs, and definitely does not have built-in support for
  # using open-uri with filesystem URIs
  class File < Generic
    
    COMPONENT = [
          :scheme,  
          :path, 
          :fragment,
          :host
        ].freeze
        
    def initialize(*arg)
      arg[2] = ""
      super(*arg)
    end
    
    def self.build(args)
      tmp = Util::make_components_hash(self, args)
      return super(tmp)
    end
    
    def open(*rest, &block)
      ::File.open(self.path, *rest, &block)
    end
    
    @@schemes['FILE'] = File
  end
end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
json-schema-1.2.1 lib/json-schema/uri/file.rb
json-schema-1.2.0 lib/json-schema/uri/file.rb
json-schema-2.1.3 lib/json-schema/uri/file.rb
json-schema-2.1.2 lib/json-schema/uri/file.rb
json-schema-2.1.1 lib/json-schema/uri/file.rb
json-schema-2.1.0 lib/json-schema/uri/file.rb
json-schema-2.0.5 lib/json-schema/uri/file.rb
json-schema-2.0.4 lib/json-schema/uri/file.rb
json-schema-2.0.3 lib/json-schema/uri/file.rb
json-schema-2.0.2 lib/json-schema/uri/file.rb
json-schema-2.0.1 lib/json-schema/uri/file.rb
json-schema-2.0.0 lib/json-schema/uri/file.rb
json-schema-1.1.1 lib/json-schema/uri/file.rb
json-schema-1.1.0 lib/json-schema/uri/file.rb
json-schema-1.0.12 lib/json-schema/uri/file.rb
json-schema-1.0.11 lib/json-schema/uri/file.rb
json-schema-1.0.10 lib/json-schema/uri/file.rb
json-schema-1.0.9 lib/json-schema/uri/file.rb
json-schema-1.0.8 lib/json-schema/uri/file.rb
json-schema-1.0.7 lib/json-schema/uri/file.rb