fileutils 1.3.0 → 1.4.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: 34d7f0ea2d7241dc23eba2ec5d7be548d2dab3edb9082e94fc7766b70ce8dcd2
4
- data.tar.gz: c0a41797554a3a763ff7d7ac7b6f1f149d50bcefe0ddef959b98a1384f40ba93
3
+ metadata.gz: 5a996246ac1d77406d404ad05edf85ad12709c5228c721e8410a723542740e4c
4
+ data.tar.gz: 14ddbc3ce2d2bb2504e096c3a9826d9c5d6b3a116405b40dac6c1bd7e9870b3f
5
5
  SHA512:
6
- metadata.gz: 78deb94048b06e1c7d3215f3bc796447caf909c047f14f137a367e907b4f4fb5655c5ceb211390d5ead7f9e8710b6daf33d262ff31a5b3f186bb2d40f2f4900f
7
- data.tar.gz: f57997f8e332a07d3ab01db4e31ae2e196179a1fb35e6ebf1d123f156e96c5ab415f8f408690767216194a65d92b2d7f77adce83719ffe40d8eeada4cfbb8c4b
6
+ metadata.gz: d56948714f7d9fc5c8e98973bdd41489db7b4d107ee6060214e89a972062a23b8665cf8b0cbeb2ebcaf04140234111a4cc0ca672acdc766615868fcee3e64a20
7
+ data.tar.gz: ac2e352e239eb2fca476b0d5bd7704ca29d2cc49dd46690f1222c5df255129a5860428cf7352d4dd64915c686973497886314bde305a655e1de5cb9dd25d4dbc
data/Rakefile CHANGED
@@ -4,9 +4,9 @@ require "rake/testtask"
4
4
  JRuby.objectspace = true if RUBY_PLATFORM == 'java'
5
5
 
6
6
  Rake::TestTask.new(:test) do |t|
7
- t.libs << "test" << "test/lib"
8
- t.libs << "lib"
9
- t.test_files = FileList['test/**/test_*.rb']
7
+ t.libs << "test/lib"
8
+ t.ruby_opts << "-rhelper"
9
+ t.test_files = FileList["test/**/test_*.rb"]
10
10
  end
11
11
 
12
12
  task :default => :test
@@ -1,20 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- begin
4
- require_relative "lib/fileutils/version"
5
- rescue LoadError
6
- # for Ruby core repository
7
- require_relative "version"
3
+ source_version = ["", "lib/"].find do |dir|
4
+ begin
5
+ break File.open(File.join(__dir__, "#{dir}fileutils.rb")) {|f|
6
+ f.gets("\n VERSION = ")
7
+ f.gets[/\s*"(.+)"/, 1]
8
+ }
9
+ rescue Errno::ENOENT
10
+ end
8
11
  end
9
12
 
10
13
  Gem::Specification.new do |s|
11
14
  s.name = "fileutils"
12
- s.version = FileUtils::VERSION
15
+ s.version = source_version
13
16
  s.summary = "Several file utility methods for copying, moving, removing, etc."
14
17
  s.description = "Several file utility methods for copying, moving, removing, etc."
15
18
 
16
19
  s.require_path = %w{lib}
17
- s.files = ["LICENSE.txt", "README.md", "Rakefile", "fileutils.gemspec", "lib/fileutils.rb", "lib/fileutils/version.rb"]
20
+ s.files = ["LICENSE.txt", "README.md", "Rakefile", "fileutils.gemspec", "lib/fileutils.rb"]
18
21
  s.required_ruby_version = ">= 2.3.0"
19
22
 
20
23
  s.authors = ["Minero Aoki"]
@@ -22,9 +25,7 @@ Gem::Specification.new do |s|
22
25
  s.homepage = "https://github.com/ruby/fileutils"
23
26
  s.license = "BSD-2-Clause"
24
27
 
25
- if s.respond_to?(:metadata=)
26
- s.metadata = {
27
- "source_code_uri" => "https://github.com/ruby/fileutils"
28
- }
29
- end
28
+ s.metadata = {
29
+ "source_code_uri" => "https://github.com/ruby/fileutils"
30
+ }
30
31
  end
@@ -6,8 +6,6 @@ rescue LoadError
6
6
  # for make mjit-headers
7
7
  end
8
8
 
9
- require_relative "fileutils/version"
10
-
11
9
  #
12
10
  # = fileutils.rb
13
11
  #
@@ -104,6 +102,7 @@ require_relative "fileutils/version"
104
102
  # <tt>:verbose</tt> flags to methods in FileUtils.
105
103
  #
106
104
  module FileUtils
105
+ VERSION = "1.4.0"
107
106
 
108
107
  def self.private_module_function(name) #:nodoc:
109
108
  module_function name
@@ -918,11 +917,8 @@ module FileUtils
918
917
  private_module_function :apply_mask
919
918
 
920
919
  def symbolic_modes_to_i(mode_sym, path) #:nodoc:
921
- mode = if File::Stat === path
922
- path.mode
923
- else
924
- File.stat(path).mode
925
- end
920
+ path = File.stat(path) unless File::Stat === path
921
+ mode = path.mode
926
922
  mode_sym.split(/,/).inject(mode & 07777) do |current_mode, clause|
927
923
  target, *actions = clause.split(/([=+-])/)
928
924
  raise ArgumentError, "invalid file mode: #{mode_sym}" if actions.empty?
@@ -939,7 +935,7 @@ module FileUtils
939
935
  when "x"
940
936
  mask | 0111
941
937
  when "X"
942
- if FileTest.directory? path
938
+ if path.directory?
943
939
  mask | 0111
944
940
  else
945
941
  mask
@@ -1300,7 +1296,8 @@ module FileUtils
1300
1296
  .reject {|n| n == '.' or n == '..' }
1301
1297
  end
1302
1298
 
1303
- files.map {|n| Entry_.new(prefix(), join(rel(), n.untaint)) }
1299
+ untaint = RUBY_VERSION < '2.7'
1300
+ files.map {|n| Entry_.new(prefix(), join(rel(), untaint ? n.untaint : n)) }
1304
1301
  end
1305
1302
 
1306
1303
  def stat
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.3.0
4
+ version: 1.4.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: 2019-09-26 00:00:00.000000000 Z
11
+ date: 2019-11-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Several file utility methods for copying, moving, removing, etc.
14
14
  email:
@@ -22,7 +22,6 @@ files:
22
22
  - Rakefile
23
23
  - fileutils.gemspec
24
24
  - lib/fileutils.rb
25
- - lib/fileutils/version.rb
26
25
  homepage: https://github.com/ruby/fileutils
27
26
  licenses:
28
27
  - BSD-2-Clause
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module FileUtils
4
- VERSION = "1.3.0"
5
- end