lib/rio/rl/path.rb in rio-0.4.2 vs lib/rio/rl/path.rb in rio-0.5.1

- old
+ new

@@ -1,8 +1,8 @@ #-- -# =============================================================================== -# Copyright (c) 2005,2006,2007,2008 Christopher Kleckner +# =========================================================================== +# Copyright (c) 2005-2012 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 @@ -16,27 +16,16 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Rio; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# =============================================================================== +# =========================================================================== #++ # -# To create the documentation for Rio run the command -# ruby build_doc.rb -# from the distribution directory. -# -# Suggested Reading -# * RIO::Doc::SYNOPSIS -# * RIO::Doc::INTRO -# * RIO::Doc::HOWTO -# * RIO::Doc::EXAMPLES -# * RIO::Rio -# -require 'rio/rl/uri' +require 'rio/alturi' require 'rio/rl/withpath' require 'rio/rl/pathmethods' module RIO module RL @@ -46,14 +35,14 @@ def arg0_info_(arg0,*args) #p "arg0_info_(#{arg0.inspect},#{args.inspect})" #p callstr('init_from_args_',arg0.inspect,args) vuri,vbase,vfs = nil,nil,nil case arg0 - when RIO::Rio, URIBase, ::URI + when RIO::Rio, URIBase, ::Alt::URI::Base, ::Alt::URI::File return super when ::String - vuri = uri_from_string_(RL.fs2url(arg0)) || ::URI.parse(RL.fs2url(arg0)) + vuri = uri_from_string_(arg0) || ::Alt::URI.parse(arg0) else raise(ArgumentError,"'#{arg0}'[#{arg0.class}] can not be used to create a Rio") end #puts "path.rb arg0_info_: vuri=#{vuri}" [vuri,vbase,vfs] @@ -74,18 +63,18 @@ !(hst.nil? || hst.empty? || hst == 'localhost') end def join(*args) return self if args.empty? - join_(args.map{ |arg| RL.fs2url(arg.to_s)}) + join_(args.map{ |arg| arg.to_s}) end - def fspath() - if use_host? - '//' + uri.host + RL.url2fs(self.urlpath) - else - RL.url2fs(self.urlpath) - end - end + #def fspath() + # if use_host? + # '//' + uri.host + RL.url2fs(self.urlpath) + # else + # RL.url2fs(self.urlpath) + # end + #end # def fspath=(pt) # if pt =~ %r|^//(#{HOST})(/.*)?$| # @host = $1 # @fspath = $2 || '/' # else