tcl-msgcat 1.0.1 → 1.0.4

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
  SHA1:
3
- metadata.gz: ea2d16b4a4a9127c6a116c074cafbc4496f425db
4
- data.tar.gz: 90ac55780dcf31a2299464fbe26b29f753971879
3
+ metadata.gz: 8ff7447fc76a7ccb6dea7788a0a3aacf27ed2870
4
+ data.tar.gz: a4af1f28cce43b76238c5e5cf100bab394e7da78
5
5
  SHA512:
6
- metadata.gz: 001298e40cc8567322db506cbb5f8f0540ab6ff7f41ac36d8b4b82e5a61c5356ab36650d6f773a8d5bc0aee27ce835584a156045b66927de503ae277cea243f0
7
- data.tar.gz: b9e2554419b0dc8d48db580881cb7535d11efa2842114fdaafd3b93c0f4b189807093fee427a47989655a88d6ed3fb2bfd99709427cca4e7ae80825378cdce73
6
+ metadata.gz: 4842aa60208f3879df71e0eced768922d73c4c56b8251069f103a963fd69302062958ab3b546d21114aaffffad768754d50e6b5b42f13e1cea8575617ba1873b
7
+ data.tar.gz: dfc920dd5da1beb4dadf8a16d424567c55940dadcc4a83ccdf04ebc9e74bc76b6650198b9f3712861a598f40b87e8b9f86ab041ec04dd5674b4cfa6a47f3ab91
data/lib/tcl/msgcat.rb CHANGED
@@ -3,6 +3,11 @@ require "tcl/msgcat/version"
3
3
  require "tcl/msgcat/catalog"
4
4
  require "tcl/msgcat/parser"
5
5
  require "tcl/msgcat/renderer"
6
+ require "tcl/msgcat/paddable_string"
7
+
8
+ class String
9
+ include Tcl::Msgcat::PaddableString
10
+ end
6
11
 
7
12
  module Tcl
8
13
  module Msgcat
@@ -0,0 +1,13 @@
1
+ module Tcl
2
+ module Msgcat
3
+ module PaddableString
4
+
5
+ def rpad(string, count)
6
+ return self if count < 1
7
+ pad = string * count
8
+ pad + self
9
+ end
10
+
11
+ end
12
+ end
13
+ end
@@ -32,6 +32,7 @@ module Tcl
32
32
 
33
33
  # end of the message group/namespace definition
34
34
  if match = line.match(/\}/) # }
35
+ next unless line.strip == "}"
35
36
  scopes.pop
36
37
  next
37
38
  end
@@ -29,6 +29,7 @@ module Tcl
29
29
  def _render(msgs, level=0)
30
30
  msgs.each do |key, value|
31
31
  if value.is_a? Hash
32
+ @lines << ""
32
33
  @lines << "msgs #{key} {".rpad(" ", level)
33
34
  level+=1
34
35
  _render(value, level) # render any child hashes or translation labels/strings
@@ -1,5 +1,5 @@
1
1
  module Tcl
2
2
  module Msgcat
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcl-msgcat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert McLeod
@@ -54,6 +54,7 @@ files:
54
54
  - bin/tcl-msgcat
55
55
  - lib/tcl/msgcat.rb
56
56
  - lib/tcl/msgcat/catalog.rb
57
+ - lib/tcl/msgcat/paddable_string.rb
57
58
  - lib/tcl/msgcat/parser.rb
58
59
  - lib/tcl/msgcat/renderer.rb
59
60
  - lib/tcl/msgcat/version.rb