diff --git a/classes/FakeFS.html b/classes/FakeFS.html index 0c55f38..504f247 100644 --- a/classes/FakeFS.html +++ b/classes/FakeFS.html @@ -35,6 +35,8 @@
# File lib/fakefs/base.rb, line 8 +# File lib/fakefs/base.rb, line 7 def self.activate! Object.class_eval do remove_const(:Dir) remove_const(:File) + remove_const(:FileTest) remove_const(:FileUtils) - const_set(:Dir, FakeFS::Dir) - const_set(:File, FakeFS::File) + + const_set(:Dir, FakeFS::Dir) + const_set(:File, FakeFS::File) const_set(:FileUtils, FakeFS::FileUtils) + const_set(:FileTest, FakeFS::FileTest) end + true end
# File lib/fakefs/base.rb, line 19 +# File lib/fakefs/base.rb, line 22 def self.deactivate! Object.class_eval do remove_const(:Dir) remove_const(:File) + remove_const(:FileTest) remove_const(:FileUtils) - const_set(:Dir, RealDir) - const_set(:File, RealFile) + + const_set(:Dir, RealDir) + const_set(:File, RealFile) + const_set(:FileTest, RealFileTest) const_set(:FileUtils, RealFileUtils) end + true end
# File lib/fakefs/dir.rb, line 55 @@ -245,8 +243,6 @@# File lib/fakefs/dir.rb, line 59 @@ -272,8 +268,6 @@# File lib/fakefs/dir.rb, line 63 @@ -299,8 +293,6 @@# File lib/fakefs/dir.rb, line 67 @@ -327,8 +319,6 @@# File lib/fakefs/dir.rb, line 72 @@ -355,8 +345,6 @@# File lib/fakefs/dir.rb, line 77 @@ -382,8 +370,6 @@# File lib/fakefs/dir.rb, line 81 @@ -409,8 +395,6 @@@@ -426,9 +411,9 @@# File lib/fakefs/dir.rb, line 85 @@ -418,6 +402,7 @@ parent = string.split('/') parent.pop raise Errno::ENOENT, "No such file or directory - #{string}" unless parent.join == "" || FileSystem.find(parent.join('/')) + raise Errno::EEXIST, "File exists - #{string}" if File.exists?(string) FileUtils.mkdir_p(string) end-+ @@ -437,12 +422,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/dir.rb, line 5 def initialize(string) raise Errno::ENOENT, string unless FileSystem.find(string) @@ -457,9 +440,9 @@-+ @@ -468,13 +451,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/dir.rb, line 92 ++# File lib/fakefs/dir.rb, line 93 def self.open(string, &block) if block_given? Dir.new(string).each { |file| yield(file) } @@ -488,9 +469,9 @@-+ @@ -499,13 +480,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/dir.rb, line 104 ++# File lib/fakefs/dir.rb, line 105 def self.pwd FileSystem.current_dir.to_s end@@ -515,9 +494,9 @@-+ @@ -526,13 +505,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/dir.rb, line 100 ++# File lib/fakefs/dir.rb, line 101 def self.tmpdir '/tmp' end@@ -544,9 +521,9 @@Instance Public methods-+ @@ -555,12 +532,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/dir.rb, line 13 def close @open = false @@ -587,8 +562,6 @@# File lib/fakefs/dir.rb, line 20 @@ -616,8 +589,6 @@# File lib/fakefs/dir.rb, line 26 @@ -643,8 +614,6 @@# File lib/fakefs/dir.rb, line 30 @@ -670,8 +639,6 @@# File lib/fakefs/dir.rb, line 34 @@ -697,8 +664,6 @@# File lib/fakefs/dir.rb, line 38 @@ -727,8 +692,6 @@# File lib/fakefs/dir.rb, line 45 @@ -754,8 +717,6 @@+ +# File lib/fakefs/dir.rb, line 49 diff --git a/classes/FakeFS/FakeDir.html b/classes/FakeFS/FakeDir.html index 08ae1d8..b9b9eb3 100644 --- a/classes/FakeFS/FakeDir.html +++ b/classes/FakeFS/FakeDir.html @@ -49,7 +49,7 @@
@@ -67,7 +67,7 @@ @@ -76,7 +76,7 @@ @@ -85,7 +85,7 @@ @@ -130,46 +130,32 @@ + + + ++ [R] + +ctime ++ + ++ [R] + +mtime ++ Class Public methods-- - - - - - - -- -Instance Public methods-@@ -180,11 +166,39 @@+ +-+# File lib/fakefs/fake/dir.rb, line 18 +# File lib/fakefs/fake/dir.rb, line 6 + def initialize(name = nil, parent = nil) + @name = name + @parent = parent + @ctime = Time.now + @mtime = @ctime + end+Instance Public methods+ ++ + + + + +++ Source: show + +
++# File lib/fakefs/fake/dir.rb, line 21 def clone(parent = nil) clone = Marshal.load(Marshal.dump(self)) clone.each do |key, value| @@ -212,11 +226,9 @@-# File lib/fakefs/fake/dir.rb, line 37 +# File lib/fakefs/fake/dir.rb, line 40 def delete(node = self) if node == self parent.delete(self) @@ -230,9 +242,9 @@-+ @@ -241,13 +253,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/dir.rb, line 10 ++# File lib/fakefs/fake/dir.rb, line 13 def entry self end@@ -257,9 +267,9 @@-+ @@ -268,13 +278,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/dir.rb, line 14 ++# File lib/fakefs/fake/dir.rb, line 17 def inspect "(FakeDir name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{size})" end@@ -297,11 +305,9 @@-# File lib/fakefs/fake/dir.rb, line 27 +# File lib/fakefs/fake/dir.rb, line 30 def to_s if parent && parent.to_s != '.' File.join(parent.to_s, name) diff --git a/classes/FakeFS/FakeFile.html b/classes/FakeFS/FakeFile.html index 1b11b80..5bd0713 100644 --- a/classes/FakeFS/FakeFile.html +++ b/classes/FakeFS/FakeFile.html @@ -49,11 +49,11 @@@@ -62,7 +62,7 @@ @@ -71,7 +71,7 @@ @@ -80,7 +80,7 @@ @@ -89,9 +89,9 @@ @@ -100,7 +100,7 @@ @@ -109,7 +109,7 @@ @@ -162,7 +162,15 @@ + + - [RW] + [R] + +ctime ++ + + [R] mtime @@ -183,9 +191,9 @@ Class Public methods-+ @@ -194,18 +202,17 @@- Source: show - - | on GitHub + Source: show
--@@ -215,9 +222,9 @@# File lib/fakefs/fake/file.rb, line 30 ++# File lib/fakefs/fake/file.rb, line 31 def initialize(name = nil, parent = nil) @name = name @parent = parent @inode = Inode.new(self) - @mtime = Time.now + @ctime = Time.now + @mtime = @ctime endInstance Public methods-+ @@ -226,13 +233,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/file.rb, line 55 ++# File lib/fakefs/fake/file.rb, line 57 def clone(parent = nil) clone = super() clone.parent = parent if parent @@ -245,9 +250,9 @@-+ @@ -256,13 +261,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/file.rb, line 39 ++# File lib/fakefs/fake/file.rb, line 41 def content @inode.content end@@ -272,9 +275,9 @@-+ @@ -283,13 +286,11 @@- Source: show - - | on GitHub + Source: show
--+ +# File lib/fakefs/fake/file.rb, line 43 ++-# File lib/fakefs/fake/file.rb, line 45 def content=(str) @inode.content = str end@@ -298,119 +299,10 @@- - - - - - - -- -- - - - - - - -- -- - - - - - - -- -- - - - - - - -- + ++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/fake/file.rb, line 64 + def entry + self + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/fake/file.rb, line 68 + def inspect + "(FakeFile name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{content.size})" + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/fake/file.rb, line 53 + def link(other_file) + @inode.link(other_file) + end++ + + + + +++ Source: show + +
++# File lib/fakefs/fake/file.rb, line 49 def links @inode.links end@@ -435,9 +426,9 @@-+ @@ -446,13 +437,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/file.rb, line 70 ++# File lib/fakefs/fake/file.rb, line 72 def to_s File.join(parent.to_s, name) enddiff --git a/classes/FakeFS/FakeFile/Inode.html b/classes/FakeFS/FakeFile/Inode.html index 1163500..597b83f 100644 --- a/classes/FakeFS/FakeFile/Inode.html +++ b/classes/FakeFS/FakeFile/Inode.html @@ -49,7 +49,7 @@@@ -58,7 +58,7 @@ @@ -76,7 +76,7 @@ @@ -132,11 +132,9 @@ -# File lib/fakefs/fake/file.rb, line 6 +# File lib/fakefs/fake/file.rb, line 7 def initialize(file_owner) @content = "" @links = [file_owner] @@ -149,9 +147,9 @@Instance Public methods-+ @@ -160,13 +158,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/file.rb, line 23 ++# File lib/fakefs/fake/file.rb, line 24 def clone clone = super clone.content = content.dup @@ -178,9 +174,9 @@-+ @@ -189,13 +185,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/file.rb, line 14 ++# File lib/fakefs/fake/file.rb, line 15 def link(file) links << file unless links.include?(file) file.inode = self @@ -206,9 +200,9 @@-+ @@ -217,13 +211,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/fake/file.rb, line 19 ++# File lib/fakefs/fake/file.rb, line 20 def unlink(file) links.delete(file) enddiff --git a/classes/FakeFS/FakeSymlink.html b/classes/FakeFS/FakeSymlink.html index 7863f7b..186feff 100644 --- a/classes/FakeFS/FakeSymlink.html +++ b/classes/FakeFS/FakeSymlink.html @@ -49,7 +49,7 @@@@ -58,7 +58,7 @@ @@ -67,7 +67,7 @@ @@ -76,7 +76,7 @@ @@ -85,7 +85,7 @@ @@ -128,9 +128,9 @@ Class Public methods-+ @@ -139,12 +139,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/fake/symlink.rb, line 6 def initialize(target) @target = target @@ -157,9 +155,9 @@Instance Public methods-+ @@ -168,12 +166,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/fake/symlink.rb, line 18 def delete parent.delete(self) @@ -184,9 +180,9 @@-+ @@ -195,12 +191,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/fake/symlink.rb, line 14 def entry FileSystem.find(target) @@ -211,9 +205,9 @@-+ @@ -222,12 +216,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/fake/symlink.rb, line 10 def inspect "symlink(#{target.split('/').last})" @@ -238,9 +230,9 @@-+ @@ -249,12 +241,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/fake/symlink.rb, line 22 def respond_to?(method) entry.respond_to?(method) diff --git a/classes/FakeFS/File.html b/classes/FakeFS/File.html index 79852e3..7ba2ccd 100644 --- a/classes/FakeFS/File.html +++ b/classes/FakeFS/File.html @@ -20,7 +20,7 @@ < - Object + StringIO @@ -45,11 +45,13 @@Methods-
- #
+- A
- @@ -58,7 +60,9 @@
-
- <<
+- atime,
+ +- autoclose?
- @@ -67,9 +71,19 @@
- @@ -78,11 +92,11 @@
-
- close,
+- chmod,
-- const_missing
+- chown,
+ +- close_on_exec=,
+ +- close_on_exec?,
+ +- const_missing,
+ +- ctime,
+ +- ctime
- @@ -93,9 +107,9 @@
-
- delete,
+- delete,
-- directory?,
+- directory?,
-- dirname
+- dirname
exist?, -exists?, +exists?, -expand_path, +expand_path, extname @@ -106,9 +120,18 @@+ + +I ++ @@ -126,7 +149,11 @@+ +
- ioctl
@@ -135,7 +162,9 @@ @@ -144,27 +173,7 @@ - - -
-- new
- -O -- - -- -
-- open
- -P -- @@ -173,15 +182,15 @@@@ -190,17 +199,32 @@ -
- read,
+- read,
-- read,
+- read_nonblock,
-- readlines,
+- readlines,
-- readlink,
+- readlink,
-- rewind
+- readpartial
+ + +T ++ @@ -209,7 +233,7 @@@@ -291,9 +315,9 @@ -
- write
+- write_nonblock
Class Public methods-+ @@ -302,13 +326,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 103 ++# File lib/fakefs/file.rb, line 113 def self.basename(*args) RealFile.basename(*args) end@@ -318,9 +340,9 @@-+ @@ -329,13 +351,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 69 ++# File lib/fakefs/file.rb, line 79 def self.const_missing(name) RealFile.const_get(name) end@@ -345,9 +365,9 @@-+ @@ -356,13 +376,40 @@+ +- Source: show - - | on GitHub + Source: show
--+ +# File lib/fakefs/file.rb, line 157 +++# File lib/fakefs/file.rb, line 59 + def self.ctime(path) + if exists?(path) + FileSystem.find(path).ctime + else + raise Errno::ENOENT + end + end++ + + + + +++ Source: show + +
++# File lib/fakefs/file.rb, line 159 def self.delete(file_name, *additional_file_names) if !exists?(file_name) raise Errno::ENOENT, "No such file or directory - #{file_name}" @@ -382,9 +429,9 @@-+ @@ -393,13 +440,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 73 ++# File lib/fakefs/file.rb, line 83 def self.directory?(path) if path.respond_to? :entry path.entry.is_a? FakeDir @@ -414,9 +459,9 @@-+ @@ -425,13 +470,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 107 ++# File lib/fakefs/file.rb, line 117 def self.dirname(path) RealFile.dirname(path) end@@ -454,11 +497,9 @@-# File lib/fakefs/file.rb, line 37 +# File lib/fakefs/file.rb, line 39 def self.exist?(path) !!FileSystem.find(path) end@@ -468,9 +509,9 @@-+ @@ -479,13 +520,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 99 ++# File lib/fakefs/file.rb, line 109 def self.expand_path(*args) RealFile.expand_path(*args) end@@ -508,11 +547,9 @@-# File lib/fakefs/file.rb, line 29 +# File lib/fakefs/file.rb, line 31 def self.extname(path) RealFile.extname(path) end@@ -522,9 +559,9 @@-+ @@ -533,13 +570,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 90 ++# File lib/fakefs/file.rb, line 100 def self.file?(path) if path.respond_to? :entry path.entry.is_a? FakeFile @@ -567,11 +602,9 @@-# File lib/fakefs/file.rb, line 33 +# File lib/fakefs/file.rb, line 35 def self.join(*parts) parts * PATH_SEPARATOR end@@ -581,9 +614,9 @@-+ @@ -592,13 +625,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 137 ++# File lib/fakefs/file.rb, line 139 def self.link(source, dest) if directory?(source) raise Errno::EPERM, "Operation not permitted - #{source} or #{dest}" @@ -624,9 +655,9 @@-+ @@ -635,13 +666,36 @@+ +- Source: show - - | on GitHub + Source: show
--+ +# File lib/fakefs/file.rb, line 49 +++# File lib/fakefs/file.rb, line 185 + def self.lstat(file) + File::Stat.new(file, true) + end++ + + + + +++ Source: show + +
++# File lib/fakefs/file.rb, line 51 def self.mtime(path) if exists?(path) FileSystem.find(path).mtime @@ -655,9 +709,9 @@-+ @@ -666,24 +720,22 @@- Source: show - - | on GitHub + Source: show
--@@ -691,9 +743,9 @@# File lib/fakefs/file.rb, line 207 ++# File lib/fakefs/file.rb, line 227 def initialize(path, mode = READ_ONLY, perm = nil) @path = path @mode = mode @file = FileSystem.find(path) - @open = true + @autoclose = true check_modes! file_creation_mode? ? create_missing_file : check_file_existence! - @stream = StringIO.new(@file.content, mode) + super(@file.content, mode) end-+ @@ -702,44 +754,11 @@ - -- -- - - - - --- Source: show - - | on GitHub - -
--# File lib/fakefs/file.rb, line 124 ++# File lib/fakefs/file.rb, line 126 def self.read(path) file = new(path) if file.exists? @@ -754,9 +773,9 @@-+ @@ -765,13 +784,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 133 ++# File lib/fakefs/file.rb, line 135 def self.readlines(path) read(path).split("\n") end@@ -781,9 +798,9 @@-+ @@ -792,13 +809,11 @@- Source: show - - | on GitHub + Source: show
--+ +# File lib/fakefs/file.rb, line 111 ++-# File lib/fakefs/file.rb, line 121 def self.readlink(path) symlink = FileSystem.find(path) FileSystem.find(symlink.target).to_s @@ -808,37 +823,10 @@- - - - - - - -- + ++ + + + + ++- -+ Source: show + +
+++# File lib/fakefs/file.rb, line 71 def self.size?(path) if exists?(path) && !size(path).zero? true @@ -866,10 +877,35 @@+ + + + + ++ - -++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 181 + def self.stat(file) + File::Stat.new(file) + end+- - - - - --- Source: show - - | on GitHub - -
--# File lib/fakefs/file.rb, line 175 +# File lib/fakefs/file.rb, line 177 def self.symlink(source, dest) FileUtils.ln_s(source, dest) end@@ -921,9 +928,9 @@-+ @@ -932,13 +939,11 @@- Source: show - - | on GitHub + Source: show
--# File lib/fakefs/file.rb, line 82 ++# File lib/fakefs/file.rb, line 92 def self.symlink?(path) if path.respond_to? :entry path.is_a? FakeSymlink @@ -954,27 +959,9 @@Instance Public methods-+ - -- --- - - --Alias for write -
- -- @@ -983,15 +970,13 @@ Alias for write- Source: show - - | on GitHub + Source: show
--@@ -999,9 +984,9 @@ Alias for write# File lib/fakefs/file.rb, line 220 - def close - @open = false ++# File lib/fakefs/file.rb, line 290 + def atime + raise NotImplementedError end-+ @@ -1010,15 +995,63 @@ Alias for write+ +- Source: show - - | on GitHub + Source: show
--+ +# File lib/fakefs/file.rb, line 232 - def exists? - true +++# File lib/fakefs/file.rb, line 335 + def autoclose? + @autoclose + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 315 + def binmode? + raise NotImplementedError + end++ + + + + ++@@ -1026,9 +1059,9 @@ Alias for write+ Source: show + +
++# File lib/fakefs/file.rb, line 294 + def chmod(mode_int) + raise NotImplementedError end-+ @@ -1037,58 +1070,13 @@ Alias for write - -- -- - -- --- - - --Alias for write -
- -- - - - - --- Source: show - - | on GitHub - -
--@@ -1096,9 +1084,9 @@ Alias for write# File lib/fakefs/file.rb, line 236 - def puts(*content) - @stream.puts(*content) ++# File lib/fakefs/file.rb, line 298 + def chown(owner_int, group_int) + raise NotImplementedError end-+ @@ -1107,15 +1095,63 @@ Alias for write- -+ +- Source: show - - | on GitHub + Source: show
--+ +# File lib/fakefs/file.rb, line 224 - def read(chunk = nil) - @stream.read(chunk) +++# File lib/fakefs/file.rb, line 319 + def close_on_exec=(bool) + raise NotImplementedError + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 323 + def close_on_exec? + raise NotImplementedError + end++ + + + + +++@@ -1125,7 +1161,7 @@ Alias for write+ Source: show + +
++# File lib/fakefs/file.rb, line 302 + def ctime + self.class.ctime(@path) end+ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 306 + def flock(locking_constant) + raise NotImplementedError + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 255 + def ioctl(integer_cmd, arg) + raise NotImplementedError + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 267 + def lstat + self.class.lstat(@path) + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 310 + def mtime + self.class.mtime(@path) + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 259 + def read_nonblock(maxlen, outbuf = nil) + raise NotImplementedError + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 286 + def readpartial(maxlen, outbuf = nil) + raise NotImplementedError + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 341 + def size + File.size(@path) + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 263 + def stat + self.class.stat(@path) + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 271 + def sysseek(position, whence = SEEK_SET) + seek(position, whence) + pos + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 278 + def to_io + self + end++ + + + + ++ - -++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 327 + def to_path + raise NotImplementedError + end+- - - - - - - -+ +-diff --git a/classes/FakeFS/File/Stat.html b/classes/FakeFS/File/Stat.html index 832c199..91c802c 100644 --- a/classes/FakeFS/File/Stat.html +++ b/classes/FakeFS/File/Stat.html @@ -49,7 +49,7 @@- Source: show - - | on GitHub - -
--# File lib/fakefs/file.rb, line 240 - def write(content) - @stream.write(content) +# File lib/fakefs/file.rb, line 282 + def write_nonblock(string) + raise NotImplementedError end@@ -58,9 +58,9 @@ -
- directory?
+- directory?
@@ -69,7 +69,9 @@ @@ -86,101 +88,35 @@ + Attributes++ +
++ + ++ [R] + +ctime ++ + + ++ [R] + +mtime ++ Class Public methods-- - - - - - - -- -Instance Public methods- -- - - - - - - -- -- - - - - - - --@@ -191,11 +127,123 @@+ ++# File lib/fakefs/file.rb, line 192 + def initialize(file, __lstat = false) + if !File.exists?(file) + raise(Errno::ENOENT, "No such file or directory - #{file}") + end + + @file = file + @fake_file = FileSystem.find(@file) + @__lstat = __lstat + @ctime = @fake_file.ctime + @mtime = @fake_file.mtime + end+Instance Public methods+ ++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 208 + def directory? + File.directory?(@file) + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 212 + def nlink + @fake_file.links.size + end++ + + + + ++ +++ ++ Source: show + +
+++# File lib/fakefs/file.rb, line 216 + def size + if @__lstat && symlink? + @fake_file.target.size + else + File.size(@file) + end + end++ + + + + +++ Source: show + +
++# File lib/fakefs/file.rb, line 204 def symlink? File.symlink?(@file) enddiff --git a/classes/FakeFS/FileSystem.html b/classes/FakeFS/FileSystem.html index 4d7fb07..0111ff4 100644 --- a/classes/FakeFS/FileSystem.html +++ b/classes/FakeFS/FileSystem.html @@ -43,7 +43,7 @@@@ -52,13 +52,13 @@ @@ -67,9 +67,9 @@ -
- chdir,
+- chdir,
-- clear,
+- clear,
-- clone,
+- clone,
-- current_dir
+- current_dir
@@ -78,11 +78,11 @@ -
- delete,
+- delete,
-- dir_levels
+- dir_levels
@@ -91,7 +91,7 @@ @@ -100,7 +100,7 @@ @@ -122,9 +122,9 @@ -
- path_parts
+- path_parts
Instance Public methods-+ @@ -133,12 +133,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 35 def add(path, object=FakeDir.new) parts = path_parts(normalize_path(path)) @@ -157,9 +155,9 @@-+ @@ -168,12 +166,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 74 def chdir(dir, &blk) new_dir = find(dir) @@ -192,9 +188,9 @@-+ @@ -203,12 +199,10 @@- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 13 def clear @dir_levels = nil @@ -220,9 +214,9 @@-+ @@ -238,12 +232,10 @@ copies directories and files from the real filesystem into our fake one- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 49 def clone(path) path = File.expand_path(path) @@ -269,9 +261,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -280,12 +272,10 @@ copies directories and files from the real filesystem into our fake one- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 99 def current_dir find(normalize_path('.')) @@ -296,9 +286,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -307,12 +297,10 @@ copies directories and files from the real filesystem into our fake one- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 68 def delete(path) if node = FileSystem.find(path) @@ -325,9 +313,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -336,12 +324,10 @@ copies directories and files from the real filesystem into our fake one- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 5 def dir_levels @dir_levels ||= [] @@ -352,9 +338,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -363,12 +349,10 @@ copies directories and files from the real filesystem into our fake one- Source: show - - | on GitHub + Source: show
-+# File lib/fakefs/file_system.rb, line 18 def files fs.values @@ -379,9 +363,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -390,12 +374,10 @@ copies directories and files from the real filesystem into our fake one