fakefs 1.8.0 → 2.0.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: 8e8927be6abec55f007c7e506a952e715415bacde44cf649e04c12d33b16ecab
4
- data.tar.gz: a25489d361ce7ab7c5421c8685285507a19750ed87ef770432d5d10240cb5545
3
+ metadata.gz: 623bbb77bf9f14c0b57f7818f1194a32673c110af847fb69a60ed0d62746dcf8
4
+ data.tar.gz: 914093cd24ebab359108211762e77ba9c45d92805e28565d38e38756d2571a4a
5
5
  SHA512:
6
- metadata.gz: 47fa5277d6012a8b89cda9f380949aac619286cd9b025f39b3b298aae3b5586474ae1858095886e9cdcdd93b1e9517bd63c51d0db50c6ffb8bae2a048b5f127d
7
- data.tar.gz: 2f6871703b0c795b555b55e8792ecc926f866bfe95675518f01b0ff27e3cf1a17825f35b8547b9d2213b94a2d1270ed06a62727c7c8220669b9dbd20a927de5b
6
+ metadata.gz: 75910aa96b9a086823a1b3d922e1d67d6d2da0d7d618a15a7e0ff711f0e2648b28255c57a0190d3d8b10d009f2b29d27bac54959959b1fe0e2a8ca2c8b8eed14
7
+ data.tar.gz: 998b4563ccd6e258e50bb32fe1dffbd6673310d0ea18cb871c346073927b537598ebae3b4c39240467cb6622f328deda36acc9b8575de13b218ed329d3656470
data/README.md CHANGED
@@ -155,7 +155,7 @@ FakeFS do
155
155
  FakeFS::FileSystem.clone(config)
156
156
  expect(File.read("#{config}/foo.yml")).to include("original-content-of-foo")
157
157
 
158
- File.write("#{config}/foo.yml"), "NEW")
158
+ File.write("#{config}/foo.yml", "NEW")
159
159
  expect(File.read("#{config}/foo.yml")).to eq "NEW"
160
160
  end
161
161
  ```
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
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '1.8.0'.freeze
4
+ VERSION = '2.0.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.8.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -9,10 +9,10 @@ authors:
9
9
  - Jeff Hodges
10
10
  - Pat Nakajima
11
11
  - Brian Donovan
12
- autorequire:
12
+ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2022-06-25 00:00:00.000000000 Z
15
+ date: 2023-01-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bump
@@ -115,7 +115,7 @@ homepage: https://github.com/fakefs/fakefs
115
115
  licenses:
116
116
  - MIT
117
117
  metadata: {}
118
- post_install_message:
118
+ post_install_message:
119
119
  rdoc_options: []
120
120
  require_paths:
121
121
  - lib
@@ -123,15 +123,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - ">="
125
125
  - !ruby/object:Gem::Version
126
- version: 2.4.0
126
+ version: 2.7.0
127
127
  required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  requirements: []
133
- rubygems_version: 3.1.6
134
- signing_key:
133
+ rubygems_version: 3.4.0.dev
134
+ signing_key:
135
135
  specification_version: 4
136
136
  summary: A fake filesystem. Use it in your tests.
137
137
  test_files: []