yamlt 0.0.21 → 0.0.22
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/lib/yamlt/parser/line/serializer.rb +6 -1
- data/lib/yamlt/parser/line.rb +4 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e351eac9fc953cf8f7870be883546ba582698ca5
|
4
|
+
data.tar.gz: 6730d1ce41ca169fd6ef5f48818feaaf9955e625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7add4cf8ef5cd91680a42832e5030c61a9bfed38f4343bb202de5e9c9b8201262612220f90ef70968890f2b72c447a45363e39778f156e010f02fb4376d3550a
|
7
|
+
data.tar.gz: 59794f2cda341c4f3b5707f8c43fde275cb6802962e148ea032f863a567ca9536ef78ab4cb60c88a1c0b9843b821e7e75ee9ee2e598b44ee7a4a9e93bc079073
|
@@ -13,6 +13,7 @@ module Yamlt
|
|
13
13
|
anchor_string,
|
14
14
|
prefix_string,
|
15
15
|
value_string,
|
16
|
+
comment_prefix,
|
16
17
|
comment
|
17
18
|
].join("")
|
18
19
|
end
|
@@ -43,6 +44,10 @@ module Yamlt
|
|
43
44
|
@overrides[:fragment] || @line.fragment
|
44
45
|
end
|
45
46
|
|
47
|
+
def comment_prefix
|
48
|
+
@line.comment_prefix.to_s
|
49
|
+
end
|
50
|
+
|
46
51
|
def comment
|
47
52
|
if @line.comment
|
48
53
|
"##{@line.comment}"
|
@@ -57,7 +62,7 @@ module Yamlt
|
|
57
62
|
if @line.fragment && value
|
58
63
|
if value.include?($/)
|
59
64
|
"|\n" +
|
60
|
-
|
65
|
+
value.split($/).map do |value_part|
|
61
66
|
if /^\s*$/ === value_part
|
62
67
|
""
|
63
68
|
else
|
data/lib/yamlt/parser/line.rb
CHANGED
@@ -14,6 +14,7 @@ module Yamlt
|
|
14
14
|
end
|
15
15
|
|
16
16
|
attr_reader :comment, :prefix, :fragment, :level, :multiline, :clean, :anchor
|
17
|
+
attr_reader :comment_prefix
|
17
18
|
attr_accessor :full_path, :value
|
18
19
|
|
19
20
|
def as_text(opts={})
|
@@ -44,12 +45,14 @@ module Yamlt
|
|
44
45
|
@prefix = $~[4]
|
45
46
|
@comment = $~[6]
|
46
47
|
end
|
47
|
-
when /^(\s*)(\w+):(\s*)([\'\"])(.*)\4
|
48
|
+
when /^(\s*)(\w+):(\s*)([\'\"])(.*)\4((\s*)#(.*))?$/
|
48
49
|
if $~[1].length % 2 == 0
|
49
50
|
@fragment = $~[2]
|
50
51
|
@level = $~[1].length / 2
|
51
52
|
@prefix = $~[3]
|
52
53
|
@value = unescape($~[5])
|
54
|
+
@comment_prefix = $~[7]
|
55
|
+
@comment = $~[8]
|
53
56
|
end
|
54
57
|
when /^(\s*)(\w+):(\s*)\|(\s*)$/
|
55
58
|
if $~[1].length % 2 == 0
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yamlt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tangerine Cat
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -69,3 +69,4 @@ signing_key:
|
|
69
69
|
specification_version: 4
|
70
70
|
summary: Take yaml structure from locale file and apply to another one
|
71
71
|
test_files: []
|
72
|
+
has_rdoc:
|