traduki-clt 0.1.1 → 0.1.2
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/traduki/config.rb +2 -2
- data/lib/traduki/hash_tool.rb +6 -10
- data/lib/traduki/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8ef5e860f4839102793da54efb6d39dd0476fd3
|
4
|
+
data.tar.gz: 63cfdcbdb3309125a054909cd344cff58be3b26f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29e875062a4d9d09163696a9bee5e222bbceeff035841f72ddda00f68c8bb0931c40a735eec20255464841ad3633662f5b2ba9253752b4bbdddec88d5c66ebe4
|
7
|
+
data.tar.gz: cff04a53e59a5c53c301aef39ad4d70f58f4eb5d6ce785d969dd4d94259c85ec52430ba011b7a2801d2435ca9ca3546e18b2fb88ca1059a8e26372556479cb9c
|
data/lib/traduki/config.rb
CHANGED
@@ -40,8 +40,8 @@ module Traduki
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def create_internal_config
|
43
|
-
File.open(@langdir + '/traduki.json', 'w') { |f| f.write "// Please DON'T edit this file.\n" }
|
44
|
-
File.open(@langdir + '/traduki.json', '
|
43
|
+
# File.open(@langdir + '/traduki.json', 'w') { |f| f.write "// Please DON'T edit this file.\n" }
|
44
|
+
File.open(@langdir + '/traduki.json', 'w') { |f| f.write JSON.dump generate_config }
|
45
45
|
end
|
46
46
|
|
47
47
|
def generate_config
|
data/lib/traduki/hash_tool.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'pp'
|
2
|
+
|
1
3
|
module Traduki
|
2
4
|
class HashTool
|
3
5
|
def self.validate_dotkey(dotkey)
|
@@ -57,18 +59,12 @@ module Traduki
|
|
57
59
|
result = contrast.clone
|
58
60
|
result.each do |key, _|
|
59
61
|
if result[key].is_a?(Hash) && dict[key].is_a?(Hash)
|
60
|
-
clean(dict[key], result[key])
|
61
|
-
|
62
|
-
end
|
63
|
-
if result[key].is_a?(String) && dict[key].is_a?(String)
|
62
|
+
result[key] = clean(dict[key], result[key])
|
63
|
+
elsif result[key].is_a?(String) && dict[key].is_a?(String)
|
64
64
|
result[key] = dict[key]
|
65
|
-
|
66
|
-
|
67
|
-
if result[key].is_a?(String) && dict[key].is_a?(Hash)
|
65
|
+
elsif result[key].is_a?(String) && dict[key].is_a?(Hash)
|
68
66
|
result[key] = dict['_'] unless dict['_'].nil?
|
69
|
-
|
70
|
-
|
71
|
-
if result[key].is_a?(Hash) && dict[key].is_a?(String)
|
67
|
+
elsif result[key].is_a?(Hash) && dict[key].is_a?(String)
|
72
68
|
result[key]['_'] = dict[key]
|
73
69
|
end
|
74
70
|
end
|
data/lib/traduki/version.rb
CHANGED