diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-27 11:26:37 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-27 11:26:37 +0000 |
| commit | 94ded2a2bff2467f1df6df04bdb728e3a7f50a85 (patch) | |
| tree | 88192374e76ed931a993b02398cee149dc61889b /lib | |
| parent | 96fbb125f4d73897facc25f776b7c3c936e74376 (diff) | |
* lib/pathname.rb (Pathname#world_readable?): define only if
FileTest.world_readable? is available.
(Pathname#world_writable?): ditto.
[ruby-core:21566]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/pathname.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/pathname.rb b/lib/pathname.rb index b753696002..1f1433634a 100644 --- a/lib/pathname.rb +++ b/lib/pathname.rb @@ -889,8 +889,10 @@ class Pathname # * FileTest * # See <tt>FileTest.readable?</tt>. def readable?() FileTest.readable?(@path) end - # See <tt>FileTest.world_readable?</tt>. - def world_readable?() FileTest.world_readable?(@path) end + if FileTest.respond_to? :world_readable? + # See <tt>FileTest.world_readable?</tt>. + def world_readable?() FileTest.world_readable?(@path) end + end # See <tt>FileTest.readable_real?</tt>. def readable_real?() FileTest.readable_real?(@path) end @@ -916,8 +918,10 @@ class Pathname # * FileTest * # See <tt>FileTest.writable?</tt>. def writable?() FileTest.writable?(@path) end - # See <tt>FileTest.world_writable?</tt>. - def world_writable?() FileTest.world_writable?(@path) end + if FileTest.respond_to? :world_writable? + # See <tt>FileTest.world_writable?</tt>. + def world_writable?() FileTest.world_writable?(@path) end + end # See <tt>FileTest.writable_real?</tt>. def writable_real?() FileTest.writable_real?(@path) end |
