memtar 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/memtar/version.rb +1 -1
- data/lib/memtar.rb +6 -1
- data/memtar.gemspec +1 -1
- data/spec/memtar_spec.rb +13 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c61b366f627ce005958154acee459c8439f103d3
|
4
|
+
data.tar.gz: 946202aeadc5dd7869abd3f97d6d1e2f287a422b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e5346b1d00c129ac2b165ef7299f3b9ada99bd4c25a9101765dd8a21cd515447b6182259e912f12b20f62076f683598390e04a756384fa5b4af5e10f02745e
|
7
|
+
data.tar.gz: 63dbbb2cbc9b83e1388c077ddd80728dabf0274d256f874af76825b10a9c2d03d0518e14b47bc9c639cf03aa75278770d4facd08565972cddde618363fe5460a
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ File.write "test.tar", archive.to_s
|
|
37
37
|
|
38
38
|
## Contributing
|
39
39
|
|
40
|
-
1. Fork it ( https://github.com/
|
40
|
+
1. Fork it ( https://github.com/conjurinc/memtar/fork )
|
41
41
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
42
42
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
43
43
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/memtar/version.rb
CHANGED
data/lib/memtar.rb
CHANGED
@@ -23,7 +23,12 @@ class MemTar
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def add_existing_file path, file
|
26
|
-
|
26
|
+
stat = file.lstat
|
27
|
+
if stat.symlink?
|
28
|
+
add_symlink path, File.readlink(file.path)
|
29
|
+
else
|
30
|
+
add_file path, file.read, MemTar.opts_of_stat(stat)
|
31
|
+
end
|
27
32
|
end
|
28
33
|
|
29
34
|
def self.opts_of_stat stat
|
data/memtar.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ["Rafał Rzepecki"]
|
10
10
|
spec.email = ["rafal@conjur.net"]
|
11
11
|
spec.summary = %q{In-memory tar archive creation}
|
12
|
-
spec.homepage = "https://github.com/
|
12
|
+
spec.homepage = "https://github.com/conjurinc/memtar"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
data/spec/memtar_spec.rb
CHANGED
@@ -23,6 +23,19 @@ describe MemTar do
|
|
23
23
|
has_file 'xyzzy', content: 'bar', mode: 0750, uname: Etc.getlogin
|
24
24
|
file.unlink
|
25
25
|
end
|
26
|
+
|
27
|
+
it 'handles symlinks as File arguments' do
|
28
|
+
file = Tempfile.new 'foo'
|
29
|
+
path = file.path
|
30
|
+
file.close
|
31
|
+
file.unlink
|
32
|
+
|
33
|
+
FileUtils.ln_s '/etc/passwd', path
|
34
|
+
|
35
|
+
subject.add_file 'xyzzy', File.new(path)
|
36
|
+
has_symlink 'xyzzy'
|
37
|
+
File.unlink path
|
38
|
+
end
|
26
39
|
end
|
27
40
|
|
28
41
|
describe '#add_symlink' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memtar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Rzepecki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitar
|
@@ -84,7 +84,7 @@ files:
|
|
84
84
|
- memtar.gemspec
|
85
85
|
- spec/memtar_spec.rb
|
86
86
|
- spec/spec_helper.rb
|
87
|
-
homepage: https://github.com/
|
87
|
+
homepage: https://github.com/conjurinc/memtar
|
88
88
|
licenses:
|
89
89
|
- MIT
|
90
90
|
metadata: {}
|