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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d92f29c592d9d2ec4112e69e04f205a893dbc36b
4
- data.tar.gz: f61512b2bf45450088ae1f58454319c32811bb4c
3
+ metadata.gz: c61b366f627ce005958154acee459c8439f103d3
4
+ data.tar.gz: 946202aeadc5dd7869abd3f97d6d1e2f287a422b
5
5
  SHA512:
6
- metadata.gz: 4b0fbe8d37f910acb0727c2eb86dffd62daad06f52d9c4085af4914e10d0e0749b2eab32c5fa4f90d7b3643d0fa3538acfd256a8a76b5a7e08b34f30d29e14dc
7
- data.tar.gz: 2a6fe9b0a17d1e2dbaf9a5bdc708a9f0cb8ad5a7cc3384d78c092d62c8c58a726ec9c3b58736376f828c1ef5b2b65df648b9f208c1eeb0e54dc5521e73edc9b0
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/[my-github-username]/memtar/fork )
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`)
@@ -1,4 +1,4 @@
1
1
  #
2
2
  class MemTar
3
- VERSION = "0.0.1"
3
+ VERSION = "0.1.0"
4
4
  end
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
- add_file path, file.read, MemTar.opts_of_stat(file.stat)
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/dividedmind/memtar"
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.1
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-19 00:00:00.000000000 Z
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/dividedmind/memtar
87
+ homepage: https://github.com/conjurinc/memtar
88
88
  licenses:
89
89
  - MIT
90
90
  metadata: {}