https://github.com/chef/mixlib-archive
A very simple gem to create and extract archives.
https://github.com/chef/mixlib-archive
Last synced: 10 months ago
JSON representation
A very simple gem to create and extract archives.
- Host: GitHub
- URL: https://github.com/chef/mixlib-archive
- Owner: chef
- License: apache-2.0
- Created: 2016-05-06T10:32:23.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2025-09-13T07:01:11.000Z (11 months ago)
- Last Synced: 2025-09-18T22:38:34.956Z (11 months ago)
- Language: Ruby
- Homepage: https://rubygems.org/gems/mixlib-archive
- Size: 1.73 MB
- Stars: 5
- Watchers: 21
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Mixlib::Archive
[](https://badge.fury.io/rb/mixlib-archive)
[](https://buildkite.com/chef-oss/chef-mixlib-archive-master-verify)
A very simple gem to extract archives.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'mixlib-archive'
```
Note: If `ffi-libarchive` is installed this gem will use libarchive. Otherwise it will fall back to tar. Make sure to install `ffi-libarchive` for the best experience.
And then execute:
```shell
$ bundle
```
Or install it yourself as:
```shell
$ gem install mixlib-archive
```
## Usage
To extract an archive
```ruby
require "mixlib/archive"
tar = Mixlib::Archive.new("/path/to/tar")
tar.extract("/destination/directory")
```
To create an archive
```ruby
require "mixlib/archive"
tar = Mixlib::Archive.new("/path/to/foo.tar.gz")
tar.create(%w{ file.rb file2.rb }, gzip: true)
```
## Development
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.
## Documentation
All documentation is written using YARD. You can generate a by running:
```
rake docs
```
## Contributing
For information on contributing to this project please see our [Contributing Documentation](https://github.com/chef/chef/blob/master/CONTRIBUTING.md)
## License & Copyright
- Copyright:: Copyright (c) 2017-2021 Chef Software, Inc.
- License:: Apache License, Version 2.0
```text
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```