ad_localize 3.0.0 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ad_localize.gemspec +2 -2
- data/lib/ad_localize/csv_parser.rb +14 -1
- data/lib/ad_localize/platform/platform_formatter.rb +0 -2
- data/lib/ad_localize/runner.rb +2 -2
- data/lib/ad_localize/version.rb +1 -1
- metadata +11 -6
- data/Gemfile.lock +0 -51
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbef79aa4f801f810011f962ea28926e6518fd2e09b5471b83fe9ecf71a72638
|
4
|
+
data.tar.gz: 75f97c8dbf7e7e751f47fde0e3ae9e92eac06bd64d231fd0052acf7d6c19f2ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f49d154c8b682f0e17415703d220f254ecd5e4839b0969b2d75175d1e0617a2ad8dd5b41deab3ad616481c73a77160edf4700ee5baf89c7837a1c47e7ed789d
|
7
|
+
data.tar.gz: d022f56a3cc71552836c4c51c5418e5057aa4ee06e1b19ac5b7974bf8e3ce98311a67f608c11a8bf9aa01e31196075a3a8a22448638c0614814909589ee8883a
|
data/ad_localize.gemspec
CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
|
|
37
37
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
38
38
|
spec.require_paths = ['lib']
|
39
39
|
|
40
|
-
spec.add_development_dependency 'bundler', '
|
40
|
+
spec.add_development_dependency 'bundler', '>= 1.12.0', '< 3.0.0'
|
41
41
|
spec.add_development_dependency 'rake', '~> 12.3'
|
42
42
|
spec.add_development_dependency 'minitest', '~> 5.11'
|
43
43
|
spec.add_development_dependency 'byebug', '~> 11.0'
|
@@ -48,4 +48,4 @@ Gem::Specification.new do |spec|
|
|
48
48
|
spec.add_dependency 'colorize', '~> 0.8'
|
49
49
|
|
50
50
|
spec.required_ruby_version = '~> 2.3'
|
51
|
-
end
|
51
|
+
end
|
@@ -24,10 +24,12 @@ module AdLocalize
|
|
24
24
|
data.deep_merge!(row_data) unless row_data.nil?
|
25
25
|
end
|
26
26
|
end
|
27
|
+
remove_numeral_conflicts!(data)
|
27
28
|
data
|
28
29
|
end
|
29
30
|
|
30
31
|
private
|
32
|
+
|
31
33
|
# Returns 1 if row is ok, 0 if row there are missing information and -1 if row is not a csv row
|
32
34
|
def check_row(row)
|
33
35
|
valid_row = 1
|
@@ -123,5 +125,16 @@ module AdLocalize
|
|
123
125
|
LOGGER.log(:warn, :red, "[#{locale.upcase}] Multiple arguments for #{key} but no order") unless is_all_ordered
|
124
126
|
end
|
125
127
|
end
|
128
|
+
|
129
|
+
def remove_numeral_conflicts!(data)
|
130
|
+
data.select do |_, wording|
|
131
|
+
wording.values.any? { |translation| (translation.keys & [:plural, :singular]).size == 2 }
|
132
|
+
end.keys.each do |key|
|
133
|
+
AdLocalize::LOGGER.log(:warn, :yellow, "Key \"#{key}\" is duplicated in singular and plural." \
|
134
|
+
"The singular wording will be ignored. You should keep one version of the key (singular or plural)"
|
135
|
+
)
|
136
|
+
data[key].values.each { |wording| wording.delete(:singular) }
|
137
|
+
end
|
138
|
+
end
|
126
139
|
end
|
127
|
-
end
|
140
|
+
end
|
data/lib/ad_localize/runner.rb
CHANGED
@@ -30,7 +30,7 @@ module AdLocalize
|
|
30
30
|
parser = CsvParser.new
|
31
31
|
data = parser.extract_data(file)
|
32
32
|
if data.empty?
|
33
|
-
LOGGER.log(:error, :red, "No data were found in the file -
|
33
|
+
LOGGER.log(:error, :red, "No data were found in the file - check if there is a key column in the file")
|
34
34
|
else
|
35
35
|
export_platforms = options.dig(:only) || Constant::SUPPORTED_PLATFORMS
|
36
36
|
export_platforms.each do |platform|
|
@@ -42,4 +42,4 @@ module AdLocalize
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
-
end
|
45
|
+
end
|
data/lib/ad_localize/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ad_localize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edouard Siegel
|
@@ -24,16 +24,22 @@ dependencies:
|
|
24
24
|
name: bundler
|
25
25
|
requirement: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.12.0
|
30
|
+
- - "<"
|
28
31
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
32
|
+
version: 3.0.0
|
30
33
|
type: :development
|
31
34
|
prerelease: false
|
32
35
|
version_requirements: !ruby/object:Gem::Requirement
|
33
36
|
requirements:
|
34
|
-
- - "
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.12.0
|
40
|
+
- - "<"
|
35
41
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
42
|
+
version: 3.0.0
|
37
43
|
- !ruby/object:Gem::Dependency
|
38
44
|
name: rake
|
39
45
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,7 +167,6 @@ files:
|
|
161
167
|
- CHANGELOG.md
|
162
168
|
- CODE_OF_CONDUCT.md
|
163
169
|
- Gemfile
|
164
|
-
- Gemfile.lock
|
165
170
|
- LICENSE.txt
|
166
171
|
- README.md
|
167
172
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
ad_localize (3.0.0)
|
5
|
-
activesupport (~> 4.2, >= 4.2.10)
|
6
|
-
colorize (~> 0.8)
|
7
|
-
nokogiri (~> 1.8, >= 1.8.2)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activesupport (4.2.11)
|
13
|
-
i18n (~> 0.7)
|
14
|
-
minitest (~> 5.1)
|
15
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
16
|
-
tzinfo (~> 1.1)
|
17
|
-
ansi (1.5.0)
|
18
|
-
builder (3.2.3)
|
19
|
-
byebug (11.0.0)
|
20
|
-
colorize (0.8.1)
|
21
|
-
concurrent-ruby (1.1.4)
|
22
|
-
i18n (0.9.5)
|
23
|
-
concurrent-ruby (~> 1.0)
|
24
|
-
mini_portile2 (2.4.0)
|
25
|
-
minitest (5.11.3)
|
26
|
-
minitest-reporters (1.3.6)
|
27
|
-
ansi
|
28
|
-
builder
|
29
|
-
minitest (>= 5.0)
|
30
|
-
ruby-progressbar
|
31
|
-
nokogiri (1.10.1)
|
32
|
-
mini_portile2 (~> 2.4.0)
|
33
|
-
rake (12.3.2)
|
34
|
-
ruby-progressbar (1.10.0)
|
35
|
-
thread_safe (0.3.6)
|
36
|
-
tzinfo (1.2.5)
|
37
|
-
thread_safe (~> 0.1)
|
38
|
-
|
39
|
-
PLATFORMS
|
40
|
-
ruby
|
41
|
-
|
42
|
-
DEPENDENCIES
|
43
|
-
ad_localize!
|
44
|
-
bundler (~> 2.0)
|
45
|
-
byebug (~> 11.0)
|
46
|
-
minitest (~> 5.11)
|
47
|
-
minitest-reporters (~> 1.3)
|
48
|
-
rake (~> 12.3)
|
49
|
-
|
50
|
-
BUNDLED WITH
|
51
|
-
2.0.1
|