diff --git a/classes/FakeFS.html b/classes/FakeFS.html index 9ae4927..0c55f38 100644 --- a/classes/FakeFS.html +++ b/classes/FakeFS.html @@ -21,10 +21,10 @@
- Source: show + Source: show - | on GitHub + | on GitHub
-# File lib/fakefs/base.rb, line 8 def self.activate! Object.class_eval do @@ -145,9 +149,9 @@
- Source: show + Source: show - | on GitHub + | on GitHub
-# File lib/fakefs/base.rb, line 19 def self.deactivate! Object.class_eval do diff --git a/classes/FakeFS/Dir.html b/classes/FakeFS/Dir.html index 86fe3b1..b9f4570 100644 --- a/classes/FakeFS/Dir.html +++ b/classes/FakeFS/Dir.html @@ -62,7 +62,7 @@
Source: show - | on GitHub + | on GitHub
Source: show - | on GitHub + | on GitHub
Source: show - | on GitHub + | on GitHub
Source: show - | on GitHub + | on GitHub
- Source: show - - | on GitHub - -
-# File lib/fakefs/dir.rb, line 77 def self.foreach(dirname, &block) Dir.open(dirname) { |file| yield file } @@ -369,9 +369,9 @@
- Source: show + Source: show - | on GitHub + | on GitHub
-# File lib/fakefs/dir.rb, line 81 def self.glob(pattern) [FileSystem.find(pattern) || []].flatten.map{|e| e.to_s}.sort @@ -396,9 +396,9 @@
- Source: show + Source: show - | on GitHub + | on GitHub
-# File lib/fakefs/dir.rb, line 85 def self.mkdir(string, integer = 0) parent = string.split('/') @@ -426,9 +426,9 @@
- Source: show + Source: show - | on GitHub + | on GitHub
-# File lib/fakefs/dir.rb, line 5 def initialize(string) raise Errno::ENOENT, string unless FileSystem.find(string) @@ -470,7 +470,7 @@Source: show - | on GitHub + | on GitHub
@@ -487,37 +487,10 @@-- - - - - - - -- + +
+ Source: show + + | on GitHub + +
+# File lib/fakefs/dir.rb, line 100 def self.tmpdir '/tmp' @@ -544,9 +544,9 @@Instance Public methods-+ @@ -555,12 +555,12 @@- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/dir.rb, line 13 def close @open = false @@ -574,9 +574,9 @@-+ @@ -585,12 +585,12 @@- Source: show + Source: show - | on GitHub + | on GitHub
-++ +-# File lib/fakefs/dir.rb, line 20 def each(&block) while f = read @@ -602,37 +602,10 @@- - - - - - - --@@ -643,13 +616,13 @@@@ -659,7 +632,7 @@ @@ -686,7 +659,7 @@ + +Source: show - | on GitHub + | on GitHub
-# File lib/fakefs/dir.rb, line 30 - def pos - @pointer +# File lib/fakefs/dir.rb, line 26 + def path + @path end+ + + + + +++ Source: show + + | on GitHub + +
+# File lib/fakefs/dir.rb, line 38 def read raise IOError, "closed directory" if @pointer == nil @@ -727,7 +727,7 @@Source: show - | on GitHub + | on GitHub
@@ -754,7 +754,7 @@Source: show - | on GitHub + | on GitHub
diff --git a/classes/FakeFS/FakeDir.html b/classes/FakeFS/FakeDir.html index 697a00c..08ae1d8 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 @@
- @@ -94,7 +94,7 @@
- @@ -137,9 +137,9 @@
Class Public methods-+ @@ -148,12 +148,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/dir.rb, line 5 def initialize(name = nil, parent = nil) @name = name @@ -167,9 +167,9 @@Instance Public methods-+ @@ -178,12 +178,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/dir.rb, line 18 def clone(parent = nil) clone = Marshal.load(Marshal.dump(self)) @@ -230,9 +230,9 @@-+ @@ -241,12 +241,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/dir.rb, line 10 def entry self @@ -257,9 +257,9 @@-+ @@ -268,12 +268,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/dir.rb, line 14 def inspect "(FakeDir name:#{name.inspect} parent:#{parent.to_s.inspect} size:#{size})" @@ -284,9 +284,9 @@-+ @@ -295,12 +295,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/dir.rb, line 27 def to_s if parent && parent.to_s != '.' diff --git a/classes/FakeFS/FakeFile.html b/classes/FakeFS/FakeFile.html index 8ed7748..1b11b80 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 @@
- @@ -152,6 +152,22 @@
+ + + ++ [RW] + +content ++ + ++ [RW] + +mtime ++ [RW] @@ -167,9 +183,9 @@ Class Public methods-+ @@ -178,17 +194,18 @@- Source: show + Source: show - | on GitHub + | on GitHub
--@@ -198,9 +215,9 @@# File lib/fakefs/fake/file.rb, line 24 ++# File lib/fakefs/fake/file.rb, line 30 def initialize(name = nil, parent = nil) @name = name @parent = parent @inode = Inode.new(self) + @mtime = Time.now endInstance Public methods-+ @@ -209,13 +226,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--- -# File lib/fakefs/fake/file.rb, line 48 ++-# File lib/fakefs/fake/file.rb, line 55 def clone(parent = nil) clone = super() clone.parent = parent if parent @@ -227,37 +244,10 @@- - - - - - - -- - -- - - - - - - -- -- - - - - - - -- -- - - - - - - -- -- - - - - - @@ -393,7 +274,7 @@ + ++ ++ + + + + + + ++ ++ + + + + + @@ -420,7 +356,7 @@ + ++ ++ + + + + + + ++ ++ + + + + + + ++ ++ + + + + +++ Source: show + + | on GitHub + +
++# File lib/fakefs/fake/file.rb, line 70 def to_s File.join(parent.to_s, name) enddiff --git a/classes/FakeFS/FakeFile/Inode.html b/classes/FakeFS/FakeFile/Inode.html index 5f412d7..1163500 100644 --- a/classes/FakeFS/FakeFile/Inode.html +++ b/classes/FakeFS/FakeFile/Inode.html @@ -45,11 +45,20 @@Methods+
- C
+- +
++ +
+- clone
+ +- L
- @@ -67,7 +76,7 @@
- @@ -123,7 +132,7 @@
Source: show - | on GitHub + | on GitHub
@@ -140,9 +149,9 @@Instance Public methods-+ @@ -151,12 +160,41 @@+ +- Source: show + Source: show - | on GitHub + | on GitHub
-++ +++# File lib/fakefs/fake/file.rb, line 23 + def clone + clone = super + clone.content = content.dup + clone + end++ + + + + +++ Source: show + + | on GitHub + +
+# File lib/fakefs/fake/file.rb, line 14 def link(file) links << file unless links.include?(file) @@ -168,9 +206,9 @@-+ @@ -179,12 +217,12 @@- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/fake/file.rb, line 19 def unlink(file) links.delete(file) diff --git a/classes/FakeFS/FakeSymlink.html b/classes/FakeFS/FakeSymlink.html index 4a31649..7863f7b 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,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/symlink.rb, line 6 def initialize(target) @target = target @@ -157,9 +157,9 @@Instance Public methods-+ @@ -168,12 +168,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/symlink.rb, line 18 def delete parent.delete(self) @@ -184,9 +184,9 @@-+ @@ -195,12 +195,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/symlink.rb, line 14 def entry FileSystem.find(target) @@ -211,9 +211,9 @@-+ @@ -222,12 +222,12 @@- Source: show + Source: show | on GitHub
-+# File lib/fakefs/fake/symlink.rb, line 10 def inspect "symlink(#{target.split('/').last})" @@ -238,9 +238,9 @@-+ @@ -249,12 +249,12 @@- Source: show + Source: show | on GitHub
-+# 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 c6f99fd..79852e3 100644 --- a/classes/FakeFS/File.html +++ b/classes/FakeFS/File.html @@ -58,7 +58,7 @@- @@ -67,9 +67,9 @@
- @@ -78,11 +78,11 @@
-
- close,
+- close,
-- const_missing
+- const_missing
- @@ -91,13 +91,13 @@
-
- delete,
+- delete,
-- directory?,
+- directory?,
-- dirname
+- dirname
- @@ -106,7 +106,7 @@
-
- exist?,
+- exist?,
-- exists?,
+- exists?,
-- expand_path,
+- expand_path,
-- extname
+- extname
- @@ -164,13 +173,15 @@
- @@ -179,13 +190,17 @@
- @@ -241,23 +256,16 @@
- READ_ONLY_MODES +MODE_BITMASK = -[ READ_ONLY ] +RealFile::RDONLY | RealFile::WRONLY | RealFile::RDWR | RealFile::APPEND | RealFile::CREAT | RealFile::EXCL | RealFile::NONBLOCK | RealFile::TRUNC | RealFile::NOCTTY | RealFile::SYNC - - - -WRITE_ONLY_MODES +FILE_CREATION_BITMASK = -[ WRITE_ONLY, APPEND_WRITE_ONLY ] -- @@ -283,9 +291,9 @@TRUNCATION_MODES -= -[ WRITE_ONLY, READ_WRITE_TRUNCATE ] +RealFile::CREAT Class Public methods-+ @@ -294,13 +302,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 84 ++# File lib/fakefs/file.rb, line 103 def self.basename(*args) RealFile.basename(*args) end@@ -310,9 +318,9 @@-+ @@ -321,13 +329,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 50 ++# File lib/fakefs/file.rb, line 69 def self.const_missing(name) RealFile.const_get(name) end@@ -337,9 +345,9 @@-+ @@ -348,13 +356,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 138 ++# File lib/fakefs/file.rb, line 157 def self.delete(file_name, *additional_file_names) if !exists?(file_name) raise Errno::ENOENT, "No such file or directory - #{file_name}" @@ -374,9 +382,9 @@-+ @@ -385,13 +393,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 54 ++# File lib/fakefs/file.rb, line 73 def self.directory?(path) if path.respond_to? :entry path.entry.is_a? FakeDir @@ -406,9 +414,9 @@-+ @@ -417,13 +425,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--+ +# File lib/fakefs/file.rb, line 88 ++-# File lib/fakefs/file.rb, line 107 def self.dirname(path) RealFile.dirname(path) end@@ -432,64 +440,10 @@- - - - - - - -- -- - - - - - - -- + ++ + + + + + + ++ ++ + + + + +++ Source: show + + | on GitHub + +
++# File lib/fakefs/file.rb, line 29 def self.extname(path) RealFile.extname(path) end@@ -514,9 +522,9 @@-+ @@ -525,13 +533,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 71 ++# File lib/fakefs/file.rb, line 90 def self.file?(path) if path.respond_to? :entry path.entry.is_a? FakeFile @@ -546,9 +554,9 @@-+ @@ -557,13 +565,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 34 ++# File lib/fakefs/file.rb, line 33 def self.join(*parts) parts * PATH_SEPARATOR end@@ -573,9 +581,9 @@-+ @@ -584,13 +592,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 118 ++# File lib/fakefs/file.rb, line 137 def self.link(source, dest) if directory?(source) raise Errno::EPERM, "Operation not permitted - #{source} or #{dest}" @@ -599,11 +607,11 @@ if !exists?(source) raise Errno::ENOENT, "No such file or directory - #{source} or #{dest}" end - + if exists?(dest) raise Errno::EEXIST, "File exists - #{source} or #{dest}" end - + source = FileSystem.find(source) dest = FileSystem.add(dest, source.entry.clone) source.link(dest) @@ -616,9 +624,9 @@-+ @@ -627,22 +635,19 @@- Source: show + Source: show - | on GitHub + | on GitHub
--@@ -650,9 +655,9 @@# File lib/fakefs/file.rb, line 188 - def initialize(path, mode = READ_ONLY, perm = nil) - @path = path - @mode = mode - @file = FileSystem.find(path) - @open = true - - check_valid_mode - file_creation_mode? ? create_missing_file : check_file_existence! - truncate_file if truncation_mode? ++# File lib/fakefs/file.rb, line 49 + def self.mtime(path) + if exists?(path) + FileSystem.find(path).mtime + else + raise Errno::ENOENT + end end-+ @@ -661,13 +666,49 @@+ +- Source: show + Source: show - | on GitHub + | on GitHub
--+ +# File lib/fakefs/file.rb, line 97 +++# File lib/fakefs/file.rb, line 207 + def initialize(path, mode = READ_ONLY, perm = nil) + @path = path + @mode = mode + @file = FileSystem.find(path) + @open = true + + check_modes! + + file_creation_mode? ? create_missing_file : check_file_existence! + + @stream = StringIO.new(@file.content, mode) + end++ + + + + +++ Source: show + + | on GitHub + +
++# File lib/fakefs/file.rb, line 116 def self.open(path, mode=READ_ONLY, perm = 0644) if block_given? yield new(path, mode, perm) @@ -681,9 +722,9 @@-+ @@ -692,13 +733,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 105 ++# File lib/fakefs/file.rb, line 124 def self.read(path) file = new(path) if file.exists? @@ -713,9 +754,9 @@-+ @@ -724,13 +765,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 114 ++# File lib/fakefs/file.rb, line 133 def self.readlines(path) read(path).split("\n") end@@ -740,9 +781,9 @@-+ @@ -751,13 +792,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 92 ++# File lib/fakefs/file.rb, line 111 def self.readlink(path) symlink = FileSystem.find(path) FileSystem.find(symlink.target).to_s @@ -768,9 +809,9 @@-+ @@ -779,13 +820,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 46 ++# File lib/fakefs/file.rb, line 57 def self.size(path) read(path).length end@@ -795,9 +836,9 @@-+ @@ -806,13 +847,44 @@+ +- Source: show + Source: show - | on GitHub + | on GitHub
--+ +# File lib/fakefs/file.rb, line 160 +++# File lib/fakefs/file.rb, line 61 + def self.size?(path) + if exists?(path) && !size(path).zero? + true + else + nil + end + end++ + + + + +++ Source: show + + | on GitHub + +
++# File lib/fakefs/file.rb, line 179 def self.stat(file) File::Stat.new(file) end@@ -822,9 +894,9 @@-+ @@ -833,13 +905,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 156 ++# File lib/fakefs/file.rb, line 175 def self.symlink(source, dest) FileUtils.ln_s(source, dest) end@@ -849,9 +921,9 @@-+ @@ -860,13 +932,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 63 ++# File lib/fakefs/file.rb, line 82 def self.symlink?(path) if path.respond_to? :entry path.is_a? FakeSymlink @@ -900,9 +972,9 @@ Alias for write-+ @@ -911,13 +983,13 @@ Alias for write- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 199 ++# File lib/fakefs/file.rb, line 220 def close @open = false end@@ -927,9 +999,9 @@ Alias for write-+ @@ -938,15 +1010,15 @@ Alias for write+ +@@ -994,12 +1066,66 @@ Alias for write +- Source: show + Source: show - | on GitHub + | on GitHub
--@@ -967,11 +1039,11 @@ Alias for write# File lib/fakefs/file.rb, line 210 ++# File lib/fakefs/file.rb, line 232 def exists? - @file + true endSource: show - | on GitHub + | on GitHub
-# File lib/fakefs/file.rb, line 229 +# File lib/fakefs/file.rb, line 246 def flush; self; end+ + + + + + + ++ ++ + + + + + +@@ -1010,15 +1136,13 @@ Alias for write@@ -1026,9 +1150,9 @@ Alias for writeSource: show - | on GitHub + | on GitHub
-# File lib/fakefs/file.rb, line 214 - def puts(*content) - content.flatten.each do |obj| - write(obj.to_s + "\n") - end +# File lib/fakefs/file.rb, line 228 + def rewind + @stream.rewind end-+ @@ -1037,18 +1161,15 @@ Alias for writediff --git a/classes/FakeFS/File/Stat.html b/classes/FakeFS/File/Stat.html index 72efcab..832c199 100644 --- a/classes/FakeFS/File/Stat.html +++ b/classes/FakeFS/File/Stat.html @@ -49,7 +49,7 @@- Source: show + Source: show - | on GitHub + | on GitHub
--@@ -1078,16 +1199,13 @@ Alias for write# File lib/fakefs/file.rb, line 203 - def read - raise IOError, 'closed stream' unless @open - raise IOError, 'not opened for reading' if write_only? - - @file.content ++# File lib/fakefs/file.rb, line 248 + def seek(amount, whence = SEEK_SET) + @stream.seek(amount, whence) endSource: show - | on GitHub + | on GitHub
-# File lib/fakefs/file.rb, line 220 +# File lib/fakefs/file.rb, line 240 def write(content) - raise IOError, 'closed stream' unless @open - raise IOError, 'not open for writing' if read_only? - - @file.content += content + @stream.write(content) end- @@ -58,9 +58,9 @@
-
- directory?
+- directory?
- @@ -69,7 +69,7 @@
- @@ -91,9 +91,9 @@
Class Public methods-+ @@ -102,13 +102,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 165 ++# File lib/fakefs/file.rb, line 184 def initialize(file) if !File.exists?(file) raise(Errno::ENOENT, "No such file or directory - #{file}") @@ -124,9 +124,9 @@Instance Public methods-+ @@ -135,13 +135,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 177 ++# File lib/fakefs/file.rb, line 196 def directory? File.directory?(@file) end@@ -151,9 +151,9 @@-+ @@ -162,13 +162,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 181 ++# File lib/fakefs/file.rb, line 200 def nlink FileSystem.find(@file).links.size end@@ -178,9 +178,9 @@-+ @@ -189,13 +189,13 @@- Source: show + Source: show - | on GitHub + | on GitHub
--# File lib/fakefs/file.rb, line 173 ++# File lib/fakefs/file.rb, line 192 def symlink? File.symlink?(@file) enddiff --git a/classes/FakeFS/FileSystem.html b/classes/FakeFS/FileSystem.html index efc3f2b..4d7fb07 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,12 @@- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/file_system.rb, line 35 def add(path, object=FakeDir.new) parts = path_parts(normalize_path(path)) @@ -157,9 +157,9 @@-+ @@ -168,12 +168,12 @@- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/file_system.rb, line 74 def chdir(dir, &blk) new_dir = find(dir) @@ -192,9 +192,9 @@-+ @@ -203,12 +203,12 @@- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/file_system.rb, line 13 def clear @dir_levels = nil @@ -220,9 +220,9 @@-+ @@ -238,12 +238,12 @@ copies directories and files from the real filesystem into our fake one- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/file_system.rb, line 49 def clone(path) path = File.expand_path(path) @@ -269,9 +269,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -280,12 +280,12 @@ copies directories and files from the real filesystem into our fake one- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/file_system.rb, line 99 def current_dir find(normalize_path('.')) @@ -296,9 +296,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -307,12 +307,12 @@ copies directories and files from the real filesystem into our fake one- Source: show + Source: show - | on GitHub + | on GitHub
-+# File lib/fakefs/file_system.rb, line 68 def delete(path) if node = FileSystem.find(path) @@ -325,9 +325,9 @@ copies directories and files from the real filesystem into our fake one-+ @@ -336,12 +336,12 @@ copies directories and files from the real filesystem into our fake one