fakefs 2.7.0 → 2.8.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: ae15dc7d6aeb86af398a96ad824d7e53fa9ea82d73a207b23e404e8abfa3815f
4
- data.tar.gz: 3f2794b9dd3db6a5596c90d9c556fd3ef2493244daca68f1328490a95dc205d8
3
+ metadata.gz: 7293346fcf1164e9e312a2e9dcfc9b5795fc4ba0df452f26fc2c43942f0855a7
4
+ data.tar.gz: cefca13b077629a3ada2ee8b29a047dcd7661f1b3a2d2922d2af6649fc9ef69f
5
5
  SHA512:
6
- metadata.gz: c8160c6d4d18841aa27ca9886923721897144f2543c133374dc0df81ebea56e79ea93cb1b2409138cd89a46772b4fe8232633ff72e898f286f115961652f5886
7
- data.tar.gz: c77ced5468712332efde9928a22c7ba56070ab4c16598cc6662211f0e95273df39dc019860a234161513bec8d17d54e80997a4b52f5717f374321ce1aa8122ed
6
+ metadata.gz: 258159efa60c4968941ed425eb78175e3c9bd412b235fea93361b0f442c9569de3b51d6d5f00adf5c880854d40ae8553095206666ce2324913624927c3a1f069
7
+ data.tar.gz: 6bf302764a2e765051cdd0709fa722cf6acd30df831d8211c4fdcd83e8a1ad4ad7d0cdb5286b22a8b4dfbc6de8686ca2bb24b5a30ffbf986764e239c2802b220
data/lib/fakefs/dir.rb CHANGED
@@ -127,10 +127,10 @@ module FakeFS
127
127
  end
128
128
  end
129
129
 
130
- def self.glob(pattern, _flags = 0, flags: _flags, base: nil, &block) # rubocop:disable Lint/UnderscorePrefixedVariableName
130
+ def self.glob(pattern, _flags = 0, flags: _flags, base: nil, sort: true, &block) # rubocop:disable Lint/UnderscorePrefixedVariableName
131
131
  pwd = FileSystem.normalize_path(base || Dir.pwd)
132
132
  matches_for_pattern = lambda do |matcher|
133
- [FileSystem.find_with_glob(matcher, flags, true, dir: pwd) || []].flatten.map do |e|
133
+ matched = [FileSystem.find_with_glob(matcher, flags, true, dir: pwd) || []].flatten.map do |e|
134
134
  pwd_regex = %r{\A#{pwd.gsub('+') { '\+' }}/?}
135
135
  if pwd.match(%r{\A/?\z}) ||
136
136
  !e.to_s.match(pwd_regex)
@@ -138,7 +138,9 @@ module FakeFS
138
138
  else
139
139
  e.to_s.match(pwd_regex).post_match
140
140
  end
141
- end.sort
141
+ end
142
+ matched.sort! if sort
143
+ matched
142
144
  end
143
145
 
144
146
  files =
data/lib/fakefs/file.rb CHANGED
@@ -1022,7 +1022,7 @@ module FakeFS
1022
1022
  when 'x'
1023
1023
  raise ArgumentError, "invalid access mode #{mode}" unless access_mode == 'w'
1024
1024
 
1025
- fmode |= File::EXCL
1025
+ fmode |= FMODE_EXCL
1026
1026
  else
1027
1027
  raise ArgumentError, "invalid access mode #{mode}"
1028
1028
  end
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '2.7.0'.freeze
4
+ VERSION = '2.8.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: 2.7.0
4
+ version: 2.8.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: 2024-12-08 00:00:00.000000000 Z
15
+ date: 2024-12-10 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bump