lib/rio/scheme/strio.rb in rio-0.5.1 vs lib/rio/scheme/strio.rb in rio-0.6.0
- old
+ new
@@ -1,8 +1,8 @@
#--
# ===========================================================================
-# Copyright (c) 2005-2012 Christopher Kleckner
+# Copyright (c) 2005-2017 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
@@ -35,11 +35,10 @@
class RRL < ::RIO::RRL::IOIBase
RIOSCHEME = 'strio'
RIOPATH = RIO::RRL::CHMAP.invert[RIOSCHEME].to_s.freeze
attr_accessor :str
def initialize(u,str="")
- #p "StrIO::RRL initialize: u=#{u.inspect} str=#{str.inspect}"
alturi = ::Alt::URI.parse(u.to_s)
super(alturi)
self.query ||= str
@sio = self.query
end
@@ -60,10 +59,9 @@
uri.query.nil? ? nil : ObjectSpace._id2ref(uri.query.hex)
end
alias :stringio :query
alias :stringio= :query=
def open(m,*args)
- #p "STRIO open: m=#{m} args=#{args.inspect}"
strio = self.stringio
str = strio.string
nstrio = self.stringio.reopen(str,m.to_s)
super(nstrio)
end