fileutils 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fileutils.rb +8 -20
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d0b2f65c334a82e03ac42af7cf6cd06b483623b480437857141a9df9c015009
4
- data.tar.gz: 606518f69d4c6f97f7d7825e324d515862a81bd43217c405a28c569513cc68b6
3
+ metadata.gz: 980a10fd660b4bafad57c5ec1be444a300d78839050a9a2d8dfeebfa33fa1cf5
4
+ data.tar.gz: b524b5c2d8a96a7c02c02f6c84340f5144b1517e0c7ffca78224ac30a31a85a6
5
5
  SHA512:
6
- metadata.gz: f7c816abe3abd75038c84707436dd76b5b084f6db609996d2d080d5f647ebfa8e336b1571cae1e8e5988551da64c3901d0c2e8799873faccaef4a5902454d382
7
- data.tar.gz: 1035e6b4ed595b421d8771c783676ddee374db565da0e49922f782de9699dc66033d8a16617c1180186019263ff59fe4ad59cb22c9fc6cfd46117348c5236088
6
+ metadata.gz: 3805fd6e1e136e59bf8c1292f8e84563d74ae2de82492d67ddef690ae6d1fa4579cc124ba30d0d680e004514936c565469b0135b27d1b2393d7357abd4b65040
7
+ data.tar.gz: 7ad61f019b6c05de4cd9faec5acb780de9e3350b6db47e5492ed6d2508cd9a1ab36e323e46ec5db57135e4d9558c1a72b159cb2bb97d980459c93316f9c7dda3
data/lib/fileutils.rb CHANGED
@@ -180,7 +180,7 @@ end
180
180
  # - {CVE-2004-0452}[https://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0452].
181
181
  #
182
182
  module FileUtils
183
- VERSION = "1.7.0"
183
+ VERSION = "1.7.1"
184
184
 
185
185
  def self.private_module_function(name) #:nodoc:
186
186
  module_function name
@@ -192,8 +192,6 @@ module FileUtils
192
192
  #
193
193
  # FileUtils.pwd # => "/rdoc/fileutils"
194
194
  #
195
- # FileUtils.getwd is an alias for FileUtils.pwd.
196
- #
197
195
  # Related: FileUtils.cd.
198
196
  #
199
197
  def pwd
@@ -235,8 +233,6 @@ module FileUtils
235
233
  # cd ..
236
234
  # cd fileutils
237
235
  #
238
- # FileUtils.chdir is an alias for FileUtils.cd.
239
- #
240
236
  # Related: FileUtils.pwd.
241
237
  #
242
238
  def cd(dir, verbose: nil, &block) # :yield: dir
@@ -515,8 +511,6 @@ module FileUtils
515
511
  # Raises an exception if +dest+ is the path to an existing file
516
512
  # and keyword argument +force+ is not +true+.
517
513
  #
518
- # FileUtils#link is an alias for FileUtils#ln.
519
- #
520
514
  # Related: FileUtils.link_entry (has different options).
521
515
  #
522
516
  def ln(src, dest, force: nil, noop: nil, verbose: nil)
@@ -707,8 +701,6 @@ module FileUtils
707
701
  # ln -sf src2.txt dest2.txt
708
702
  # ln -s srcdir3/src0.txt srcdir3/src1.txt destdir3
709
703
  #
710
- # FileUtils.symlink is an alias for FileUtils.ln_s.
711
- #
712
704
  # Related: FileUtils.ln_sf.
713
705
  #
714
706
  def ln_s(src, dest, force: nil, relative: false, target_directory: true, noop: nil, verbose: nil)
@@ -876,8 +868,6 @@ module FileUtils
876
868
  #
877
869
  # Raises an exception if +src+ is a directory.
878
870
  #
879
- # FileUtils.copy is an alias for FileUtils.cp.
880
- #
881
871
  # Related: {methods for copying}[rdoc-ref:FileUtils@Copying].
882
872
  #
883
873
  def cp(src, dest, preserve: nil, noop: nil, verbose: nil)
@@ -1164,8 +1154,6 @@ module FileUtils
1164
1154
  # mv src0 dest0
1165
1155
  # mv src1.txt src1 dest1
1166
1156
  #
1167
- # FileUtils.move is an alias for FileUtils.mv.
1168
- #
1169
1157
  def mv(src, dest, force: nil, noop: nil, verbose: nil, secure: nil)
1170
1158
  fu_output_message "mv#{force ? ' -f' : ''} #{[src,dest].flatten.join ' '}" if verbose
1171
1159
  return if noop
@@ -1223,8 +1211,6 @@ module FileUtils
1223
1211
  #
1224
1212
  # rm src0.dat src0.txt
1225
1213
  #
1226
- # FileUtils.remove is an alias for FileUtils.rm.
1227
- #
1228
1214
  # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1229
1215
  #
1230
1216
  def rm(list, force: nil, noop: nil, verbose: nil)
@@ -1250,8 +1236,6 @@ module FileUtils
1250
1236
  #
1251
1237
  # See FileUtils.rm for keyword arguments.
1252
1238
  #
1253
- # FileUtils.safe_unlink is an alias for FileUtils.rm_f.
1254
- #
1255
1239
  # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1256
1240
  #
1257
1241
  def rm_f(list, noop: nil, verbose: nil)
@@ -1339,8 +1323,6 @@ module FileUtils
1339
1323
  #
1340
1324
  # See FileUtils.rm_r for keyword arguments.
1341
1325
  #
1342
- # FileUtils.rmtree is an alias for FileUtils.rm_rf.
1343
- #
1344
1326
  # Related: {methods for deleting}[rdoc-ref:FileUtils@Deleting].
1345
1327
  #
1346
1328
  def rm_rf(list, noop: nil, verbose: nil, secure: nil)
@@ -1642,7 +1624,13 @@ module FileUtils
1642
1624
  st = File.stat(s)
1643
1625
  unless File.exist?(d) and compare_file(s, d)
1644
1626
  remove_file d, true
1645
- copy_file s, d
1627
+ if d.end_with?('/')
1628
+ mkdir_p d
1629
+ copy_file s, d + File.basename(s)
1630
+ else
1631
+ mkdir_p File.expand_path('..', d)
1632
+ copy_file s, d
1633
+ end
1646
1634
  File.utime st.atime, st.mtime, d if preserve
1647
1635
  File.chmod fu_mode(mode, st), d if mode
1648
1636
  File.chown uid, gid, d if uid or gid
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.7.0
4
+ version: 1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Minero Aoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2023-04-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Several file utility methods for copying, moving, removing, etc.
14
14
  email:
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.4.0.dev
46
+ rubygems_version: 3.5.0.dev
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Several file utility methods for copying, moving, removing, etc.