anvl-converter 0.2 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22a4b5e253e8fa85cdafb97ee6a4221623c24fc96d2d8f521d2ebd0fdcb21968
4
- data.tar.gz: 82b46195ae8f25b11279d81d793e913ca212566330cf4a494c3c7a522c9c817a
3
+ metadata.gz: c26551769c00964196526b98ada691d927ee2d0c6192be03aeec98d17e8c378a
4
+ data.tar.gz: f0f67ed7298bade6b1eb110f92fb00fd97875b4df85e1f67c1c1f7b3d8fa2eef
5
5
  SHA512:
6
- metadata.gz: 1b373884813705be4265fb7017cac11bc48b1c7fc73bcab7ce59d8ab58739e3ddf43ad923ee4192d493a1227423cdb22e71399ddb7eda5bfb494f78db1675efe
7
- data.tar.gz: 799abda97fc24c972a563ee7c0a70c92e3fc60a9b4cc544892923accd91acf88e2dd64d66e2e4d433cb62c28de7b724777402d99fe845c3dc23a7e7548641f18
6
+ metadata.gz: 77353bd1b40500a9da3c5ed7a1e9d200b65facc11931e38af2f949ce8d3c0c37210d9303a398faac046bcf1af79fe4f43b1748b452f0491bd877e07914c31c49
7
+ data.tar.gz: 12b48541b577556f8f975d43416842d931e8cd2038572d02a3b0b8cdf1a901562ec098f13b704dfc617180633cc089eda8d1b9a4146767bdf448a2adf0f01a3e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- anvl-converter (0.2)
4
+ anvl-converter (0.2.1)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
 
7
7
  GEM
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/hash/indifferent_access'
2
+ require 'active_support/core_ext/object/blank'
2
3
 
3
4
  require 'anvl/core_ext/ruby/hash'
4
5
  require 'anvl/core_ext/ruby/string'
@@ -6,7 +6,7 @@ class String
6
6
  elsif line.include?(":")
7
7
  k, v = line.split(":", 2)
8
8
  sum[k.to_s.strip.anvlunesc] = v.to_s.strip.anvlunesc
9
- elsif line.start_with?(" ")
9
+ elsif line.strip.present? && line.start_with?(" ")
10
10
  sum[sum.keys.last] += " " + line.strip
11
11
  end
12
12
 
@@ -1,3 +1,3 @@
1
1
  module Anvl
2
- VERSION = "0.2"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -12,6 +12,11 @@ describe String do
12
12
  expect(str.from_anvl).to eq("name"=>"Josiah\nCarberry")
13
13
  end
14
14
 
15
+ it "escaped newlines and empty line" do
16
+ str = "name: Josiah%0ACarberry%0A "
17
+ expect(str.from_anvl).to eq("name"=>"Josiah\nCarberry\n")
18
+ end
19
+
15
20
  it "ignore comment" do
16
21
  str = "# first draft"
17
22
  expect(str.from_anvl).to eq({})
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anvl-converter
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-31 00:00:00.000000000 Z
11
+ date: 2018-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler