bisu 1.5.0 → 1.6.0

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: e11ef1004e3778da14f8a9980b7c179af2675386
4
- data.tar.gz: 1f135d1bd101a886067a802cd3e01476f5023bf4
3
+ metadata.gz: 26ffcf701edd984c84baed76e830e65220823f1d
4
+ data.tar.gz: 6dbe37c9b9843a5ba581ffafe6fc1462e12e8296
5
5
  SHA512:
6
- metadata.gz: 46b10ad409ba99c19189e1ebb41fd6867475287471215c02cd2d8787f3f756bc6120391618c3af51a20fbcc7be0f17f7e1c1fd5040f5772b6cfc5c33ab5da2ed
7
- data.tar.gz: 51e31ad74b7e9e816966c52da0e42dee25e8305548aeea95a91de413573c11c97144a3e38da852893e3b000d89047d5255c27e6023473b28c0d12c677ef58a9b
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
- Bisu::Logger.print_summary
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
@@ -30,7 +30,7 @@ module Bisu
30
30
  end
31
31
  end
32
32
 
33
- t.scan(/\$(k[^\$\{]+)(?:\{(.+)\})?\$/) { |match| Logger.warn("Could not find translation for #{match[0]} in #{language}") }
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, /\$(k[^\$\{]+)(?:\{(.+)\})?\$/).map { Regexp.last_match }
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
@@ -1,4 +1,4 @@
1
1
  module Bisu
2
- VERSION = '1.5.0'
3
- VERSION_UPDATED_AT = '2019-01-19'
2
+ VERSION = '1.6.0'
3
+ VERSION_UPDATED_AT = '2019-02-18'
4
4
  end
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.5.0
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-01-19 00:00:00.000000000 Z
11
+ date: 2019-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: safe_yaml