rio 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -1
  3. data/README +1 -1
  4. data/lib/rio.rb +5 -4
  5. data/lib/rio/abstract_method.rb +1 -1
  6. data/lib/rio/alturi.rb +10 -69
  7. data/lib/rio/alturi/algorithm.rb +1 -18
  8. data/lib/rio/alturi/escape.rb +0 -4
  9. data/lib/rio/alturi/parse.rb +0 -29
  10. data/lib/rio/alturi/path_parts.rb +0 -2
  11. data/lib/rio/alturi/uri_parts.rb +3 -32
  12. data/lib/rio/argv.rb +1 -1
  13. data/lib/rio/arraynge.rb +1 -3
  14. data/lib/rio/arycopy.rb +1 -1
  15. data/lib/rio/assert.rb +31 -47
  16. data/lib/rio/base.rb +1 -1
  17. data/lib/rio/callstr.rb +1 -1
  18. data/lib/rio/const.rb +1 -1
  19. data/lib/rio/construct.rb +1 -1
  20. data/lib/rio/constructor.rb +1 -1
  21. data/lib/rio/context.rb +8 -4
  22. data/lib/rio/context/autoclose.rb +1 -1
  23. data/lib/rio/context/binmode.rb +1 -7
  24. data/lib/rio/context/copying.rb +1 -1
  25. data/lib/rio/context/cxx.rb +1 -1
  26. data/lib/rio/context/dir.rb +1 -1
  27. data/lib/rio/context/encoding.rb +1 -2
  28. data/lib/rio/context/gzip.rb +1 -1
  29. data/lib/rio/context/methods.rb +1 -6
  30. data/lib/rio/context/skip.rb +1 -1
  31. data/lib/rio/context/stream.rb +1 -8
  32. data/lib/rio/cp.rb +1 -1
  33. data/lib/rio/cxuri.rb +11 -7
  34. data/lib/rio/dbg/trace_states.rb +0 -2
  35. data/lib/rio/def.rb +1 -1
  36. data/lib/rio/dir.rb +2 -2
  37. data/lib/rio/doc.rb +1 -1
  38. data/lib/rio/entrysel.rb +6 -6
  39. data/lib/rio/exception.rb +1 -1
  40. data/lib/rio/exception/copy.rb +1 -1
  41. data/lib/rio/exception/notimplemented.rb +1 -1
  42. data/lib/rio/exception/notsupported.rb +1 -1
  43. data/lib/rio/exception/open.rb +1 -12
  44. data/lib/rio/exception/state.rb +1 -1
  45. data/lib/rio/ext.rb +1 -8
  46. data/lib/rio/ext/csv.rb +1 -25
  47. data/lib/rio/ext/csv/csv-legacy.rb +1 -49
  48. data/lib/rio/ext/csv/csv.rb +1 -24
  49. data/lib/rio/ext/csv/filter.rb +1 -19
  50. data/lib/rio/ext/if.rb +1 -1
  51. data/lib/rio/ext/mp3info.rb +6 -5
  52. data/lib/rio/ext/splitlines.rb +1 -23
  53. data/lib/rio/ext/yaml.rb +1 -16
  54. data/lib/rio/ext/yaml/doc.rb +1 -6
  55. data/lib/rio/ext/yaml/tie.rb +4 -7
  56. data/lib/rio/ext/zipfile.rb +1 -56
  57. data/lib/rio/ext/zipfile/fs.rb +1 -30
  58. data/lib/rio/ext/zipfile/rl.rb +1 -128
  59. data/lib/rio/ext/zipfile/rootdir.rb +1 -30
  60. data/lib/rio/ext/zipfile/state.rb +1 -105
  61. data/lib/rio/ext/zipfile/wrap.rb +1 -86
  62. data/lib/rio/factory.rb +2 -100
  63. data/lib/rio/fibpipe.rb +0 -98
  64. data/lib/rio/file.rb +1 -12
  65. data/lib/rio/filter.rb +1 -1
  66. data/lib/rio/filter/closeoneof.rb +1 -10
  67. data/lib/rio/filter/gzip.rb +1 -16
  68. data/lib/rio/fs.rb +75 -92
  69. data/lib/rio/fs/base.rb +1 -1
  70. data/lib/rio/fs/impl.rb +1 -1
  71. data/lib/rio/fs/native.rb +1 -1
  72. data/lib/rio/fs/stream.rb +1 -1
  73. data/lib/rio/fs/url.rb +1 -1
  74. data/lib/rio/ftp/conncache.rb +1 -15
  75. data/lib/rio/ftp/dir.rb +1 -2
  76. data/lib/rio/ftp/fs.rb +1 -13
  77. data/lib/rio/fwd.rb +31 -8
  78. data/lib/rio/grande.rb +2 -4
  79. data/lib/rio/handle.rb +1 -1
  80. data/lib/rio/if.rb +1 -7
  81. data/lib/rio/if/basic.rb +1 -5
  82. data/lib/rio/if/csv.rb +1 -1
  83. data/lib/rio/if/dir.rb +1 -1
  84. data/lib/rio/if/file.rb +1 -1
  85. data/lib/rio/if/fileordir.rb +1 -1
  86. data/lib/rio/if/grande.rb +1 -1
  87. data/lib/rio/if/grande_entry.rb +1 -1
  88. data/lib/rio/if/grande_stream.rb +1 -1
  89. data/lib/rio/if/internal.rb +1 -1
  90. data/lib/rio/if/path.rb +1 -1
  91. data/lib/rio/if/rubyio.rb +1 -1
  92. data/lib/rio/if/string.rb +1 -1
  93. data/lib/rio/if/temp.rb +1 -1
  94. data/lib/rio/if/test.rb +1 -1
  95. data/lib/rio/if/yaml.rb +1 -1
  96. data/lib/rio/ioh.rb +42 -24
  97. data/lib/rio/iomode.rb +3 -3
  98. data/lib/rio/ios/fail.rb +1 -1
  99. data/lib/rio/ios/generic.rb +1 -1
  100. data/lib/rio/ios/mode.rb +1 -1
  101. data/lib/rio/ios/null.rb +1 -13
  102. data/lib/rio/iowrap.rb +1 -14
  103. data/lib/rio/kernel.rb +1 -2
  104. data/lib/rio/local.rb +1 -13
  105. data/lib/rio/match.rb +1 -2
  106. data/lib/rio/matchrecord.rb +5 -34
  107. data/lib/rio/no_warn.rb +1 -1
  108. data/lib/rio/nullio.rb +1 -1
  109. data/lib/rio/open3.rb +1 -10
  110. data/lib/rio/ops.rb +1 -1
  111. data/lib/rio/ops/construct.rb +1 -1
  112. data/lib/rio/ops/create.rb +1 -3
  113. data/lib/rio/ops/dir.rb +4 -46
  114. data/lib/rio/ops/either.rb +1 -3
  115. data/lib/rio/ops/file.rb +1 -25
  116. data/lib/rio/ops/path.rb +1 -18
  117. data/lib/rio/ops/stream.rb +4 -5
  118. data/lib/rio/ops/stream/input.rb +1 -10
  119. data/lib/rio/ops/stream/output.rb +1 -3
  120. data/lib/rio/ops/stream/read.rb +1 -1
  121. data/lib/rio/ops/stream/write.rb +1 -1
  122. data/lib/rio/ops/symlink.rb +1 -10
  123. data/lib/rio/path.rb +1 -4
  124. data/lib/rio/path/reset.rb +1 -6
  125. data/lib/rio/piper.rb +1 -4
  126. data/lib/rio/piper/cp.rb +1 -16
  127. data/lib/rio/prompt.rb +1 -1
  128. data/lib/rio/rectype.rb +1 -4
  129. data/lib/rio/rl/base.rb +1 -14
  130. data/lib/rio/rl/builder.rb +1 -12
  131. data/lib/rio/rl/chmap.rb +1 -11
  132. data/lib/rio/rl/fs2url.rb +1 -8
  133. data/lib/rio/rl/ioi.rb +1 -2
  134. data/lib/rio/rl/path.rb +1 -20
  135. data/lib/rio/rl/pathmethods.rb +1 -3
  136. data/lib/rio/rl/uri.rb +1 -11
  137. data/lib/rio/rl/withpath.rb +2 -30
  138. data/lib/rio/rrl/base.rb +1 -6
  139. data/lib/rio/rrl/builder.rb +2 -8
  140. data/lib/rio/rrl/chmap.rb +1 -11
  141. data/lib/rio/rrl/ioi.rb +1 -3
  142. data/lib/rio/rrl/path.rb +1 -11
  143. data/lib/rio/rrl/withpath.rb +8 -48
  144. data/lib/rio/scheme/aryio.rb +1 -1
  145. data/lib/rio/scheme/cmdio.rb +3 -15
  146. data/lib/rio/scheme/cmdpipe.rb +1 -5
  147. data/lib/rio/scheme/fd.rb +1 -1
  148. data/lib/rio/scheme/ftp.rb +1 -40
  149. data/lib/rio/scheme/http.rb +10 -7
  150. data/lib/rio/scheme/null.rb +1 -1
  151. data/lib/rio/scheme/path.rb +1 -63
  152. data/lib/rio/scheme/stderr.rb +1 -2
  153. data/lib/rio/scheme/stdio.rb +3 -3
  154. data/lib/rio/scheme/strio.rb +1 -3
  155. data/lib/rio/scheme/sysio.rb +1 -1
  156. data/lib/rio/scheme/tcp.rb +1 -2
  157. data/lib/rio/scheme/temp.rb +9 -38
  158. data/lib/rio/state.rb +4 -38
  159. data/lib/rio/state/data.rb +4 -5
  160. data/lib/rio/state/error.rb +2 -6
  161. data/lib/rio/stream.rb +1 -31
  162. data/lib/rio/stream/base.rb +1 -5
  163. data/lib/rio/stream/duplex.rb +1 -16
  164. data/lib/rio/stream/open.rb +1 -11
  165. data/lib/rio/symantics.rb +1 -1
  166. data/lib/rio/tempdir.rb +0 -2
  167. data/lib/rio/to_rio.rb +1 -1
  168. data/lib/rio/to_rio/all.rb +1 -1
  169. data/lib/rio/to_rio/array.rb +1 -1
  170. data/lib/rio/to_rio/io.rb +1 -1
  171. data/lib/rio/to_rio/object.rb +1 -1
  172. data/lib/rio/to_rio/string.rb +1 -1
  173. data/lib/rio/undef_rake_dsl.rb +3 -0
  174. data/lib/rio/uri/file.rb +1 -18
  175. data/lib/rio/uriref.rb +1 -18
  176. data/lib/rio/util.rb +1 -1
  177. data/lib/rio/version.rb +2 -2
  178. data/misc/update-copyright.rb +2 -2
  179. data/rio.gemspec +2 -3
  180. data/test/env.sh +1 -2
  181. data/test/http/tc/copy_from_http.rb +0 -1
  182. data/test/runhttp.rb +2 -1
  183. data/test/runtests.rb +7 -5
  184. data/test/tc/copyarray.rb +4 -4
  185. data/test/tc/copydir.rb +1 -1
  186. metadata +15 -47
@@ -1,15 +1,38 @@
1
- require 'forwardable'
2
-
3
1
  module RIO
4
2
  module Fwd
5
- extend Forwardable
6
- def fwd(target,*args)
7
- self.module_exec(target,args) do |targ,a|
8
- a.each do |sym|
9
- def_delegator targ, sym
10
- def_delegator targ, (sym.to_s+"=").to_sym
3
+ def fwd_reader(target, method)
4
+ line_no = __LINE__
5
+ str = %{
6
+ def #{method}(*args, &block)
7
+ #{target}.__send__(:#{method}, *args, &block)
8
+ end
9
+ }
10
+ module_eval(str,__FILE__,line_no)
11
+ end
12
+ def fwd_readers(target, *methods)
13
+ methods.each do |method|
14
+ fwd_reader target, method
15
+ end
16
+ end
17
+
18
+ def fwd_writer(target, method)
19
+ line_no = __LINE__
20
+ str = %{
21
+ def #{method}=(*args, &block)
22
+ #{target}.__send__(:#{method}=, *args, &block)
11
23
  end
24
+ }
25
+ module_eval(str,__FILE__,line_no)
26
+ end
27
+ def fwd_writers(target, *methods)
28
+ methods.each do |method|
29
+ fwd_writer target, method
12
30
  end
13
31
  end
32
+
33
+ def fwd(target,*methods)
34
+ fwd_readers target, *methods
35
+ fwd_writers target, *methods
36
+ end
14
37
  end
15
38
  end
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -59,10 +59,8 @@ module RIO
59
59
  end
60
60
 
61
61
  def fixnumss(*args)
62
-
63
- #p args[0].class,ss_type?(_ss_keys())
64
62
  ss_args = cx['ss_args'] = args
65
- if ss_args.length == 1 and ss_args[0].kind_of?(Fixnum) and !cx.has_key?('dirlines')
63
+ if ss_args.length == 1 and ss_args[0].kind_of?(Integer) and !cx.has_key?('dirlines')
66
64
  ans = nil
67
65
  ss_type = ss_type?(_ss_keys())
68
66
 
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -37,16 +37,10 @@ require 'rio/if/internal'
37
37
 
38
38
  module RIO
39
39
  module IF
40
- #autoload :Grande, 'rio/if/grande'
41
40
  require 'rio/if/grande'
42
-
43
- #autoload :GrandeEntry, 'rio/if/grande_entry'
44
41
  require 'rio/if/grande_entry'
45
- #autoload :GrandeStream, 'rio/if/grande_stream'
46
42
  require 'rio/if/grande_stream'
47
- #autoload :Test, 'rio/if/test'
48
43
  require 'rio/if/test'
49
-
50
44
  require 'rio/if/path'
51
45
  require 'rio/if/fileordir'
52
46
  require 'rio/if/file'
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -23,9 +23,5 @@
23
23
  #
24
24
  module RIO
25
25
  class Rio
26
-
27
- #def to_rl() target.to_rl end
28
-
29
-
30
26
  end
31
27
  end
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #--
3
3
  # ===========================================================================
4
- # Copyright (c) 2005-2012 Christopher Kleckner
4
+ # Copyright (c) 2005-2017 Christopher Kleckner
5
5
  # All rights reserved
6
6
  #
7
7
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #--
3
3
  # ===========================================================================
4
- # Copyright (c) 2005-2012 Christopher Kleckner
4
+ # Copyright (c) 2005-2017 Christopher Kleckner
5
5
  # All rights reserved
6
6
  #
7
7
  # This file is part of the Rio library for ruby.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #--
3
3
  # ===========================================================================
4
- # Copyright (c) 2005-2012 Christopher Kleckner
4
+ # Copyright (c) 2005-2017 Christopher Kleckner
5
5
  # All rights reserved
6
6
  #
7
7
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #--
3
3
  # ===========================================================================
4
- # Copyright (c) 2005-2012 Christopher Kleckner
4
+ # Copyright (c) 2005-2017 Christopher Kleckner
5
5
  # All rights reserved
6
6
  #
7
7
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -35,7 +35,6 @@ module RIO
35
35
  def initialize_copy(other)
36
36
  #p callstr('ioh:initialize_copy',other)
37
37
  super
38
- #p @ios
39
38
  @ios = other.ios.clone unless other.ios.nil?
40
39
  end
41
40
  def callstr(func,*args)
@@ -90,16 +89,39 @@ module RIO
90
89
  end
91
90
  self
92
91
  end
93
- extend Forwardable
94
- def_instance_delegators(:handle,:binmode,:stat,:rewind,
95
- :each,:each_byte,:gets,:getc,
96
- :each_line,
97
- :read,:readlines,:readline,:sysread,
98
- :<<,:print,:printf,:putc,:write,:syswrite,
99
- :pos,:pos=,:lineno,:lineno=,
100
- :fileno,
101
- :close_read,:close_write,
102
- :fsync,:sync,:sync=,:fcntl,:ioctl)
92
+ extend RIO::Fwd
93
+
94
+ fwd_readers :handle,
95
+ :binmode,
96
+ :stat,
97
+ :rewind,
98
+ :each,
99
+ :each_byte,
100
+ :gets,
101
+ :getc,
102
+ :each_line,
103
+ :read,
104
+ :readlines,
105
+ :readline,
106
+ :sysread,
107
+ :print,
108
+ :printf,
109
+ :putc,
110
+ :write,
111
+ :syswrite,
112
+ :fileno,
113
+ :close_read,
114
+ :close_write,
115
+ :fsync,
116
+ :fcntl,
117
+ :ioctl,
118
+ :<<
119
+
120
+ fwd :handle,
121
+ :pos,
122
+ :lineno,
123
+ :sync
124
+
103
125
  def set_encoding(*args)
104
126
  handle.set_encoding(*args)
105
127
  end
@@ -141,22 +163,18 @@ module RIO
141
163
  end
142
164
  def closed?() ios.nil? end
143
165
  def each(&block)
144
- #p handle
145
166
  while filename = handle.read
146
- #p "IOH: #{filename.inspect} FS_ENCODING=#{FS_ENCODING}"
147
- #yield filename.force_encoding(FS_ENCODING)
148
167
  yield filename
149
168
  end
150
169
  end
151
- def each0(&block)
152
- handle.each { |filename|
153
- yield filename
154
- }
155
- end
156
- extend Forwardable
157
- def_instance_delegators(:handle,
158
- :read,
159
- :pos,:pos=,:tell,:seek,:rewind)
170
+
171
+ extend RIO::Fwd
172
+ fwd :handle, :pos
173
+ fwd_readers :handle,
174
+ :read,
175
+ :tell,
176
+ :seek,
177
+ :rewind
160
178
  end
161
179
  end
162
180
  end
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -60,8 +60,8 @@ module RIO
60
60
  def allows_write?()
61
61
  primarily_write? or allows_both?
62
62
  end
63
- extend Forwardable
64
- def_instance_delegators(:@mode,:=~,:==,:===)
63
+ extend RIO::Fwd
64
+ fwd_readers :@mode,:=~,:==,:===
65
65
  end
66
66
  end
67
67
  module Mode
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -62,19 +62,14 @@ module RIO
62
62
  def each_line(sep_string=$/,&block) self end
63
63
  def each_byte(sep_string=$/,&block) self end
64
64
  def eof?() true end
65
- #def fcntl(integer_cmd,arg) notsupported(:fcntl) end
66
- #def fileno() notsupported(:fileno) end
67
- #def to_i() notsupported(:to_i) end
68
65
  def flush() nil end
69
66
  def fsync() nil end
70
67
  def getc() nil end
71
68
  def gets(sep_string=$/) nil end
72
- #def ioctl(integer_cmd,arg) notsupported(:ioctl) end
73
69
  def tty?() false end
74
70
  def isatty() tty? end
75
71
  def lineno() @lineno end
76
72
  def lineno=(a) @lineno = a; lineno() end
77
- #def pid() notsupported(:pid) end
78
73
  def pos() 0 end
79
74
  def tell() pos() end
80
75
  def pos=(v) @pos = v; pos end
@@ -90,13 +85,6 @@ module RIO
90
85
  def reopen(*args) self end
91
86
  def rewind() 0 end
92
87
  def seek(amount,whence) 0 end
93
- #def stat() notsupported(:stat) end
94
- #def sync() notsupported(:sync) end
95
- #def sync=(v) notsupported(:sync=) end
96
- #def sysread() notsupported(:sysread) end
97
- #def sysseek() notsupported(:sysseek) end
98
- #def syswrite() notsupported(:syswrite) end
99
- #def ungetc() notsupported(:ungetc) end
100
88
  def write(str) str.length end
101
89
 
102
90
  def callstr(func,*args)
@@ -1,6 +1,6 @@
1
1
  #--
2
2
  # ===========================================================================
3
- # Copyright (c) 2005-2012 Christopher Kleckner
3
+ # Copyright (c) 2005-2017 Christopher Kleckner
4
4
  # All rights reserved
5
5
  #
6
6
  # This file is part of the Rio library for ruby.
@@ -93,20 +93,7 @@ module RIO
93
93
  @eof = true unless ans = handle.sysread(*args)
94
94
  ans
95
95
  end
96
- # extend Forwardable
97
- # def_instance_delegators(:handle,
98
- # :binmode,
99
- # :stat,
100
- # :rewind,
101
- # :<<,:print,:printf,:puts,:putc,:write,:syswrite,
102
- # :pos,:pos=,:lineno,:lineno=,
103
- # :fileno,
104
- # :close_read,:close_write,
105
- # :fsync,:sync,:sync=,:fcntl,:ioctl)
106
96
 
107
- #def puts(*args)
108
- # handle.puts(*args)
109
- #end
110
97
  def method_missing(sym,*args,&block)
111
98
  #p callstr('method_missing',sym,*args)
112
99
  handle.__send__(sym,*args,&block)