lib/rio/rl/uri.rb in rio-0.3.7 vs lib/rio/rl/uri.rb in rio-0.3.8

- old
+ new

@@ -1,8 +1,8 @@ #-- # =============================================================================== -# Copyright (c) 2005, Christopher Kleckner +# Copyright (c) 2005, 2006 Christopher Kleckner # All rights reserved # # This file is part of the Rio library for ruby. # # Rio is free software; you can redistribute it and/or modify @@ -20,11 +20,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # =============================================================================== #++ # # To create the documentation for Rio run the command -# rake rdoc +# ruby build_doc.rb # from the distribution directory. Then point your browser at the 'doc/rdoc' directory. # # Suggested Reading # * RIO::Doc::SYNOPSIS # * RIO::Doc::INTRO @@ -34,29 +34,36 @@ # <b>Rio is pre-alpha software. # The documented interface and behavior is subject to change without notice.</b> require 'rio/rl/base' +require 'rio/fs/url' + module RIO module RL class URIBase < Base - attr_reader :uri - attr_writer :base SCHEME = URI::REGEXP::PATTERN::SCHEME + attr_reader :uri + #attr :fs def initialize(u,*args) #p callstr('initialize',u,*args) # u should be a ::URI or something that can be parsed to one - args = _get_base_from_args(args) + args = _get_opts_from_args(args) @uri = _mkuri(u) self.join(*args) @uri.path = '/' if @uri.absolute? and @uri.path == '' + #@fs = self.openfs_ + super end + def openfs_() + RIO::FS::URL.create() + end def initialize_copy(*args) super @uri = @uri.clone unless @uri.nil? @base = @base.clone unless @base.nil? end - def _get_base_from_args(args) + def _get_opts_from_args(args) # args.each { |a| p "get_base len=#{args.length} #{a.class}##{a.to_s}" } @base = nil if !args.empty? and args[-1].kind_of?(::Hash) and (b = args.pop[:base]) @base = case b when URIBase then b.uri if b.uri.absolute?