rio 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +225 -0
- data/README +12 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/ANNOUNCE +160 -71
- data/doc/RELEASE_NOTES +71 -2
- data/ex/colx.rb +1 -1
- data/ex/passwd_report.rb +4 -8
- data/ex/riocat +5 -5
- data/ex/riogunzip +1 -1
- data/ex/riogzip +6 -6
- data/ex/rioprompt.rb +6 -0
- data/lib/rio.rb +3 -13
- data/lib/rio/arycopy.rb +1 -1
- data/lib/rio/base.rb +1 -5
- data/lib/rio/construct.rb +75 -0
- data/lib/rio/constructor.rb +42 -11
- data/lib/rio/context.rb +1 -1
- data/lib/rio/context/dir.rb +50 -23
- data/lib/rio/context/methods.rb +5 -3
- data/lib/rio/{cxdir.rb → context/skip.rb} +24 -36
- data/lib/rio/context/stream.rb +38 -16
- data/lib/rio/cp.rb +24 -5
- data/lib/rio/dir.rb +8 -7
- data/lib/rio/doc/HOWTO.rb +33 -33
- data/lib/rio/doc/INTRO.rb +416 -256
- data/lib/rio/doc/MISC.rb +3 -1
- data/lib/rio/doc/SYNOPSIS.rb +28 -33
- data/lib/rio/entrysel.rb +76 -9
- data/lib/rio/file.rb +2 -1
- data/lib/rio/filter.rb +95 -0
- data/lib/rio/filter/closeoneof.rb +1 -1
- data/lib/rio/grande.rb +0 -74
- data/lib/rio/if.rb +2 -1
- data/lib/rio/if/basic.rb +1 -1
- data/lib/rio/if/csv.rb +1 -1
- data/lib/rio/if/dir.rb +1 -220
- data/lib/rio/if/fileordir.rb +26 -12
- data/lib/rio/if/grande.rb +55 -6
- data/lib/rio/if/grande_entry.rb +355 -0
- data/lib/rio/if/{methods.rb → grande_stream.rb} +69 -88
- data/lib/rio/if/path.rb +25 -3
- data/lib/rio/if/stream.rb +62 -37
- data/lib/rio/if/temp.rb +2 -2
- data/lib/rio/if/test.rb +23 -0
- data/lib/rio/impl/path.rb +5 -0
- data/lib/rio/match.rb +6 -3
- data/lib/rio/matchrecord.rb +50 -46
- data/lib/rio/{filter/chomp.rb → ops/construct.rb} +12 -20
- data/lib/rio/ops/create.rb +3 -0
- data/lib/rio/ops/dir.rb +12 -6
- data/lib/rio/ops/either.rb +17 -3
- data/lib/rio/ops/path.rb +4 -1
- data/lib/rio/ops/stream/input.rb +6 -1
- data/lib/rio/ops/stream/read.rb +1 -3
- data/lib/rio/{context/chomp.rb → prompt.rb} +17 -13
- data/lib/rio/rl/base.rb +1 -1
- data/lib/rio/rl/builder.rb +3 -1
- data/lib/rio/state.rb +7 -13
- data/lib/rio/stream.rb +8 -5
- data/lib/rio/stream/open.rb +1 -1
- data/lib/rio/version.rb +1 -1
- data/test/mswin32.rb +1 -1
- data/test/runtests_gem.rb +1 -1
- data/test/tc/all.rb +3 -0
- data/test/tc/copy-from.rb +13 -13
- data/test/tc/copy-to.rb +1 -1
- data/test/tc/copy.rb +1 -1
- data/test/tc/copydir.rb +0 -24
- data/test/tc/copysymlink.rb +39 -0
- data/test/tc/csv.rb +2 -2
- data/test/tc/csv2.rb +4 -4
- data/test/tc/misc.rb +16 -16
- data/test/tc/nolines.rb +26 -26
- data/test/tc/noqae.rb +74 -74
- data/test/tc/overload.rb +28 -28
- data/test/tc/riorl.rb +36 -0
- data/test/tc/selnosel.rb +36 -0
- data/test/tc/skip.rb +58 -0
- data/test/tc/skiplines.rb +42 -0
- data/test/tc/symlink.rb +1 -1
- data/test/tc/symlink0.rb +1 -1
- data/test/tc/temp.rb +1 -1
- data/test/tc/tempdir.rb +1 -1
- data/test/tc/testcase.rb +7 -1
- metadata +14 -8
- data/lib/rio/matchcolumns.rb +0 -266
- data/lib/rio/rangemath.rb +0 -44
@@ -36,26 +36,18 @@
|
|
36
36
|
|
37
37
|
|
38
38
|
module RIO
|
39
|
-
module
|
40
|
-
module
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
include IOE
|
52
|
-
# def self.extend_object(ioh)
|
53
|
-
# super
|
54
|
-
# cio = ioh.ios.clone
|
55
|
-
# cio.extend(IOE)
|
56
|
-
# ioh.iostack.push(cio)
|
57
|
-
# end
|
39
|
+
module Ops
|
40
|
+
module Construct
|
41
|
+
def strio(*args) new_rio(:strio,*args) end
|
42
|
+
def stdio(*args) new_rio(:stdio,*args) end
|
43
|
+
def stderr(*args) new_rio(:stderr,*args) end
|
44
|
+
def temp(*args) new_rio(:temp,*args) end
|
45
|
+
def tempfile(*args) new_rio(:tempfile,*args) end
|
46
|
+
def tempdir(*args) new_rio(:tempdir,*args) end
|
47
|
+
def tcp(*args) new_rio(:tcp,*args) end
|
48
|
+
def cmdio(*args) new_rio(:cmdio,*args) end
|
49
|
+
def sysio(*args) new_rio(:sysio,*args) end
|
50
|
+
def fd(*args) new_rio(:fd,*args) end
|
58
51
|
end
|
59
52
|
end
|
60
53
|
end
|
61
|
-
__END__
|
data/lib/rio/ops/create.rb
CHANGED
data/lib/rio/ops/dir.rb
CHANGED
@@ -122,7 +122,7 @@ module RIO
|
|
122
122
|
module Dir
|
123
123
|
module Existing
|
124
124
|
def selective?
|
125
|
-
%w[
|
125
|
+
%w[entry_sel stream_sel stream_nosel].any? { |k| cx.has_key?(k) }
|
126
126
|
end
|
127
127
|
def mkdir(*args) self end
|
128
128
|
def mkpath(*args) self end
|
@@ -178,7 +178,7 @@ module RIO
|
|
178
178
|
include Cp::Dir::Output
|
179
179
|
public
|
180
180
|
|
181
|
-
def entries(*args,&block) _set_select('entries'
|
181
|
+
def entries(*args,&block) _set_select('entries',*args,&block) end
|
182
182
|
|
183
183
|
def each(*args,&block)
|
184
184
|
# p callstr('each',*args)
|
@@ -217,10 +217,16 @@ module RIO
|
|
217
217
|
nil
|
218
218
|
end
|
219
219
|
end
|
220
|
-
|
220
|
+
def handle_skipped
|
221
|
+
#return unless cx.has_key?('skip_args') or cx['skipping']
|
222
|
+
return self unless cx.has_key?('skip_args')
|
223
|
+
args = cx['skip_args'] || []
|
224
|
+
self.skipentries(*args)
|
225
|
+
end
|
221
226
|
def each_(*args,&block)
|
222
227
|
#p "#{callstr('each_',*args)} sel=#{cx['sel'].inspect} nosel=#{cx['nosel'].inspect}"
|
223
|
-
|
228
|
+
handle_skipped()
|
229
|
+
sel = Match::Entry::Selector.new(cx['entry_sel'])
|
224
230
|
selfstr = (self.to_s == '.' ? nil : self.to_s)
|
225
231
|
self.ioh.each do |estr|
|
226
232
|
next if estr =~ /^\.(\.)?$/
|
@@ -234,7 +240,7 @@ module RIO
|
|
234
240
|
end
|
235
241
|
|
236
242
|
if cx.has_key?('all') and erio.directory?
|
237
|
-
rsel = Match::Entry::
|
243
|
+
rsel = Match::Entry::SelectorClassic.new(cx['r_sel'],cx['r_nosel'])
|
238
244
|
_add_recurse_iter_cx(erio).each(&block) if rsel.match?(erio)
|
239
245
|
end
|
240
246
|
|
@@ -277,7 +283,7 @@ module RIO
|
|
277
283
|
}
|
278
284
|
ario.cx = new_cx
|
279
285
|
end
|
280
|
-
CX_DIR_ITER_KEYS = %w[
|
286
|
+
CX_DIR_ITER_KEYS = %w[entry_sel]
|
281
287
|
CX_STREAM_ITER_KEYS = %w[stream_rectype stream_itertype stream_sel stream_nosel]
|
282
288
|
def _add_iter_cx(ario)
|
283
289
|
if nostreamenum?
|
data/lib/rio/ops/either.rb
CHANGED
@@ -97,10 +97,24 @@ module RIO
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def ss_type?
|
100
|
-
|
101
|
-
|
102
|
-
|
100
|
+
case cx['ss_type']
|
101
|
+
when nil
|
102
|
+
'entries'
|
103
|
+
when 'files', 'dirs', 'entries', 'skipfiles', 'skipdirs', 'skipentries'
|
104
|
+
cx['ss_type']
|
105
|
+
else
|
106
|
+
nil
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
require 'Pathname'
|
111
|
+
def realpath
|
112
|
+
new_rio(Impl::U.realpath(fspath))
|
113
|
+
end
|
114
|
+
def mountpoint?
|
115
|
+
Impl::U.mountpoint?(fspath)
|
103
116
|
end
|
117
|
+
|
104
118
|
end
|
105
119
|
|
106
120
|
module ExistOrNot
|
data/lib/rio/ops/path.rb
CHANGED
@@ -75,6 +75,7 @@ module RIO
|
|
75
75
|
def size(*args) Impl::U.size(self.to_s,*args) end
|
76
76
|
def size?(*args) Impl::U.size?(self.to_s,*args) end
|
77
77
|
def zero?(*args) Impl::U.zero?(self.to_s,*args) end
|
78
|
+
def root?(*args) Impl::U.root?(self.to_s) end
|
78
79
|
|
79
80
|
end
|
80
81
|
module URI
|
@@ -173,7 +174,7 @@ module RIO
|
|
173
174
|
end
|
174
175
|
|
175
176
|
def +(arg)
|
176
|
-
new_rio(softreset.
|
177
|
+
new_rio(softreset.to_str + ensure_rio(arg).to_str)
|
177
178
|
end
|
178
179
|
|
179
180
|
private
|
@@ -256,12 +257,14 @@ module RIO
|
|
256
257
|
end
|
257
258
|
end
|
258
259
|
require 'rio/ops/create'
|
260
|
+
require 'rio/ops/construct'
|
259
261
|
module RIO
|
260
262
|
module Ops
|
261
263
|
module Path
|
262
264
|
module Empty
|
263
265
|
include Ops::Path::Create
|
264
266
|
include Ops::Path::URI
|
267
|
+
include Ops::Construct
|
265
268
|
end
|
266
269
|
module ExistOrNot
|
267
270
|
def symlink(d)
|
data/lib/rio/ops/stream/input.rb
CHANGED
@@ -164,10 +164,15 @@ module RIO
|
|
164
164
|
|
165
165
|
def each_record_init_
|
166
166
|
end
|
167
|
-
|
167
|
+
def handle_skipped
|
168
|
+
return self unless cx.has_key?('skip_args')
|
169
|
+
args = cx['skip_args'] || []
|
170
|
+
self.skiprecords(*args)
|
171
|
+
end
|
168
172
|
def create_selrej()
|
169
173
|
sel_args = cx['stream_sel']
|
170
174
|
nosel_args = cx['stream_nosel']
|
175
|
+
handle_skipped
|
171
176
|
selrej = RIO::Match::Record::SelRej.new(self,sel_args,nosel_args)
|
172
177
|
[selrej,selrej.rangetops]
|
173
178
|
end
|
data/lib/rio/ops/stream/read.rb
CHANGED
@@ -34,20 +34,24 @@
|
|
34
34
|
# <b>Rio is pre-alpha software.
|
35
35
|
# The documented interface and behavior is subject to change without notice.</b>
|
36
36
|
|
37
|
+
#
|
38
|
+
|
39
|
+
require 'rio'
|
37
40
|
|
38
|
-
require 'rio/context/cxx.rb'
|
39
41
|
module RIO
|
40
|
-
|
41
|
-
|
42
|
-
require 'rio/filter/chomp'
|
43
|
-
def chomp(arg=true,&block)
|
44
|
-
cx['chomp'] = arg
|
45
|
-
add_filter(Filter::Chomp) if arg and self.ioh
|
46
|
-
each(&block) if block_given?
|
47
|
-
self
|
48
|
-
end
|
49
|
-
def chomp?() cxx?('chomp') end
|
50
|
-
def nochomp(arg=false,&block) chomp(arg,&block) end
|
51
|
-
end
|
42
|
+
def prompt(str="")
|
43
|
+
rio(?-).strip.print(str).gets
|
52
44
|
end
|
45
|
+
module_function :prompt
|
46
|
+
end
|
47
|
+
|
48
|
+
if $0 == __FILE__
|
49
|
+
eval DATA.read, nil, $0, __LINE__+4
|
53
50
|
end
|
51
|
+
|
52
|
+
__END__
|
53
|
+
|
54
|
+
puts
|
55
|
+
puts("Run the tests that came with the distribution")
|
56
|
+
puts("From the distribution directory use 'test/runtests.rb'")
|
57
|
+
puts
|
data/lib/rio/rl/base.rb
CHANGED
@@ -130,7 +130,7 @@ module RIO
|
|
130
130
|
def to_s() self.fspath || '' end
|
131
131
|
def ==(other) self.to_s == other.to_s end
|
132
132
|
def ===(other) self == other end
|
133
|
-
def =~(other) other =~ self.
|
133
|
+
def =~(other) other =~ self.to_str end
|
134
134
|
def length() self.to_s.length end
|
135
135
|
def fspath() nil end
|
136
136
|
def path() nil end
|
data/lib/rio/rl/builder.rb
CHANGED
@@ -113,7 +113,9 @@ module RIO
|
|
113
113
|
cl = Factory.instance.riorl_class(a0.scheme)
|
114
114
|
o = cl.new(a0,*a) unless cl.nil?
|
115
115
|
return o
|
116
|
-
when
|
116
|
+
when ::Symbol
|
117
|
+
a[0] = 'rio:' + a[0].to_s + ':'
|
118
|
+
when ?? , ?= , ?_ , ?", ?[, ?#, ?`
|
117
119
|
a[0] = 'rio:'+CHMAP[a[0]]+':'
|
118
120
|
when ?-
|
119
121
|
a[0] = ( a.size == 1 ? 'rio:'+CHMAP[a[0]]+':' : 'rio:cmdio:' )
|
data/lib/rio/state.rb
CHANGED
@@ -40,6 +40,7 @@ require 'rio/context'
|
|
40
40
|
require 'rio/context/methods'
|
41
41
|
require 'rio/ext'
|
42
42
|
require 'rio/symantics'
|
43
|
+
require 'rio/filter'
|
43
44
|
$trace_states = false
|
44
45
|
module RIO
|
45
46
|
|
@@ -49,7 +50,7 @@ module RIO
|
|
49
50
|
# the abstract state from which all are derived
|
50
51
|
# this level handles
|
51
52
|
# * some basic house keeping methods
|
52
|
-
# * the methods to communicate with the
|
53
|
+
# * the methods to communicate with the rio object
|
53
54
|
# * the state changing mechanism
|
54
55
|
# * and some basic error handling stubs
|
55
56
|
class Base
|
@@ -88,6 +89,7 @@ module RIO
|
|
88
89
|
def self.new_r(riorl)
|
89
90
|
new.init(riorl,Cx::Vars.new( { 'closeoneof' => true, 'closeoncopy' => true } ))
|
90
91
|
end
|
92
|
+
|
91
93
|
def init(riorl,cntx,iohandle=nil)
|
92
94
|
@rl = riorl
|
93
95
|
@cx = cntx
|
@@ -108,7 +110,7 @@ module RIO
|
|
108
110
|
|
109
111
|
# the method for changing states
|
110
112
|
# it's job is create an instance of the next state
|
111
|
-
# and change the value in the handle that is shared with the
|
113
|
+
# and change the value in the handle that is shared with the rio object
|
112
114
|
def become(new_class,*args)
|
113
115
|
p "become : #{self.class.to_s} => #{new_class.to_s} (#{self.mode?})" if $trace_states
|
114
116
|
#
|
@@ -121,9 +123,11 @@ module RIO
|
|
121
123
|
raise
|
122
124
|
end
|
123
125
|
end
|
126
|
+
|
124
127
|
def method_missing_trace_str(sym,*args)
|
125
128
|
"missing: "+self.class.to_s+'['+self.to_url+']'+'.'+sym.to_s+'('+args.join(',')+')'
|
126
129
|
end
|
130
|
+
|
127
131
|
def method_missing(sym,*args,&block)
|
128
132
|
p method_missing_trace_str(sym,*args) if $trace_states
|
129
133
|
|
@@ -166,21 +170,11 @@ module RIO
|
|
166
170
|
|
167
171
|
|
168
172
|
extend Forwardable
|
169
|
-
# def_instance_delegators(:rl,:path,:to_s,:fspath,:opaque,:host,:length)
|
170
173
|
def_instance_delegators(:rl,:path,:to_s,:fspath,:length)
|
171
174
|
|
172
|
-
# def fspath() @rl.fspath end
|
173
|
-
# def path() @rl.path() end
|
174
|
-
# def opaque() @rl.opaque() end
|
175
|
-
# def scheme() @rl.scheme() end
|
176
|
-
# def host() @rl.host() end
|
177
|
-
# def to_s() @rl.to_s() end
|
178
|
-
# def length() @rl.length end
|
179
|
-
|
180
|
-
|
181
175
|
def ==(other) @rl == other end
|
182
176
|
def ===(other) self == other end
|
183
|
-
def =~(other) other =~ self.
|
177
|
+
def =~(other) other =~ self.to_str end
|
184
178
|
def to_url() @rl.url end
|
185
179
|
def to_uri() @rl.uri end
|
186
180
|
alias to_str to_s
|
data/lib/rio/stream.rb
CHANGED
@@ -43,13 +43,13 @@ require 'rio/ops/stream/output'
|
|
43
43
|
require 'rio/ext'
|
44
44
|
|
45
45
|
require 'rio/filter/gzip'
|
46
|
-
require 'rio/filter/chomp'
|
46
|
+
#require 'rio/filter/chomp'
|
47
|
+
#require 'rio/filter/strip'
|
47
48
|
require 'rio/filter/closeoneof'
|
48
49
|
|
49
50
|
module RIO
|
50
51
|
|
51
52
|
module Stream #:nodoc: all
|
52
|
-
|
53
53
|
class Reset < Base
|
54
54
|
# Mixin the appropriate ops
|
55
55
|
#include Ops::Path::Str
|
@@ -108,6 +108,7 @@ module RIO
|
|
108
108
|
class Input < IOBase
|
109
109
|
include Ops::Stream::Input
|
110
110
|
include Ini
|
111
|
+
include Filters
|
111
112
|
def initialize_copy(*args)
|
112
113
|
#p callstr('enter Input:initialize_copy',*args)
|
113
114
|
super
|
@@ -117,10 +118,9 @@ module RIO
|
|
117
118
|
def add_extensions()
|
118
119
|
Ext::Input.add_extensions(self)
|
119
120
|
end
|
120
|
-
|
121
121
|
def add_filters
|
122
122
|
add_filter(Filter::GZipRead) if gzip?
|
123
|
-
|
123
|
+
add_line_filters()
|
124
124
|
if closeoneof?
|
125
125
|
add_filter(Filter::CloseOnEOF)
|
126
126
|
ioh.oncloseproc = proc { self.on_closeoneof }
|
@@ -152,6 +152,7 @@ module RIO
|
|
152
152
|
include Ops::Stream::Input
|
153
153
|
include Ops::Stream::Output
|
154
154
|
include Ini
|
155
|
+
include Filters
|
155
156
|
|
156
157
|
def initialize_copy(*args)
|
157
158
|
super
|
@@ -166,8 +167,10 @@ module RIO
|
|
166
167
|
Ext::Input.add_extensions(self)
|
167
168
|
Ext::Output.add_extensions(self)
|
168
169
|
end
|
170
|
+
|
169
171
|
def add_filters
|
170
|
-
|
172
|
+
add_line_filters()
|
173
|
+
|
171
174
|
if closeoneof?
|
172
175
|
add_filter(Filter::CloseOnEOF)
|
173
176
|
ioh.oncloseproc = proc { self.on_closeoneof }
|
data/lib/rio/stream/open.rb
CHANGED
data/lib/rio/version.rb
CHANGED
data/test/mswin32.rb
CHANGED
data/test/runtests_gem.rb
CHANGED
data/test/tc/all.rb
CHANGED
data/test/tc/copy-from.rb
CHANGED
@@ -43,18 +43,18 @@ class TC_copyfrom < Test::RIO::TestCase
|
|
43
43
|
str = "HelloWorld\n"
|
44
44
|
ario < str
|
45
45
|
assert(ario.closed?,"Rio closes after copy-from string")
|
46
|
-
assert_equal(str,ario.
|
46
|
+
assert_equal(str,ario.contents)
|
47
47
|
ario << str
|
48
|
-
assert_equal(str+str,ario.
|
48
|
+
assert_equal(str+str,ario.contents)
|
49
49
|
end
|
50
50
|
|
51
51
|
def test_arrayofstrings_file
|
52
52
|
ario = rio('oua').delete!.puts!("If you are seeing this, rio < array is broken")
|
53
53
|
str = "HelloWorld\n"
|
54
54
|
ario < [str]
|
55
|
-
assert_equal(str,ario.
|
55
|
+
assert_equal(str,ario.contents)
|
56
56
|
ario << [str]
|
57
|
-
assert_equal(str+str,ario.
|
57
|
+
assert_equal(str+str,ario.contents)
|
58
58
|
end
|
59
59
|
|
60
60
|
|
@@ -85,7 +85,7 @@ class TC_copyfrom < Test::RIO::TestCase
|
|
85
85
|
str = "HelloWorld\n"
|
86
86
|
ario < str
|
87
87
|
assert(ario.file?,"Copy from string creates a file")
|
88
|
-
assert_equal(str,ario.
|
88
|
+
assert_equal(str,ario.contents)
|
89
89
|
end
|
90
90
|
|
91
91
|
def test_arrayofstrings_nonex
|
@@ -93,7 +93,7 @@ class TC_copyfrom < Test::RIO::TestCase
|
|
93
93
|
str = "HelloWorld\n"
|
94
94
|
ario < [str]
|
95
95
|
assert(ario.file?,"Copy from array of strings creates a file")
|
96
|
-
assert_equal(str,ario.
|
96
|
+
assert_equal(str,ario.contents)
|
97
97
|
end
|
98
98
|
|
99
99
|
def test_simple_rio0
|
@@ -129,8 +129,8 @@ class TC_copyfrom < Test::RIO::TestCase
|
|
129
129
|
url = 'http://localhost/rio/hw.html'
|
130
130
|
urio = rio(url)
|
131
131
|
ario < urio
|
132
|
-
exp = urio.
|
133
|
-
assert_equal(exp,ario.
|
132
|
+
exp = urio.contents
|
133
|
+
assert_equal(exp,ario.contents)
|
134
134
|
end
|
135
135
|
def test_uri_rio_to_dir
|
136
136
|
ario = rio('ud').delete!.mkdir
|
@@ -141,7 +141,7 @@ class TC_copyfrom < Test::RIO::TestCase
|
|
141
141
|
$trace_states = false
|
142
142
|
drio = rio(ario,urio.filename)
|
143
143
|
assert(drio.file?)
|
144
|
-
assert(urio.
|
144
|
+
assert(urio.contents,drio.contents)
|
145
145
|
end
|
146
146
|
def test_uri_string_to_dir
|
147
147
|
ario = rio('uds').delete!.mkdir
|
@@ -152,28 +152,28 @@ class TC_copyfrom < Test::RIO::TestCase
|
|
152
152
|
$trace_states = false
|
153
153
|
drio = rio(ario,urio.filename)
|
154
154
|
assert(drio.file?)
|
155
|
-
assert(urio.
|
155
|
+
assert(urio.contents,drio.contents)
|
156
156
|
end
|
157
157
|
def test_url_string_to_file
|
158
158
|
ario = rio('out').delete!.touch
|
159
159
|
url = 'http://localhost/rio/hw.html'
|
160
160
|
ario < url
|
161
161
|
exp = url
|
162
|
-
assert_equal(exp,ario.
|
162
|
+
assert_equal(exp,ario.contents)
|
163
163
|
end
|
164
164
|
def test_url_array_to_file
|
165
165
|
ario = rio('out').delete!.touch
|
166
166
|
url = 'http://localhost/rio/hw.html'
|
167
167
|
ario < [url]
|
168
168
|
exp = url
|
169
|
-
assert_equal(exp,ario.
|
169
|
+
assert_equal(exp,ario.contents)
|
170
170
|
end
|
171
171
|
def test_url_string_to_nonex
|
172
172
|
ario = rio('outz').delete!
|
173
173
|
url = 'http://localhost/rio/hw.html'
|
174
174
|
ario < url
|
175
175
|
exp = url
|
176
|
-
assert_equal(exp,ario.
|
176
|
+
assert_equal(exp,ario.contents)
|
177
177
|
end
|
178
178
|
def test_simple_ary
|
179
179
|
dst = rio('dst').delete!.mkpath
|