Skip to content

conjurinc/memtar

Folders and files

NameName
Last commit message
Last commit date
Mar 4, 2020
Nov 20, 2019
Nov 21, 2019
Aug 27, 2019
Aug 27, 2019
May 16, 2022
Mar 16, 2020
Feb 19, 2015
Jan 8, 2024
Jan 8, 2024
Jan 3, 2020
Mar 16, 2020
Jan 8, 2024
Jan 8, 2024
Jan 8, 2024
Jan 8, 2024

Repository files navigation

MemTar

In-memory tar archive creation

Installation

Add this line to your application's Gemfile:

gem 'memtar'

And then execute:

$ bundle

Or install it yourself as:

$ gem install memtar

Usage

require 'memtar'

archive = MemTar.new
archive.default[:uname] = "nobody"

archive.add_file "foo", "content", mode: 0640
archive.add_file "bar/baz", "hi!"
archive.add_symlink "bar/xyzzy", "baz"
archive.add_file "this", File.new("/etc/passwd") # copies attributes and content

File.write "test.tar", archive.to_s

Contributing

We welcome contributions of all kinds to this repository. For instructions on how to get started and descriptions of our development workflows, please see our contributing guide.