lib/rio/context/methods.rb in rio-0.3.7 vs lib/rio/context/methods.rb in rio-0.3.8

- old
+ new

@@ -1,8 +1,8 @@ #-- # =============================================================================== -# Copyright (c) 2005, Christopher Kleckner +# Copyright (c) 2005, 2006 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 @@ -20,11 +20,11 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # =============================================================================== #++ # # To create the documentation for Rio run the command -# rake rdoc +# ruby build_doc.rb # from the distribution directory. Then point your browser at the 'doc/rdoc' directory. # # Suggested Reading # * RIO::Doc::SYNOPSIS # * RIO::Doc::INTRO @@ -40,11 +40,11 @@ require 'rio/context/stream' require 'rio/context/dir' require 'rio/context/skip' require 'rio/filter' -require 'rio/context/closeoneof' +require 'rio/context/autoclose' require 'rio/context/gzip' require 'rio/context/copying' module RIO module Cx #:nodoc: all @@ -74,44 +74,14 @@ end protected :mode_ end end - module Cx - module Methods - def closeoncopy(arg=true,&block) cxx('closeoncopy',arg,&block) end - def nocloseoncopy(arg=false,&block) nocxx('closeoncopy',arg,&block) end - def closeoncopy?() cxx?('closeoncopy') end - def closeoncopy_(arg=true) cxx_('closeoncopy',arg) end - protected :closeoncopy_ - end - end - module Cx - module Methods - def noautoclose(arg=false,&block) - closeoncopy(arg).closeoneof(arg,&block) - end - def noautoclose_(arg=false) - closeoncopy_(arg).closeoneof_(arg) - end - protected :noautoclose_ - end - end module Cx module Methods - def autorewind(arg=true,&block) cxx('autorewind',arg,&block) end - def noautorewind(arg=false,&block) nocxx('autorewind',arg,&block) end - def autorewind?() cxx?('autorewind') end - def autorewind_(arg=true) cxx_('autorewind',arg) end - protected :autorewind_ - end - end - - module Cx - module Methods def sync(arg=true,&block) ioh.sync = arg unless ioh.nil? cxx('sync',arg,&block) end def nosync(arg=false,&block) @@ -181,19 +151,21 @@ self end protected :ext_ end end - +end +module RIO module Cx module Methods def a() cx['outputmode'] = Mode::Str.new('a'); self end def a!() cx['outputmode'] = Mode::Str.new('a+'); self end def w() cx['outputmode'] = Mode::Str.new('w'); self end def w!() cx['outputmode'] = Mode::Str.new('w+'); self end def r() cx['inputmode'] = Mode::Str.new('r'); self end def r!() cx['inputmode'] = Mode::Str.new('r+'); self end def outputmode?() cxx?('outputmode') end def inputmode?() cxx?('inputmode') end + def +@() a() end end end end