lib/rio/ops/either.rb in rio-0.3.7 vs lib/rio/ops/either.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
@@ -55,37 +55,38 @@
module FileOrDir
module ExistOrNot
end
module NonExisting
include ExistOrNot
+ def empty?() false end
end
module Existing
include ExistOrNot
- def chmod(mod) rtn_self { Impl::U.chmod(mod,fspath) } end
- def chown(owner,group) rtn_self { Impl::U.chown(owner,group,fspath) } end
+ def chmod(mod) rtn_self { fs.chmod(mod,fspath) } end
+ def chown(owner,group) rtn_self { fs.chown(owner,group,fspath) } end
def must_exist() self end
def rename(*args,&block)
if args.empty?
softreset.rename(*args,&block)
else
rtn_reset {
dst = ensure_rio(args.shift)
- Impl::U.mv(self,dst,*args)
+ fs.mv(self,dst,*args)
dst.reset
}
end
end
def rename!(*args,&block)
if args.empty?
softreset.rename(*args,&block)
else
rtn_reset {
dst = ensure_rio(args.shift)
- Impl::U.mv(self,dst,*args)
+ fs.mv(self,dst,*args)
dst.reset
self.rl = dst.rl.clone
}
end
end
@@ -115,15 +116,16 @@
end
end
require 'pathname'
def realpath
- new_rio(Impl::U.realpath(fspath))
+ new_rio(fs.realpath(fspath))
end
def mountpoint?
- Impl::U.mountpoint?(fspath)
+ fs.mountpoint?(fspath)
end
-
+ def empty?() self.to_a.empty? end
+
end
end
end
end