mixlib-archive 0.4.18 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mixlib/archive.rb +4 -3
- data/lib/mixlib/archive/tar.rb +2 -1
- data/lib/mixlib/archive/version.rb +1 -1
- metadata +4 -6
- data/README.md +0 -78
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0475c38b4846157e5892b1d01e6a6ba6adfb87d1fbbe048057fbd0bb2d5204c9
|
4
|
+
data.tar.gz: 3ffae0ec5a167e33d8dd8a580890ff3738d94f0cb145e81945b0d86eed927b3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdf1f88d256476a49de22abb1881f552fdfb8cd00e5786cceeb69b27a563644ee9e64108cb2b9b2987c3a7a04e552f26995e1b41e072c39696d00b2084993d0f
|
7
|
+
data.tar.gz: d38aac9e5e41c475707647f50cd5a09cdb2f937b58b7c2ef7448ac539a9005294e192761101039ec7c9505f89f68f1523878221d1725f42258ee4189bcba2fa7
|
data/lib/mixlib/archive.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
require_relative "archive/tar"
|
2
|
+
require_relative "archive/version"
|
3
3
|
require "mixlib/log"
|
4
4
|
require "find"
|
5
5
|
|
@@ -21,7 +21,7 @@ module Mixlib
|
|
21
21
|
archive = File.expand_path(archive)
|
22
22
|
begin
|
23
23
|
# we prefer to use libarchive, which supports a great big pile o' stuff
|
24
|
-
|
24
|
+
require_relative "archive/lib_archive"
|
25
25
|
@archiver = Mixlib::Archive::LibArchive.new(archive)
|
26
26
|
rescue LoadError
|
27
27
|
# but if we can't use that, we'll fall back to ruby's native tar implementation
|
@@ -58,6 +58,7 @@ module Mixlib
|
|
58
58
|
if @empty
|
59
59
|
Dir.foreach(destination) do |entry|
|
60
60
|
next if entry == "." || entry == ".."
|
61
|
+
|
61
62
|
FileUtils.remove_entry_secure(File.join(destination, entry))
|
62
63
|
end
|
63
64
|
end
|
data/lib/mixlib/archive/tar.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require "rubygems/package"
|
2
|
-
require "tempfile"
|
2
|
+
require "tempfile" unless defined?(Tempfile)
|
3
3
|
require "zlib"
|
4
4
|
|
5
5
|
module Mixlib
|
@@ -72,6 +72,7 @@ module Mixlib
|
|
72
72
|
def create(files, gzip: false)
|
73
73
|
tgt_dir = File.dirname(archive)
|
74
74
|
target = Tempfile.new(File.basename(archive), tgt_dir)
|
75
|
+
target.binmode
|
75
76
|
|
76
77
|
Gem::Package::TarWriter.new(target) do |tar|
|
77
78
|
files.each do |fn|
|
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: 0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chef Software, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mixlib-log
|
@@ -32,7 +32,6 @@ extensions: []
|
|
32
32
|
extra_rdoc_files: []
|
33
33
|
files:
|
34
34
|
- LICENSE
|
35
|
-
- README.md
|
36
35
|
- lib/mixlib/archive.rb
|
37
36
|
- lib/mixlib/archive/lib_archive.rb
|
38
37
|
- lib/mixlib/archive/tar.rb
|
@@ -49,15 +48,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
49
48
|
requirements:
|
50
49
|
- - ">="
|
51
50
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
51
|
+
version: '2.4'
|
53
52
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
53
|
requirements:
|
55
54
|
- - ">="
|
56
55
|
- !ruby/object:Gem::Version
|
57
56
|
version: '0'
|
58
57
|
requirements: []
|
59
|
-
|
60
|
-
rubygems_version: 2.7.6
|
58
|
+
rubygems_version: 3.0.3
|
61
59
|
signing_key:
|
62
60
|
specification_version: 4
|
63
61
|
summary: A simple interface to various archive formats
|
data/README.md
DELETED
@@ -1,78 +0,0 @@
|
|
1
|
-
# Mixlib::Archive
|
2
|
-
|
3
|
-
[![Build Status Master](https://travis-ci.org/chef/mixlib-archive.svg?branch=master)](https://travis-ci.org/chef/mixlib-archive) [![Gem Version](https://badge.fury.io/rb/mixlib-archive.svg)](https://badge.fury.io/rb/mixlib-archive)
|
4
|
-
|
5
|
-
A very simple gem to extract archives.
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'mixlib-archive'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
```shell
|
18
|
-
$ bundle
|
19
|
-
```
|
20
|
-
|
21
|
-
Or install it yourself as:
|
22
|
-
|
23
|
-
```shell
|
24
|
-
$ gem install mixlib-archive
|
25
|
-
```
|
26
|
-
|
27
|
-
## Usage
|
28
|
-
|
29
|
-
To extract an archive
|
30
|
-
|
31
|
-
```ruby
|
32
|
-
require "mixlib/archive"
|
33
|
-
tar = Mixlib::Archive.new("/path/to/tar")
|
34
|
-
tar.extract("/destination/directory")
|
35
|
-
```
|
36
|
-
|
37
|
-
To create an archive
|
38
|
-
|
39
|
-
```ruby
|
40
|
-
require "mixlib/archive"
|
41
|
-
tar = Mixlib::Archive.new("/path/to/foo.tar.gz")
|
42
|
-
tar.create(%w{ file.rb file2.rb }, gzip: true)
|
43
|
-
```
|
44
|
-
|
45
|
-
## Development
|
46
|
-
|
47
|
-
After checking out the repo, run `bundle` to install dependencies. Then, run `bundle exec rake spec` to run the tests. You can also run `bundle console` for an interactive prompt that will allow you to experiment.
|
48
|
-
|
49
|
-
## Documentation
|
50
|
-
|
51
|
-
All documentation is written using YARD. You can generate a by running:
|
52
|
-
|
53
|
-
```
|
54
|
-
rake docs
|
55
|
-
```
|
56
|
-
|
57
|
-
## Contributing
|
58
|
-
|
59
|
-
For information on contributing to this project please see our [Contributing Documentation](https://github.com/chef/chef/blob/master/CONTRIBUTING.md)
|
60
|
-
|
61
|
-
## License & Copyright
|
62
|
-
|
63
|
-
- Copyright:: Copyright (c) 2017-2018 Chef Software, Inc.
|
64
|
-
- License:: Apache License, Version 2.0
|
65
|
-
|
66
|
-
```text
|
67
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
68
|
-
you may not use this file except in compliance with the License.
|
69
|
-
You may obtain a copy of the License at
|
70
|
-
|
71
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
72
|
-
|
73
|
-
Unless required by applicable law or agreed to in writing, software
|
74
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
75
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
76
|
-
See the License for the specific language governing permissions and
|
77
|
-
limitations under the License.
|
78
|
-
```
|