fileutils 0.7.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +2 -1
- data/README.md +13 -10
- data/fileutils.gemspec +4 -3
- data/lib/fileutils.rb +5 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 98519bb81bdb5e4591221c43ff4bf59f02074eeda49fd92445bc9dc049dbe204
|
4
|
+
data.tar.gz: 9b1c971886f1fdff4c50601132de36b8c70c6a0d77112c169201c61715caf4d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83dc7014f76d313d945300ad1f2242ad1dbf100cc9ae977f0c3cea4f736b07f160a2e0bd2b84fd7edc886aa6cf14f753eb94a3dc1cbad0e5f991aa7a545e42e9
|
7
|
+
data.tar.gz: 2ed1221eaa8c68271ff151dd43615eb15c006c981d30f6afe6648ae00fafaf7d09fa4664d9dccf3e6a255e762c9c67f8540989c90e8b3bf92c685bde63ee59e3
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# FileUtils
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/ruby/fileutils.svg?branch=master)](https://travis-ci.org/ruby/fileutils)
|
4
4
|
|
5
|
-
|
5
|
+
Namespace for several file utility methods for copying, moving, removing, etc.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -22,20 +22,23 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Just call `FileUtils` methods. For example:
|
26
26
|
|
27
|
-
|
27
|
+
```ruby
|
28
|
+
FileUtils.mkdir("somedir")
|
29
|
+
# => ["somedir"]
|
28
30
|
|
29
|
-
|
31
|
+
FileUtils.cd("/usr/bin")
|
32
|
+
FileUtils.pwd
|
33
|
+
# => "/usr/bin"
|
34
|
+
```
|
30
35
|
|
31
|
-
|
36
|
+
You can find a full method list in the [documentation](https://ruby-doc.org/stdlib/libdoc/fileutils/rdoc/FileUtils.html).
|
32
37
|
|
33
38
|
## Contributing
|
34
39
|
|
35
40
|
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/fileutils.
|
36
41
|
|
37
|
-
|
38
42
|
## License
|
39
43
|
|
40
|
-
The gem is available as open source under the terms of the [
|
41
|
-
|
44
|
+
The gem is available as open source under the terms of the [2-Clause BSD License](https://opensource.org/licenses/BSD-2-Clause).
|
data/fileutils.gemspec
CHANGED
@@ -1,13 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
Gem::Specification.new do |s|
|
2
3
|
s.name = "fileutils"
|
3
|
-
s.version = '0.
|
4
|
-
s.date = '2017-
|
4
|
+
s.version = '1.0.0'
|
5
|
+
s.date = '2017-12-12'
|
5
6
|
s.summary = "Several file utility methods for copying, moving, removing, etc."
|
6
7
|
s.description = "Several file utility methods for copying, moving, removing, etc."
|
7
8
|
|
8
9
|
s.require_path = %w{lib}
|
9
10
|
s.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "fileutils.gemspec", "lib/fileutils.rb"]
|
10
|
-
s.required_ruby_version = ">= 2.
|
11
|
+
s.required_ruby_version = ">= 2.4.0"
|
11
12
|
|
12
13
|
s.authors = ["Minero Aoki"]
|
13
14
|
s.email = [nil]
|
data/lib/fileutils.rb
CHANGED
@@ -245,15 +245,15 @@ module FileUtils
|
|
245
245
|
fu_output_message "rmdir #{parents ? '-p ' : ''}#{list.join ' '}" if verbose
|
246
246
|
return if noop
|
247
247
|
list.each do |dir|
|
248
|
-
|
249
|
-
|
250
|
-
|
248
|
+
Dir.rmdir(dir = remove_trailing_slash(dir))
|
249
|
+
if parents
|
250
|
+
begin
|
251
251
|
until (parent = File.dirname(dir)) == '.' or parent == dir
|
252
252
|
dir = parent
|
253
253
|
Dir.rmdir(dir)
|
254
254
|
end
|
255
|
+
rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
|
255
256
|
end
|
256
|
-
rescue Errno::ENOTEMPTY, Errno::EEXIST, Errno::ENOENT
|
257
257
|
end
|
258
258
|
end
|
259
259
|
end
|
@@ -412,7 +412,7 @@ module FileUtils
|
|
412
412
|
def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false)
|
413
413
|
Entry_.new(src, nil, dereference_root).wrap_traverse(proc do |ent|
|
414
414
|
destent = Entry_.new(dest, ent.rel, false)
|
415
|
-
File.unlink destent.path if remove_destination && File.file?(destent.path)
|
415
|
+
File.unlink destent.path if remove_destination && (File.file?(destent.path) || File.symlink?(destent.path))
|
416
416
|
ent.copy destent.path
|
417
417
|
end, proc do |ent|
|
418
418
|
destent = Entry_.new(dest, ent.rel, false)
|
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: 0.
|
4
|
+
version: 1.0.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: 2017-
|
11
|
+
date: 2017-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -53,7 +53,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
53
53
|
requirements:
|
54
54
|
- - ">="
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 2.
|
56
|
+
version: 2.4.0
|
57
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -61,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
61
61
|
version: '0'
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project:
|
64
|
-
rubygems_version: 2.
|
64
|
+
rubygems_version: 2.7.3
|
65
65
|
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: Several file utility methods for copying, moving, removing, etc.
|