memtar 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/memtar/version.rb +1 -1
- data/lib/memtar.rb +1 -1
- data/spec/memtar_spec.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f247845fb1acb3820a3abde0269f6440a25e5fcc43bc346f8593fde1e12c89a
|
4
|
+
data.tar.gz: a7396eb764c21e7fef6c906781a8ebba1622dcd71e8b81cac26873711876eaeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45afbe0bfbcf55c034f07cf830e32cb129d0dc16ddaeda520053425e20a4428697ceed8bc89a45a3a6346e9e5ec4073048dc5c43b2936d1f1958ff17ef17a2fa
|
7
|
+
data.tar.gz: 8710466bb6e5d65cb3393c57e4f1142e827a2f9ede439d597927d846289aa1ad2395780c936a38bea350365e9599b469bb06244c6d5c37351bf15a10bde565c3
|
data/lib/memtar/version.rb
CHANGED
data/lib/memtar.rb
CHANGED
@@ -13,7 +13,7 @@ class MemTar
|
|
13
13
|
return add_existing_file path, content if content.is_a?(File) && opts.empty?
|
14
14
|
fail ArgumentError, "handling of paths over 100 bytes long not implemented" if path.size > 100
|
15
15
|
|
16
|
-
size = content.
|
16
|
+
size = content.bytesize
|
17
17
|
@io.write header opts.merge size: size, name: path
|
18
18
|
@io.write content
|
19
19
|
@io.write "\0" * (512 - size % 512)
|
data/spec/memtar_spec.rb
CHANGED
@@ -13,6 +13,11 @@ describe MemTar do
|
|
13
13
|
has_file 'some-file', content: 'foo', mode: 0600, uname: 'nobody'
|
14
14
|
end
|
15
15
|
|
16
|
+
it 'correctly stores UTF-8 encoded strings' do
|
17
|
+
subject.add_file 'utftest', 'na starość żółw wydziela wstrętną woń'
|
18
|
+
has_file 'utftest', content: 'na starość żółw wydziela wstrętną woń'.b
|
19
|
+
end
|
20
|
+
|
16
21
|
it 'handles File arguments' do
|
17
22
|
file = Tempfile.new 'foo'
|
18
23
|
file.chmod 0750
|
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.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Rzepecki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitar
|