fakefs 1.9.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 500e0a968d56bf506ef01cbcefc58b4f730163ae879740b3eef34262a43bc590
4
- data.tar.gz: 71f82ed6c1089ea2931df4309da70d21aa2a86128c7d3faca6dc51bdc60e4924
3
+ metadata.gz: abf14d547bbdb7ed5fa1ac7a10d5a875dd265c62e91c520b4da97ceb30046f60
4
+ data.tar.gz: c08a6cd7a05a4f787bb4b2d1c3871c13a8687af50729e1e735ac4fae6575b014
5
5
  SHA512:
6
- metadata.gz: a4a320ecdbefaff67348c2944d6a80d87bf162882ec5cd7d311390525a634477f04dbba03b5e09a95217f4bddeb575b43b988d3e2f141a4d1174c1223b41589a
7
- data.tar.gz: c6a640708d8349f5fed764bb45d449774f2d2559749f39ad32947960edd0cb7d464ee903a2d25793763f0fbc923c772a49c591d50db359d4d6ff346fb71f0d9a
6
+ metadata.gz: 53512a81bcf2e8b22c43abec8989cef5490bfc69341fe63fd2cada07cd74447fcb26a135e2d0907a7bd29bf10dd072d53d6b87d1fc932edf7bcd139b6b2bcec6
7
+ data.tar.gz: 1b4902e37c4fcd567ca90f1b98074c03b213b6d69206b1099c1f6cd5f97bf09402be7413f274cf9c02539dd1b135b72dbf9cde2ebc5c973b12200a058455f3b8
data/lib/fakefs/dir.rb CHANGED
@@ -66,7 +66,7 @@ module FakeFS
66
66
  glob pattern
67
67
  end
68
68
 
69
- def self.exists?(path)
69
+ def self.exist?(path)
70
70
  File.exist?(path) && File.directory?(path)
71
71
  end
72
72
 
@@ -279,7 +279,6 @@ module FakeFS
279
279
  alias getwd pwd
280
280
  alias rmdir delete
281
281
  alias unlink delete
282
- alias exist? exists?
283
282
  end
284
283
  end
285
284
  end
data/lib/fakefs/file.rb CHANGED
@@ -51,8 +51,6 @@ module FakeFS
51
51
  end
52
52
 
53
53
  class << self
54
- alias exists? exist?
55
-
56
54
  def identical?(one_path, another_path)
57
55
  FileSystem.find(one_path) == FileSystem.find(another_path)
58
56
  end
@@ -74,7 +72,7 @@ module FakeFS
74
72
  end
75
73
 
76
74
  def self.mtime(path)
77
- if exists?(path)
75
+ if exist?(path)
78
76
  FileSystem.find(path).mtime
79
77
  else
80
78
  raise Errno::ENOENT
@@ -82,7 +80,7 @@ module FakeFS
82
80
  end
83
81
 
84
82
  def self.ctime(path)
85
- if exists?(path)
83
+ if exist?(path)
86
84
  FileSystem.find(path).ctime
87
85
  else
88
86
  raise Errno::ENOENT
@@ -90,7 +88,7 @@ module FakeFS
90
88
  end
91
89
 
92
90
  def self.atime(path)
93
- if exists?(path)
91
+ if exist?(path)
94
92
  FileSystem.find(path).atime
95
93
  else
96
94
  raise Errno::ENOENT
@@ -99,7 +97,7 @@ module FakeFS
99
97
 
100
98
  def self.utime(atime, mtime, *paths)
101
99
  paths.each do |path|
102
- if exists?(path)
100
+ if exist?(path)
103
101
  FileSystem.find(path).atime = atime
104
102
  FileSystem.find(path).mtime = mtime
105
103
  else
@@ -119,11 +117,11 @@ module FakeFS
119
117
  end
120
118
 
121
119
  def self.size?(path)
122
- size(path) if exists?(path) && !size(path).zero?
120
+ size(path) if exist?(path) && !size(path).zero?
123
121
  end
124
122
 
125
123
  def self.zero?(path)
126
- exists?(path) && size(path) == 0
124
+ exist?(path) && size(path) == 0
127
125
  end
128
126
 
129
127
  if RUBY_VERSION >= '2.4'
@@ -249,8 +247,8 @@ module FakeFS
249
247
 
250
248
  def self.link(source, dest)
251
249
  raise Errno::EPERM, "#{source} or #{dest}" if directory?(source)
252
- raise Errno::ENOENT, "#{source} or #{dest}" unless exists?(source)
253
- raise Errno::EEXIST, "#{source} or #{dest}" if exists?(dest)
250
+ raise Errno::ENOENT, "#{source} or #{dest}" unless exist?(source)
251
+ raise Errno::EEXIST, "#{source} or #{dest}" if exist?(dest)
254
252
 
255
253
  source = FileSystem.find(source)
256
254
  dest = FileSystem.add(dest, source.entry.clone)
@@ -262,7 +260,7 @@ module FakeFS
262
260
  def self.delete(*files)
263
261
  files.each do |file|
264
262
  file_name = (file.class == FakeFS::File ? file.path : file.to_s)
265
- raise Errno::ENOENT, file_name unless exists?(file_name)
263
+ raise Errno::ENOENT, file_name unless exist?(file_name)
266
264
 
267
265
  FileUtils.rm(file_name)
268
266
  end
@@ -692,7 +690,7 @@ module FakeFS
692
690
  end
693
691
 
694
692
  def self.birthtime(path)
695
- if exists?(path)
693
+ if exist?(path)
696
694
  FileSystem.find(path).birthtime
697
695
  else
698
696
  raise Errno::ENOENT
data/lib/fakefs/pry.rb ADDED
@@ -0,0 +1,9 @@
1
+ # Define Pry class if it's not defined. Useful if pry
2
+ # is required after loading FakeFS
3
+ ::Pry = Class.new unless defined?(::Pry)
4
+
5
+ # Make the original file system classes available in Pry.
6
+ ::Pry::File = ::File
7
+ ::Pry::FileUtils = ::FileUtils
8
+ ::Pry::Dir = ::Dir
9
+ ::Pry::Pathname = ::Pathname
data/lib/fakefs/safe.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'fileutils'
2
2
  require 'pathname'
3
+ require 'fakefs/pry'
3
4
  require 'fakefs/base'
4
5
  require 'fakefs/fake/file'
5
6
  require 'fakefs/fake/dir'
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '1.9.0'.freeze
4
+ VERSION = '2.1.0'.freeze
5
5
 
6
6
  def self.to_s
7
7
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fakefs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-11-14 00:00:00.000000000 Z
15
+ date: 2023-02-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bump
@@ -42,6 +42,20 @@ dependencies:
42
42
  - - "~>"
43
43
  - !ruby/object:Gem::Version
44
44
  version: '3.6'
45
+ - !ruby/object:Gem::Dependency
46
+ name: pry
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
45
59
  - !ruby/object:Gem::Dependency
46
60
  name: rake
47
61
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +122,7 @@ files:
108
122
  - lib/fakefs/io.rb
109
123
  - lib/fakefs/kernel.rb
110
124
  - lib/fakefs/pathname.rb
125
+ - lib/fakefs/pry.rb
111
126
  - lib/fakefs/safe.rb
112
127
  - lib/fakefs/spec_helpers.rb
113
128
  - lib/fakefs/version.rb