yamlt 0.0.21 → 0.0.22

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
  SHA1:
3
- metadata.gz: 80b1a8a4484b80539684a66a0c09c0f46d12731e
4
- data.tar.gz: bad6594317352b11801ad99694454f004e5bc212
3
+ metadata.gz: e351eac9fc953cf8f7870be883546ba582698ca5
4
+ data.tar.gz: 6730d1ce41ca169fd6ef5f48818feaaf9955e625
5
5
  SHA512:
6
- metadata.gz: 2ff366500f44680fc0b90501ff6c73be2ada22a4d0f650924c1a5769bde1505b76c9bdb4c8b2c05889e9a1ac95e585e8b8857ccc6cb23b08bf81485ac7863567
7
- data.tar.gz: b17c13f087c2dad87c708b9a5b1b609415f3121d07cd74643940a76cafb8b8ed8726dcec843ce4b65f8df09c6205140a6789e3ece934e2b47728c37602644383
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
- value.split($/).map do |value_part|
65
+ value.split($/).map do |value_part|
61
66
  if /^\s*$/ === value_part
62
67
  ""
63
68
  else
@@ -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.21
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: 2014-12-22 00:00:00.000000000 Z
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: