bisu 1.5.0 → 1.6.0
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/bisu.rb +9 -1
- data/lib/bisu/localizer.rb +2 -2
- data/lib/bisu/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ffcf701edd984c84baed76e830e65220823f1d
|
4
|
+
data.tar.gz: 6dbe37c9b9843a5ba581ffafe6fc1462e12e8296
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ce5fd404b32dade76d949895228f6f4d42936c74bfd94f3a728af616348bb8bb372cba87c25a225b1b49a25c2d93f1829375e90072def75337b3897b4e91ec2
|
7
|
+
data.tar.gz: 1dae210c8331482902d0f680198ef5a0f0d84e5ec2e7f108c396a16567a1dfca8176e39814472c0e0e23fa8621cd5912d30f8f60085569e97b920d02b68b3923
|
data/lib/bisu.rb
CHANGED
@@ -32,7 +32,11 @@ module Bisu
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
|
35
|
+
Logger.print_summary
|
36
|
+
|
37
|
+
if options[:strict] && Logger.summary[:warn] > 0
|
38
|
+
Logger.error("Found a warning while in strict mode")
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
private
|
@@ -92,6 +96,10 @@ module Bisu
|
|
92
96
|
opts_hash[:dictionary_save_path] = path
|
93
97
|
end
|
94
98
|
|
99
|
+
opts.on("-s", "--strict", "Fail in the presence of any warning") do
|
100
|
+
opts_hash[:strict] = true
|
101
|
+
end
|
102
|
+
|
95
103
|
opts.on_tail("-h", "--help", "Show this message") do
|
96
104
|
puts opts
|
97
105
|
exit
|
data/lib/bisu/localizer.rb
CHANGED
@@ -30,7 +30,7 @@ module Bisu
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
t.scan(/\$(
|
33
|
+
t.scan(/\$([^\$\{]+)(?:\{(.+)\})?\$/) { |match| Logger.warn("Could not find translation for #{match[0]} in #{language}") }
|
34
34
|
unless @type.eql?(:ror)
|
35
35
|
t.scan(/%{[^}]+}/) { |match| Logger.error("Could not find translation param for #{match} in #{language}") }
|
36
36
|
end
|
@@ -41,7 +41,7 @@ module Bisu
|
|
41
41
|
private
|
42
42
|
|
43
43
|
def to_localize(text)
|
44
|
-
all_matches = text.to_enum(:scan, /\$(
|
44
|
+
all_matches = text.to_enum(:scan, /\$([^\$\{]+)(?:\{(.+)\})?\$/).map { Regexp.last_match }
|
45
45
|
all_matches.map do |match|
|
46
46
|
params = if match[2]
|
47
47
|
params = match[2].split(",").map(&:strip).map do |param|
|
data/lib/bisu/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bisu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joaoffcosta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|