fileutils 1.5.0 → 1.6.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: 67fa33577498dff5705331ce6453a3c11ff34d209343310f647d4cb404158617
4
- data.tar.gz: 4608e153f0c69749fbf7e4d456388c44fdba1a3a99f5b328c71c283ccd7ca5a3
3
+ metadata.gz: bd9bb18e0c2796f76aaa3913228a54edac666e5130c8649a072d2c9f5304f4ce
4
+ data.tar.gz: e61f982bf90db5263eacb09ba03bd8aa0c2bc91c52b54eb0e8de08388955d28d
5
5
  SHA512:
6
- metadata.gz: db0b5ce907f782c5ba306ca0a8811c825ec1f97a47731ccc08b2ddc7e13160d7d40986afd1b744cef7b941b2bef2f1c1c4017eb8fc616e8695b506d5ce8cc8ae
7
- data.tar.gz: ccbb52c0a277e03e29dfff22e5bb26b3dc30e7ede6db803f130047bb039cb12161d7f3ecafac5f0956959fde6276b16c68085f30be7c8edae019e7d313301b53
6
+ metadata.gz: cb8942b3111aec98133788f8088511a90b9eab067a563676ccf348a567504b4ae2b858c0bebb376bdb6bd5847be1e8cd8171a2a8cd654480686c8065846acff6
7
+ data.tar.gz: 11e481aff9fd2b505b5b97b6783c4b93fd9509a6f5cac2af20142fea383c92455e36fc7de8de303fd0c49662e27920cea295bd09f6fc029d6c2be3a465cc5a5a
data/Rakefile CHANGED
@@ -1,8 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/testtask"
3
3
 
4
- JRuby.objectspace = true if RUBY_PLATFORM == 'java'
5
-
6
4
  Rake::TestTask.new(:test) do |t|
7
5
  t.libs << "test/lib"
8
6
  t.ruby_opts << "-rhelper"
@@ -11,7 +9,7 @@ end
11
9
 
12
10
  task :sync_tool do
13
11
  require 'fileutils'
14
- FileUtils.cp "../ruby/tool/lib/test/unit/core_assertions.rb", "./test/lib"
12
+ FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
15
13
  FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
16
14
  FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
17
15
  end
data/fileutils.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
18
18
 
19
19
  s.require_path = %w{lib}
20
20
  s.files = ["LICENSE.txt", "README.md", "Rakefile", "fileutils.gemspec", "lib/fileutils.rb"]
21
- s.required_ruby_version = ">= 2.3.0"
21
+ s.required_ruby_version = ">= 2.5.0"
22
22
 
23
23
  s.authors = ["Minero Aoki"]
24
24
  s.email = [nil]
data/lib/fileutils.rb CHANGED
@@ -102,7 +102,7 @@ end
102
102
  # <tt>:verbose</tt> flags to methods in FileUtils.
103
103
  #
104
104
  module FileUtils
105
- VERSION = "1.5.0"
105
+ VERSION = "1.6.0"
106
106
 
107
107
  def self.private_module_function(name) #:nodoc:
108
108
  module_function name
@@ -211,21 +211,11 @@ module FileUtils
211
211
  list.each do |item|
212
212
  path = remove_trailing_slash(item)
213
213
 
214
- # optimize for the most common case
215
- begin
216
- fu_mkdir path, mode
217
- next
218
- rescue SystemCallError
219
- next if File.directory?(path)
220
- end
221
-
222
214
  stack = []
223
- until path == stack.last # dirname("/")=="/", dirname("C:/")=="C:/"
215
+ until File.directory?(path)
224
216
  stack.push path
225
217
  path = File.dirname(path)
226
- break if File.directory?(path)
227
218
  end
228
- stack.pop if path == stack.last # root directory should exist
229
219
  stack.reverse_each do |dir|
230
220
  begin
231
221
  fu_mkdir dir, mode
@@ -837,13 +827,8 @@ module FileUtils
837
827
  def compare_stream(a, b)
838
828
  bsize = fu_stream_blksize(a, b)
839
829
 
840
- if RUBY_VERSION > "2.4"
841
- sa = String.new(capacity: bsize)
842
- sb = String.new(capacity: bsize)
843
- else
844
- sa = String.new
845
- sb = String.new
846
- end
830
+ sa = String.new(capacity: bsize)
831
+ sb = String.new(capacity: bsize)
847
832
 
848
833
  begin
849
834
  a.read(bsize, sa)
@@ -1292,12 +1277,7 @@ module FileUtils
1292
1277
  opts = {}
1293
1278
  opts[:encoding] = fu_windows? ? ::Encoding::UTF_8 : path.encoding
1294
1279
 
1295
- files = if Dir.respond_to?(:children)
1296
- Dir.children(path, **opts)
1297
- else
1298
- Dir.entries(path(), **opts)
1299
- .reject {|n| n == '.' or n == '..' }
1300
- end
1280
+ files = Dir.children(path, **opts)
1301
1281
 
1302
1282
  untaint = RUBY_VERSION < '2.7'
1303
1283
  files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fileutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-22 00:00:00.000000000 Z
11
+ date: 2021-10-21 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Several file utility methods for copying, moving, removing, etc.
14
14
  email:
@@ -36,14 +36,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 2.3.0
39
+ version: 2.5.0
40
40
  required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - ">="
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.2.2
46
+ rubygems_version: 3.3.0.dev
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Several file utility methods for copying, moving, removing, etc.