class Object
Constants
- INSTDIR
- SRC_BASE
- STREAM_VERSION
Public Instance Methods
fs(fname)
click to toggle source
# File examples/examples.rb, line 14 def fs fname Stream::ImplicitStream.new { |s| f = open(fname) s.at_end_proc = proc {f.eof?} s.forward_proc = proc {f.readline} # Need not implement backward moving to use the framework } end
install()
click to toggle source
# File install.rb, line 10 def install begin pwd = Dir.pwd Dir.chdir(SRC_BASE) Dir['*.rb'].each do |file| dst = File.join( INSTDIR, file ) File.install(file, dst, 0644, true) end Dir.chdir(pwd) rescue puts $! end end
newstream()
click to toggle source
# File examples/examples.rb, line 29 def newstream; (1..6).create_stream; end
randomStream()
click to toggle source
an infinite stream (do not use set_to_end!)
# File examples/examples.rb, line 43 def randomStream Stream::ImplicitStream.new { |s| s.set_to_begin_proc = proc {srand 1234} s.at_end_proc = proc {false} s.forward_proc = proc {rand} } end