fileutils 1.7.0 → 1.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -7
  3. data/lib/fileutils.rb +9 -21
  4. 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: b1fc5cc4e9c43e86752aa8b1817f71e48bcfa3a3c9399146b3d6ae396653e13b
4
+ data.tar.gz: 2711f1c7b5370a616e62f9804d3c451df178b70e7542b4f594dc3534bd8f57d3
5
5
  SHA512:
6
- metadata.gz: f7c816abe3abd75038c84707436dd76b5b084f6db609996d2d080d5f647ebfa8e336b1571cae1e8e5988551da64c3901d0c2e8799873faccaef4a5902454d382
7
- data.tar.gz: 1035e6b4ed595b421d8771c783676ddee374db565da0e49922f782de9699dc66033d8a16617c1180186019263ff59fe4ad59cb22c9fc6cfd46117348c5236088
6
+ metadata.gz: a5e8e17e48ba7d200a36fe1cb66a1b1da7024a16ffb5c9ff7fafa9199a22ff93d3d13964453ac4e3533ac89598fdbd4ce53422dcf1e2037789d5cb0a39e51c7b
7
+ data.tar.gz: c6857a62beafa5d557e48cdc29d4815183c2a13a7a267ff4a53f5858c273a813761321788d904245dcb0579fa4a43db002b65f447f96d0e97588b1ca99758847
data/Rakefile CHANGED
@@ -7,11 +7,4 @@ Rake::TestTask.new(:test) do |t|
7
7
  t.test_files = FileList["test/**/test_*.rb"]
8
8
  end
9
9
 
10
- task :sync_tool do
11
- require 'fileutils'
12
- FileUtils.cp "../ruby/tool/lib/core_assertions.rb", "./test/lib"
13
- FileUtils.cp "../ruby/tool/lib/envutil.rb", "./test/lib"
14
- FileUtils.cp "../ruby/tool/lib/find_executable.rb", "./test/lib"
15
- end
16
-
17
10
  task :default => :test
data/lib/fileutils.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  begin
4
4
  require 'rbconfig'
5
5
  rescue LoadError
6
- # for make mjit-headers
6
+ # for make rjit-headers
7
7
  end
8
8
 
9
9
  # Namespace for file utility methods for copying, moving, removing, etc.
@@ -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.2"
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.2
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-11-07 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.