memtar 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 5689f9f87168486016e02f4a4c11e5682c164f9e58346fd581ebd6a82f8c7886
4
- data.tar.gz: 62da4c3a3d5ec99db17083527da830edb23b8852f42b4fe6beb6387d358bd6b2
3
+ metadata.gz: 4f247845fb1acb3820a3abde0269f6440a25e5fcc43bc346f8593fde1e12c89a
4
+ data.tar.gz: a7396eb764c21e7fef6c906781a8ebba1622dcd71e8b81cac26873711876eaeb
5
5
  SHA512:
6
- metadata.gz: ead83830c71da2d58d0bf6d0fb6e08d87b532240a572ed370b47a9510a5fd796ea5b0fe123ddba0881624eb33da2ca9c20f8f3ddea3e309401798ba3a4c05b6f
7
- data.tar.gz: 4507864b30b167d78d0c952cd799630216d29761f60d86422a3c31fd4f08bb5aab2b1579706aa2d2231eed77e8d03961acc704642dbd964d6c7291c32a5e7091
6
+ metadata.gz: 45afbe0bfbcf55c034f07cf830e32cb129d0dc16ddaeda520053425e20a4428697ceed8bc89a45a3a6346e9e5ec4073048dc5c43b2936d1f1958ff17ef17a2fa
7
+ data.tar.gz: 8710466bb6e5d65cb3393c57e4f1142e827a2f9ede439d597927d846289aa1ad2395780c936a38bea350365e9599b469bb06244c6d5c37351bf15a10bde565c3
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class MemTar
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
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.size
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.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-08-27 00:00:00.000000000 Z
11
+ date: 2019-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitar