mixlib-archive 1.0.5-universal-mingw32 → 1.1.6-universal-mingw32

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: 9f91a23e2a3a2ecc034a44fa45d1403d03e740dfb68a2228b7ab267a5b9c0073
4
- data.tar.gz: 372042aa8ca2ffa7cc0a751b8ec7abf00b85e0f21b91cbf74d9ca7a85331ad10
3
+ metadata.gz: a1557d95502897d4fd897164b9f7ff68f363051ef4ee3445d8b9ff80fc87e541
4
+ data.tar.gz: 8a924bf81045edc62375bb35c66a36c8647d18e63ead18ac3a11184509f9def6
5
5
  SHA512:
6
- metadata.gz: d8d556c16fb7299428ee11b93ff10d9d332c24bef814606640d724b664a2b7c63385e3b0cc20e0a68242694dec063bbbc5e4b2461fcfabbd9651c42a18c6a754
7
- data.tar.gz: 6d21a36a9c67aac56c6a81d2ff68091cf7fc73562d94b658ffbe01f5773949e7f560e122c9da537e77c24237f1562cc20c11e7a96e0cc987f51d49e28ba4ddf5
6
+ metadata.gz: cdeb320dbcfc91a9f1ebdc5da368642cbf29ca415d6be2da6813c06595731e527ef1d158530d00817f03bdc16c55eaba9e79716da5a1fd696848b3365fb47674
7
+ data.tar.gz: a0c0ddb83b24404a33b129ebd8cb803b5afd1893cdb77f8852b7b1384ce5a5ec8a73ebca598973b8da4eb217ccea8e0d532f3795abdab7638f2a8c8a297102b7
@@ -1,7 +1,7 @@
1
1
  require_relative "archive/tar"
2
2
  require_relative "archive/version"
3
3
  require "mixlib/log"
4
- require "find"
4
+ require "find" unless defined?(Find.find)
5
5
 
6
6
  module Mixlib
7
7
  class Archive
@@ -6,12 +6,6 @@ module Mixlib
6
6
  attr_reader :options
7
7
  attr_reader :archive
8
8
 
9
- class << self
10
- attr_accessor :mutex_chdir
11
- end
12
-
13
- Mixlib::Archive::LibArchive.mutex_chdir = Mutex.new
14
-
15
9
  def initialize(archive, options = {})
16
10
  @archive = archive
17
11
  @options = options
@@ -27,24 +21,17 @@ module Mixlib
27
21
  flags = perms ? ::Archive::EXTRACT_PERM : nil
28
22
  FileUtils.mkdir_p(destination)
29
23
 
30
- # @note Dir.chdir is applied to the process, thus it is not thread-safe
31
- # and must be synchronized.
32
- # TODO: figure out a better alternative to chdir
33
- Mixlib::Archive::LibArchive.mutex_chdir.synchronize do
34
- Dir.chdir(destination) do
35
- reader = ::Archive::Reader.open_filename(@archive)
24
+ reader = ::Archive::Reader.open_filename(@archive)
36
25
 
37
- reader.each_entry do |entry|
38
- if entry.pathname =~ ignore_re
39
- Mixlib::Archive::Log.warn "ignoring entry #{entry.pathname}"
40
- next
41
- end
42
-
43
- reader.extract(entry, flags.to_i)
44
- end
45
- reader.close
26
+ reader.each_entry do |entry|
27
+ if entry.pathname =~ ignore_re
28
+ Mixlib::Archive::Log.warn "ignoring entry #{entry.pathname}"
29
+ next
46
30
  end
31
+
32
+ reader.extract(entry, flags.to_i, destination: destination)
47
33
  end
34
+ reader.close
48
35
  end
49
36
 
50
37
  # Creates an archive with the given set of +files+
@@ -64,7 +51,7 @@ module Mixlib
64
51
  entry.pathname = fn
65
52
  stat = File.lstat(fn)
66
53
  if File.file?(fn)
67
- content = File.read(fn)
54
+ content = File.read(fn, mode: "rb")
68
55
  entry.size = content.bytesize
69
56
  end
70
57
  entry.mode = stat.mode
@@ -1,6 +1,6 @@
1
- require "rubygems/package"
2
- require "tempfile"
3
- require "zlib"
1
+ require "rubygems/package" unless defined?(Gem::Package)
2
+ require "tempfile" unless defined?(Tempfile)
3
+ require "zlib" unless defined?(Zlib)
4
4
 
5
5
  module Mixlib
6
6
  class Archive
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class Archive
3
- VERSION = "1.0.5".freeze
3
+ VERSION = "1.1.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-archive
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.6
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Chef Software, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 00:00:00.000000000 Z
11
+ date: 2021-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-log
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubygems_version: 3.0.3
61
+ rubygems_version: 3.1.4
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: A simple interface to various archive formats