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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5d75d2e6a4b146fe955d5a646b3cbe037bc92a4e
4
- data.tar.gz: 8c6416d9263eee7e225d3335e77e6b332b6e0e41
2
+ SHA256:
3
+ metadata.gz: 98519bb81bdb5e4591221c43ff4bf59f02074eeda49fd92445bc9dc049dbe204
4
+ data.tar.gz: 9b1c971886f1fdff4c50601132de36b8c70c6a0d77112c169201c61715caf4d3
5
5
  SHA512:
6
- metadata.gz: 4619c490475ee20a58af1ecafedd573e82b376715e5dcb75f57337f511f4f54f7eade833d152cc6846d8d92927189d130581ffa4f46d738d0d8e3fd5d0151778
7
- data.tar.gz: 12dd810216098f6e5d1b13bb95362348ff3759e476a730742ab12aa7e9a416fa1d64af227e0db4df4a544aa49d91fa0ef450b92851d35753e1d92474bfbd75fe
6
+ metadata.gz: 83dc7014f76d313d945300ad1f2242ad1dbf100cc9ae977f0c3cea4f736b07f160a2e0bd2b84fd7edc886aa6cf14f753eb94a3dc1cbad0e5f991aa7a545e42e9
7
+ data.tar.gz: 2ed1221eaa8c68271ff151dd43615eb15c006c981d30f6afe6648ae00fafaf7d09fa4664d9dccf3e6a255e762c9c67f8540989c90e8b3bf92c685bde63ee59e3
@@ -1,5 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
+ - 2.4.2
4
5
  - ruby-head
5
- before_install: gem install bundler
6
+ script: rake test
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
- # Fileutils
1
+ # FileUtils
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/fileutils`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Build Status](https://travis-ci.org/ruby/fileutils.svg?branch=master)](https://travis-ci.org/ruby/fileutils)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
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
- TODO: Write usage instructions here
25
+ Just call `FileUtils` methods. For example:
26
26
 
27
- ## Development
27
+ ```ruby
28
+ FileUtils.mkdir("somedir")
29
+ # => ["somedir"]
28
30
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
31
+ FileUtils.cd("/usr/bin")
32
+ FileUtils.pwd
33
+ # => "/usr/bin"
34
+ ```
30
35
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
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 [MIT License](http://opensource.org/licenses/MIT).
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).
@@ -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.7.2'
4
- s.date = '2017-02-06'
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.5.0dev"
11
+ s.required_ruby_version = ">= 2.4.0"
11
12
 
12
13
  s.authors = ["Minero Aoki"]
13
14
  s.email = [nil]
@@ -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
- begin
249
- Dir.rmdir(dir = remove_trailing_slash(dir))
250
- if parents
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.7.2
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-02-06 00:00:00.000000000 Z
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.5.0dev
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.6.12
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.