fakefs 2.7.1 → 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: 4c651948e15e48a7fc0a55e795e637b8a7f416b3346d6b7732f9c9db36750b6b
4
- data.tar.gz: e5b0f2eea98fe2a4d58a34daf9ad8af627186eff773fc42f93790a1ca048d5d5
3
+ metadata.gz: 7293346fcf1164e9e312a2e9dcfc9b5795fc4ba0df452f26fc2c43942f0855a7
4
+ data.tar.gz: cefca13b077629a3ada2ee8b29a047dcd7661f1b3a2d2922d2af6649fc9ef69f
5
5
  SHA512:
6
- metadata.gz: 8c356f48b8cab450871cffbf4dca4ca48bdf7631201c624c5cabf4a8482867cc07258900de12ee49aa0409a9b2b186c99f2654c0a564b5bdcf796347c0e68f1a
7
- data.tar.gz: 8ad9c0fa9d589ef555c6c25514e1f743afe43da096092ae4e8b3c21d5a0291014ef30cc4ed4829724a660a2ebaf033b50097ebcf47f0a35e943649df9b368b8f
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 =
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '2.7.1'.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.1
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