ad_localize 6.1.0 → 6.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b70487e0e8087dbbdb3c6873b025748b9fc97e68ac2abc5c13a0fe71a1a1011c
4
- data.tar.gz: c82fe7eeb8bc946411c094f51d69df40a35bc9b9e5c5805203a976c4d2aba9c0
3
+ metadata.gz: 2e28db2bd871d27acd98fe88472fd383dbda178fdbc91d09dae21a8b644be60e
4
+ data.tar.gz: 5baaebf8a8ce774f7285f70d9a522f5a57451caeaabbb6081a1cc4898587d317
5
5
  SHA512:
6
- metadata.gz: 8acdef650f29ede65b72fed96666be542f078337dd6e7b950a8be2ec18b1ff55ee65279dcd5736e5b4d229fed9796b30480cee9b72194ad1bdbba87fa388d81b
7
- data.tar.gz: cad8b9ba73f3055cb7d000fdda14eb45f59a418d6e563a5d272855ff86000779c221282b07e8f33f07f793ecaec6e9150dc9b889c485e8a1496ee1839a5b9daa
6
+ metadata.gz: a7ae29824014dbd2c23d480f1d0441257a5c334e8bd0f7e3a7ddb0e98cdafcec06c44bd9ea32ec7f35471b415a6c05020c6391137ca0bd080d8de0440f8f9c0d
7
+ data.tar.gz: 8c38d9753cc91399d1856bdaca191f32e304f85bd8d94d45bbe2beb8324c99aab6319ef7736cda2e2dd684782b7451b436333f1a72edd4d79118326d0b1d3ce1
@@ -7,7 +7,7 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
  strategy:
9
9
  matrix:
10
- ruby: ['3.0.6', '3.1.4', '3.2.0']
10
+ ruby: ['3.1.4', '3.2.0', '3.3.5']
11
11
 
12
12
  steps:
13
13
  - uses: actions/checkout@v2
@@ -19,6 +19,15 @@ jobs:
19
19
  gem install bundler
20
20
  bundle install --jobs 4 --retry 3
21
21
  - name: Run linter
22
- run: bundle exec rubocop
22
+ run: bundle exec rubocop --lint
23
23
  - name: Run tests
24
24
  run: bundle exec rake test
25
+ - run: 'echo "$GOOGLE_APPLICATION_CREDENTIALS" > account_secret.json'
26
+ shell: bash
27
+ env:
28
+ GOOGLE_APPLICATION_CREDENTIALS: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
29
+ - name: Run private google sheet tests
30
+ if: matrix.ruby == '3.3.5' # Limit execution on latest ruby version to prevent reaching rate limits
31
+ run: bundle exec rake test_private_google_sheet
32
+ env:
33
+ GOOGLE_APPLICATION_CREDENTIALS: 'account_secret.json'
data/.gitignore CHANGED
@@ -11,3 +11,4 @@ ad_localize/tmp/
11
11
  .ruby-version
12
12
  pkg/
13
13
  exports/
14
+ account_secret.json
data/.rubocop.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.7
4
+ TargetRubyVersion: 3.1
5
5
  NewCops: enable
data/.rubocop_todo.yml CHANGED
@@ -1,12 +1,12 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2023-02-02 13:39:01 UTC using RuboCop version 1.43.0.
3
+ # on 2023-12-12 15:16:08 UTC using RuboCop version 1.58.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 4
9
+ # Offense count: 1
10
10
  # This cop supports safe autocorrection (--autocorrect).
11
11
  # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
12
12
  # Include: **/*.gemspec
@@ -14,25 +14,11 @@ Gemspec/OrderedDependencies:
14
14
  Exclude:
15
15
  - 'ad_localize.gemspec'
16
16
 
17
- # Offense count: 1
18
- # Configuration parameters: Severity, Include.
19
- # Include: **/*.gemspec
20
- Gemspec/RequiredRubyVersion:
21
- Exclude:
22
- - 'ad_localize.gemspec'
23
-
24
- # Offense count: 86
17
+ # Offense count: 87
25
18
  # This cop supports safe autocorrection (--autocorrect).
26
19
  Layout/EmptyLineAfterMagicComment:
27
20
  Enabled: false
28
21
 
29
- # Offense count: 1
30
- # This cop supports safe autocorrection (--autocorrect).
31
- # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
32
- Lint/UnusedBlockArgument:
33
- Exclude:
34
- - 'lib/ad_localize/mappers/locale_wording_to_hash.rb'
35
-
36
22
  # Offense count: 4
37
23
  # This cop supports safe autocorrection (--autocorrect).
38
24
  # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
@@ -41,30 +27,30 @@ Lint/UnusedMethodArgument:
41
27
  - 'lib/ad_localize/interactors/base_generate_files.rb'
42
28
  - 'lib/ad_localize/serializers/templated_serializer.rb'
43
29
 
44
- # Offense count: 6
45
- # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
30
+ # Offense count: 7
31
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
46
32
  Metrics/AbcSize:
47
- Max: 35
33
+ Max: 31
48
34
 
49
- # Offense count: 2
35
+ # Offense count: 4
50
36
  # Configuration parameters: CountComments, CountAsOne.
51
37
  Metrics/ClassLength:
52
38
  Max: 139
53
39
 
54
40
  # Offense count: 1
55
- # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
41
+ # Configuration parameters: AllowedMethods, AllowedPatterns.
56
42
  Metrics/CyclomaticComplexity:
57
- Max: 11
43
+ Max: 9
58
44
 
59
- # Offense count: 11
60
- # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
45
+ # Offense count: 13
46
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
61
47
  Metrics/MethodLength:
62
- Max: 40
48
+ Max: 27
63
49
 
64
50
  # Offense count: 1
65
- # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
51
+ # Configuration parameters: AllowedMethods, AllowedPatterns.
66
52
  Metrics/PerceivedComplexity:
67
- Max: 11
53
+ Max: 9
68
54
 
69
55
  # Offense count: 1
70
56
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
@@ -101,7 +87,7 @@ Naming/VariableName:
101
87
 
102
88
  # Offense count: 1
103
89
  # This cop supports safe autocorrection (--autocorrect).
104
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
90
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
105
91
  # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
106
92
  # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
107
93
  # FunctionalMethods: let, let!, subject, watch
@@ -143,7 +129,7 @@ Style/FormatString:
143
129
 
144
130
  # Offense count: 3
145
131
  # This cop supports safe autocorrection (--autocorrect).
146
- # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns, IgnoredMethods.
132
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns.
147
133
  # SupportedStyles: annotated, template, unannotated
148
134
  Style/FormatStringToken:
149
135
  EnforcedStyle: template
@@ -161,13 +147,16 @@ Style/GuardClause:
161
147
  Exclude:
162
148
  - 'lib/ad_localize/repositories/drive_repository.rb'
163
149
 
164
- # Offense count: 57
150
+ # Offense count: 15
165
151
  # This cop supports safe autocorrection (--autocorrect).
166
152
  # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
167
153
  # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
168
154
  # SupportedShorthandSyntax: always, never, either, consistent
169
155
  Style/HashSyntax:
170
- Enabled: false
156
+ Exclude:
157
+ - 'Rakefile'
158
+ - 'lib/ad_localize/option_handler.rb'
159
+ - 'test/interactors/process_export_request_test.rb'
171
160
 
172
161
  # Offense count: 4
173
162
  # This cop supports unsafe autocorrection (--autocorrect-all).
@@ -197,13 +186,13 @@ Style/NegatedIf:
197
186
 
198
187
  # Offense count: 3
199
188
  # This cop supports unsafe autocorrection (--autocorrect-all).
200
- # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns, IgnoredMethods.
189
+ # Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
201
190
  # SupportedStyles: predicate, comparison
202
191
  Style/NumericPredicate:
203
192
  Exclude:
204
193
  - 'spec/**/*'
205
- - 'test/interactors/process_export_request_test.rb'
206
194
  - 'test/repositories/drive_repository_test.rb'
195
+ - 'test/repositories/private_drive_repository_test.rb'
207
196
 
208
197
  # Offense count: 1
209
198
  # This cop supports safe autocorrection (--autocorrect).
@@ -218,13 +207,13 @@ Style/RedundantAssignment:
218
207
  Exclude:
219
208
  - 'lib/ad_localize/parsers/csv_parser.rb'
220
209
 
221
- # Offense count: 1
210
+ # Offense count: 2
222
211
  # This cop supports safe autocorrection (--autocorrect).
223
212
  Style/RedundantBegin:
224
213
  Exclude:
225
214
  - 'lib/ad_localize/repositories/drive_repository.rb'
226
215
 
227
- # Offense count: 18
216
+ # Offense count: 15
228
217
  # This cop supports safe autocorrection (--autocorrect).
229
218
  Style/RedundantFreeze:
230
219
  Exclude:
@@ -234,7 +223,6 @@ Style/RedundantFreeze:
234
223
  - 'lib/ad_localize/interactors/generate_strings.rb'
235
224
  - 'lib/ad_localize/interactors/merge_wordings.rb'
236
225
  - 'lib/ad_localize/parsers/csv_parser.rb'
237
- - 'lib/ad_localize/parsers/key_parser.rb'
238
226
  - 'lib/ad_localize/serializers/info_plist_serializer.rb'
239
227
  - 'lib/ad_localize/serializers/localizable_strings_serializer.rb'
240
228
  - 'lib/ad_localize/serializers/localizable_stringsdict_serializer.rb'
@@ -245,6 +233,12 @@ Style/RedundantPercentQ:
245
233
  Exclude:
246
234
  - 'ad_localize.gemspec'
247
235
 
236
+ # Offense count: 1
237
+ # This cop supports safe autocorrection (--autocorrect).
238
+ Style/RedundantRegexpArgument:
239
+ Exclude:
240
+ - 'lib/ad_localize/sanitizers/ios_to_android_sanitizer.rb'
241
+
248
242
  # Offense count: 2
249
243
  # This cop supports safe autocorrection (--autocorrect).
250
244
  Style/RedundantRegexpEscape:
@@ -290,30 +284,24 @@ Style/StringConcatenation:
290
284
  - 'lib/ad_localize/serializers/strings_serializer.rb'
291
285
  - 'lib/ad_localize/serializers/templated_serializer.rb'
292
286
 
293
- # Offense count: 85
287
+ # Offense count: 146
294
288
  # This cop supports safe autocorrection (--autocorrect).
295
289
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
296
290
  # SupportedStyles: single_quotes, double_quotes
297
291
  Style/StringLiterals:
298
292
  Enabled: false
299
293
 
300
- # Offense count: 3
301
- # This cop supports safe autocorrection (--autocorrect).
302
- Style/SymbolLiteral:
303
- Exclude:
304
- - 'lib/ad_localize/mappers/options_to_export_request.rb'
305
- - 'test/option_handler_test.rb'
306
-
307
- # Offense count: 3
294
+ # Offense count: 4
308
295
  # This cop supports unsafe autocorrection (--autocorrect-all).
309
296
  Style/ZeroLengthPredicate:
310
297
  Exclude:
311
298
  - 'lib/ad_localize/mappers/locale_wording_to_hash.rb'
312
299
  - 'test/repositories/drive_repository_test.rb'
300
+ - 'test/repositories/private_drive_repository_test.rb'
313
301
 
314
- # Offense count: 10
302
+ # Offense count: 15
315
303
  # This cop supports safe autocorrection (--autocorrect).
316
- # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns.
304
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
317
305
  # URISchemes: http, https
318
306
  Layout/LineLength:
319
307
  Max: 153
data/CHANGELOG.md CHANGED
@@ -7,12 +7,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## Unreleased
9
9
 
10
- ## 6.1.0
10
+ ## [6.3.0] - 2024-11-04
11
+
12
+ ### Removed
13
+
14
+ - Drop support for for ruby <3.1
15
+
16
+ ## [6.2.0] - 2023-12-12
17
+
18
+ ### Added
19
+
20
+ - new option `--skip-value-stripping` that disable the leading and trailing whitespaces removal on wording values. The value stripping was introduced with version 6.0.0.
21
+
22
+ ### Changed
23
+
24
+ - Updated dependencies
25
+ - Increase number of retries to 5 and timeout delay to 120s when accessing Google APIs. This reduces the amount of rate limit error when using private Google spreadsheet.
26
+
27
+ ## [6.1.0] - 2023-09-12
28
+
11
29
  ### Added
12
30
 
13
31
  - new option (iOS only) `--auto-escape-percent` that escapes % character in wording. This option should be used if the wording is intended to be used with `String(format:)`.
14
32
 
15
- ## 6.0.0
33
+ ## [6.0.0] - 2023-07-17
34
+
16
35
  ### Added
17
36
 
18
37
  - Remove extra spaces before and after key/translation contents
data/Gemfile CHANGED
@@ -3,3 +3,11 @@ source "https://rubygems.org"
3
3
 
4
4
  # Specify your gem's dependencies in ad_localize.gemspec
5
5
  gemspec
6
+
7
+ gem 'bundler', '>= 1.12.0', '< 3.0.0'
8
+ gem 'debug', ">= 1.0.0", '< 2.0'
9
+ gem 'diffy', '~> 3.3'
10
+ gem 'minitest', '~> 5.11'
11
+ gem 'minitest-reporters', '~> 1.3'
12
+ gem 'rake', '>= 12.3.0', '< 14.0.0'
13
+ gem 'rubocop', "~> 1.0"
data/Gemfile.lock CHANGED
@@ -1,117 +1,144 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ad_localize (6.1.0)
4
+ ad_localize (6.2.0)
5
5
  activesupport (>= 6.1.3.2, < 8.0)
6
- colorize (~> 0.8)
6
+ colorize (~> 1.0)
7
7
  google-apis-drive_v3 (~> 0.33.0)
8
8
  google-apis-sheets_v4 (~> 0.9)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (7.0.4)
14
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
+ activesupport (7.2.2)
14
+ base64
15
+ benchmark (>= 0.3)
16
+ bigdecimal
17
+ concurrent-ruby (~> 1.0, >= 1.3.1)
18
+ connection_pool (>= 2.2.5)
19
+ drb
15
20
  i18n (>= 1.6, < 2)
21
+ logger (>= 1.4.2)
16
22
  minitest (>= 5.1)
17
- tzinfo (~> 2.0)
18
- addressable (2.8.1)
19
- public_suffix (>= 2.0.2, < 6.0)
23
+ securerandom (>= 0.3)
24
+ tzinfo (~> 2.0, >= 2.0.5)
25
+ addressable (2.8.7)
26
+ public_suffix (>= 2.0.2, < 7.0)
20
27
  ansi (1.5.0)
21
28
  ast (2.4.2)
22
- builder (3.2.4)
23
- colorize (0.8.1)
24
- concurrent-ruby (1.1.10)
25
- debug (1.7.1)
26
- irb (>= 1.5.0)
27
- reline (>= 0.3.1)
29
+ base64 (0.2.0)
30
+ benchmark (0.3.0)
31
+ bigdecimal (3.1.8)
32
+ builder (3.3.0)
33
+ colorize (1.1.0)
34
+ concurrent-ruby (1.3.4)
35
+ connection_pool (2.4.1)
36
+ debug (1.9.2)
37
+ irb (~> 1.10)
38
+ reline (>= 0.3.8)
28
39
  declarative (0.0.20)
29
- diffy (3.4.2)
30
- faraday (2.7.2)
31
- faraday-net_http (>= 2.0, < 3.1)
32
- ruby2_keywords (>= 0.0.4)
33
- faraday-net_http (3.0.2)
34
- google-apis-core (0.9.4)
40
+ diffy (3.4.3)
41
+ drb (2.2.1)
42
+ faraday (2.12.0)
43
+ faraday-net_http (>= 2.0, < 3.4)
44
+ json
45
+ logger
46
+ faraday-net_http (3.3.0)
47
+ net-http
48
+ google-apis-core (0.15.1)
35
49
  addressable (~> 2.5, >= 2.5.1)
36
- googleauth (>= 0.16.2, < 2.a)
37
- httpclient (>= 2.8.1, < 3.a)
50
+ googleauth (~> 1.9)
51
+ httpclient (>= 2.8.3, < 3.a)
38
52
  mini_mime (~> 1.0)
53
+ mutex_m
39
54
  representable (~> 3.0)
40
55
  retriable (>= 2.0, < 4.a)
41
- rexml
42
- webrick
43
56
  google-apis-drive_v3 (0.33.0)
44
57
  google-apis-core (>= 0.9.1, < 2.a)
45
- google-apis-sheets_v4 (0.21.0)
46
- google-apis-core (>= 0.9.1, < 2.a)
47
- googleauth (1.3.0)
48
- faraday (>= 0.17.3, < 3.a)
58
+ google-apis-sheets_v4 (0.38.0)
59
+ google-apis-core (>= 0.15.0, < 2.a)
60
+ google-cloud-env (2.2.1)
61
+ faraday (>= 1.0, < 3.a)
62
+ googleauth (1.11.2)
63
+ faraday (>= 1.0, < 3.a)
64
+ google-cloud-env (~> 2.1)
49
65
  jwt (>= 1.4, < 3.0)
50
- memoist (~> 0.16)
51
66
  multi_json (~> 1.11)
52
67
  os (>= 0.9, < 2.0)
53
68
  signet (>= 0.16, < 2.a)
54
69
  httpclient (2.8.3)
55
- i18n (1.12.0)
70
+ i18n (1.14.6)
56
71
  concurrent-ruby (~> 1.0)
57
- io-console (0.6.0)
58
- irb (1.6.2)
59
- reline (>= 0.3.0)
60
- json (2.6.3)
61
- jwt (2.6.0)
62
- memoist (0.16.2)
63
- mini_mime (1.1.2)
64
- minitest (5.17.0)
65
- minitest-reporters (1.5.0)
72
+ io-console (0.7.2)
73
+ irb (1.14.1)
74
+ rdoc (>= 4.0.0)
75
+ reline (>= 0.4.2)
76
+ json (2.7.5)
77
+ jwt (2.9.3)
78
+ base64
79
+ language_server-protocol (3.17.0.3)
80
+ logger (1.6.1)
81
+ mini_mime (1.1.5)
82
+ minitest (5.25.1)
83
+ minitest-reporters (1.7.1)
66
84
  ansi
67
85
  builder
68
86
  minitest (>= 5.0)
69
87
  ruby-progressbar
70
88
  multi_json (1.15.0)
89
+ mutex_m (0.2.0)
90
+ net-http (0.4.1)
91
+ uri
71
92
  os (1.1.4)
72
- parallel (1.22.1)
73
- parser (3.2.0.0)
93
+ parallel (1.26.3)
94
+ parser (3.3.5.1)
74
95
  ast (~> 2.4.1)
75
- public_suffix (5.0.1)
96
+ racc
97
+ psych (5.1.2)
98
+ stringio
99
+ public_suffix (6.0.1)
100
+ racc (1.8.1)
76
101
  rainbow (3.1.1)
77
- rake (13.0.6)
78
- regexp_parser (2.6.1)
79
- reline (0.3.2)
102
+ rake (13.2.1)
103
+ rdoc (6.7.0)
104
+ psych (>= 4.0.0)
105
+ regexp_parser (2.9.2)
106
+ reline (0.5.10)
80
107
  io-console (~> 0.5)
81
108
  representable (3.2.0)
82
109
  declarative (< 0.1.0)
83
110
  trailblazer-option (>= 0.1.1, < 0.2.0)
84
111
  uber (< 0.2.0)
85
112
  retriable (3.1.2)
86
- rexml (3.2.5)
87
- rubocop (1.43.0)
113
+ rubocop (1.68.0)
88
114
  json (~> 2.3)
115
+ language_server-protocol (>= 3.17.0)
89
116
  parallel (~> 1.10)
90
- parser (>= 3.2.0.0)
117
+ parser (>= 3.3.0.2)
91
118
  rainbow (>= 2.2.2, < 4.0)
92
- regexp_parser (>= 1.8, < 3.0)
93
- rexml (>= 3.2.5, < 4.0)
94
- rubocop-ast (>= 1.24.1, < 2.0)
119
+ regexp_parser (>= 2.4, < 3.0)
120
+ rubocop-ast (>= 1.32.2, < 2.0)
95
121
  ruby-progressbar (~> 1.7)
96
122
  unicode-display_width (>= 2.4.0, < 3.0)
97
- rubocop-ast (1.24.1)
98
- parser (>= 3.1.1.0)
99
- ruby-progressbar (1.11.0)
100
- ruby2_keywords (0.0.5)
101
- signet (0.17.0)
123
+ rubocop-ast (1.33.1)
124
+ parser (>= 3.3.1.0)
125
+ ruby-progressbar (1.13.0)
126
+ securerandom (0.3.1)
127
+ signet (0.19.0)
102
128
  addressable (~> 2.8)
103
129
  faraday (>= 0.17.5, < 3.a)
104
130
  jwt (>= 1.5, < 3.0)
105
131
  multi_json (~> 1.10)
132
+ stringio (3.1.1)
106
133
  trailblazer-option (0.1.2)
107
- tzinfo (2.0.5)
134
+ tzinfo (2.0.6)
108
135
  concurrent-ruby (~> 1.0)
109
136
  uber (0.1.0)
110
- unicode-display_width (2.4.2)
111
- webrick (1.7.0)
137
+ unicode-display_width (2.6.0)
138
+ uri (0.13.1)
112
139
 
113
140
  PLATFORMS
114
- arm64-darwin-21
141
+ ruby
115
142
 
116
143
  DEPENDENCIES
117
144
  ad_localize!
@@ -124,4 +151,4 @@ DEPENDENCIES
124
151
  rubocop (~> 1.0)
125
152
 
126
153
  BUNDLED WITH
127
- 2.4.3
154
+ 2.3.10
data/Makefile ADDED
@@ -0,0 +1,14 @@
1
+ build:
2
+ gem build ad_localize.gemspec
3
+
4
+ install: clean build
5
+ gem install ad_localize-*.gem
6
+
7
+ publish: clean build
8
+ gem push ad_localize-*.gem
9
+
10
+ clean:
11
+ rm -f ad_localize-*.gem
12
+
13
+ tests:
14
+ bundle exec rake test
data/README.md CHANGED
@@ -86,6 +86,11 @@ $ ad_localize --auto-escape-percent
86
86
  $ ad_localize -l fr,en
87
87
  ```
88
88
 
89
+ * Keep extra spaces before and after translated values
90
+ ```
91
+ $ ad_localize --skip-value-stripping
92
+ ```
93
+
89
94
  ### In a Ruby program
90
95
  There are many possibilities when using AdLocalize in a ruby program. You can add support to your own wording format, support other platforms, select which locales you want to export, generate wording file content without writing on the disk and many more.
91
96
 
@@ -101,9 +106,9 @@ If you want more examples, please open a documentation issue.
101
106
  export_request.verbose = true
102
107
  begin
103
108
  # download files - be sure that GOOGLE_APPLICATION_CREDENTIALS is set if you use service account
104
- export_request.downloaded_csvs = DownloadSpreadsheets.new.call(export_request: export_request)
109
+ export_request.downloaded_csvs = AdLocalize::Interactors::DownloadSpreadsheets.new.call(export_request: export_request)
105
110
  # execute request
106
- AdLocalize::Interactors::ExecuteExportRequest.new.call(export_request: export_request)
111
+ AdLocalize::Interactors::ProcessExportRequest.new.call(export_request: export_request)
107
112
  ensure
108
113
  export_request.downloaded_csvs.each do |file|
109
114
  file.close
@@ -283,6 +288,15 @@ To see all available commands run `bundle exec rake -T` .
283
288
 
284
289
  Bug reports and pull requests are welcome on GitHub at https://github.com/applidium/ad_localize. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
285
290
 
291
+ ## How to release a new version
292
+
293
+ 1. After all your changes are reviewed and merged
294
+ 2. Create a `release` branch
295
+ 3. Update the version in `lib/ad_localize/version.rb`
296
+ 4. Execute `make publish`
297
+
298
+ You may need to configure your account at step `4.` if you've never pushed any gem. You can find all the informations you need on [the official documentation](https://guides.rubygems.org/make-your-own-gem/#your-first-gem).
299
+
286
300
  ## License
287
301
 
288
302
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -5,7 +5,13 @@ require "rake/testtask"
5
5
  Rake::TestTask.new(:test) do |t|
6
6
  t.libs << "test"
7
7
  t.libs << "lib"
8
- t.test_files = FileList["test/**/*_test.rb"]
8
+ t.test_files = FileList["test/**/*_test.rb"].exclude("**/private_drive_repository_test.rb")
9
+ end
10
+
11
+ Rake::TestTask.new(:test_private_google_sheet) do |t|
12
+ t.libs << "test"
13
+ t.libs << "lib"
14
+ t.test_files = FileList["test/**/private_drive_repository_test.rb"]
9
15
  end
10
16
 
11
17
  task :default => :test
data/ad_localize.gemspec CHANGED
@@ -39,19 +39,11 @@ Gem::Specification.new do |spec|
39
39
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
40
40
  spec.require_paths = ['lib']
41
41
 
42
- spec.add_development_dependency 'bundler', '>= 1.12.0', '< 3.0.0'
43
- spec.add_development_dependency 'rake', '>= 12.3.0', '< 14.0.0'
44
- spec.add_development_dependency 'minitest', '~> 5.11'
45
- spec.add_development_dependency 'minitest-reporters', '~> 1.3'
46
- spec.add_development_dependency 'diffy', '~> 3.3'
47
- spec.add_development_dependency 'debug', ">= 1.0.0", '< 2.0'
48
- spec.add_development_dependency 'rubocop', "~> 1.0"
49
-
50
42
  spec.add_dependency 'activesupport', '>= 6.1.3.2', '< 8.0'
51
- spec.add_dependency 'colorize', '~> 0.8'
43
+ spec.add_dependency 'colorize', '~> 1.0'
52
44
  spec.add_dependency 'google-apis-sheets_v4', '~> 0.9'
53
45
  spec.add_dependency 'google-apis-drive_v3', '~> 0.33.0'
54
46
 
55
- spec.required_ruby_version = '>= 2.7', '< 4.0'
47
+ spec.required_ruby_version = '>= 3.1', '< 4.0'
56
48
  spec.metadata['rubygems_mfa_required'] = 'true'
57
49
  end
@@ -23,7 +23,7 @@ module AdLocalize
23
23
 
24
24
  def map_plurals(coumpound_wordings:)
25
25
  result = {}
26
- coumpound_wordings.each do |label, simple_wordings|
26
+ coumpound_wordings.each_value do |simple_wordings|
27
27
  variants_hash = map_translations(translations: simple_wordings.values) do |keys, translation|
28
28
  dotted_key_to_hash(keys, { translation.key.variant_name => translation.value })
29
29
  end
@@ -7,6 +7,7 @@ module AdLocalize
7
7
  request.locales = options[:locales]
8
8
  request.bypass_empty_values = options[:'non-empty-values']
9
9
  request.auto_escape_percent = options[:'auto-escape-percent']
10
+ request.skip_value_stripping = options[:'skip-value-stripping']
10
11
  request.csv_paths = options[:csv_paths]
11
12
  request.merge_policy = options[:'merge-policy']
12
13
  request.output_path = options[:'target-dir']
@@ -5,6 +5,7 @@ module AdLocalize
5
5
  locales: Requests::ExportRequest::DEFAULTS[:locales],
6
6
  :'non-empty-values' => Requests::ExportRequest::DEFAULTS[:bypass_empty_values],
7
7
  :'auto-escape-percent' => Requests::ExportRequest::DEFAULTS[:auto_escape_percent],
8
+ :'skip-value-stripping' => Requests::ExportRequest::DEFAULTS[:skip_value_stripping],
8
9
  csv_paths: Requests::ExportRequest::DEFAULTS[:csv_paths],
9
10
  :'merge-policy' => Requests::ExportRequest::DEFAULTS[:merge_policy],
10
11
  :'target-dir' => Requests::ExportRequest::DEFAULTS[:output_path],
@@ -39,6 +40,7 @@ module AdLocalize
39
40
  end
40
41
  parser.on("-x", "--non-empty-values", TrueClass, 'Do not export keys with empty values (iOS only)')
41
42
  parser.on("--auto-escape-percent", TrueClass, 'Add escaping for % symbol to support wording use with String formatting (iOS only)')
43
+ parser.on("--skip-value-stripping", TrueClass, 'Disable the removal of leading and trailing whitespaces on wording values')
42
44
  end.parse!(options, into: args)
43
45
 
44
46
  args[:csv_paths] = options
@@ -73,7 +73,8 @@ module AdLocalize
73
73
  next if export_request.bypass_empty_values && value.blank?
74
74
 
75
75
  comment = row["#{COMMENT_KEY_COLUMN_IDENTIFIER} #{locale}"]
76
- wording[locale].add_wording(key: key, value: value&.strip, comment: comment)
76
+ value = value&.strip unless export_request.skip_value_stripping
77
+ wording[locale].add_wording(key: key, value: value, comment: comment)
77
78
  end
78
79
  added_keys[raw_key] = true
79
80
  end
@@ -17,7 +17,7 @@ module AdLocalize
17
17
  sheet_ids.filter_map do |sheet_id|
18
18
  begin
19
19
  url = export_url(spreadsheet_id: spreadsheet_id, sheet_id: sheet_id)
20
- string = @drive_service.http(:get, url, options: { retries: 3, max_elapsed_time: 60 })
20
+ string = @drive_service.http(:get, url, options: { retries: 5, max_elapsed_time: 120 })
21
21
  next unless string
22
22
 
23
23
  tempfile = Tempfile.new
@@ -6,6 +6,7 @@ module AdLocalize
6
6
  locales: [],
7
7
  bypass_empty_values: false,
8
8
  auto_escape_percent: false,
9
+ skip_value_stripping: false,
9
10
  csv_paths: [],
10
11
  merge_policy: Interactors::MergeWordings::DEFAULT_POLICY,
11
12
  output_path: Pathname.new('exports'),
@@ -23,6 +24,7 @@ module AdLocalize
23
24
  :locales,
24
25
  :bypass_empty_values,
25
26
  :auto_escape_percent,
27
+ :skip_value_stripping,
26
28
  :csv_paths,
27
29
  :merge_policy,
28
30
  :output_path,
@@ -38,6 +40,7 @@ module AdLocalize
38
40
  @locales = DEFAULTS[:locales]
39
41
  @bypass_empty_values = DEFAULTS[:bypass_empty_values]
40
42
  @auto_escape_percent = DEFAULTS[:auto_escape_percent]
43
+ @skip_value_stripping = DEFAULTS[:skip_value_stripping]
41
44
  @csv_paths = DEFAULTS[:csv_paths]
42
45
  @merge_policy = DEFAULTS[:merge_policy]
43
46
  @output_path = DEFAULTS[:output_path]
@@ -63,6 +66,10 @@ module AdLocalize
63
66
  @auto_escape_percent = [true, 'true'].include?(value)
64
67
  end
65
68
 
69
+ def skip_value_stripping=(value)
70
+ @skip_value_stripping = [true, 'true'].include?(value)
71
+ end
72
+
66
73
  def csv_paths=(value)
67
74
  return unless value.is_a? Array
68
75
 
@@ -127,6 +134,7 @@ module AdLocalize
127
134
  "locales: #{locales}, " \
128
135
  "bypass_empty_values: #{bypass_empty_values}, " \
129
136
  "auto_escape_percent: #{auto_escape_percent}, " \
137
+ "skip_value_stripping: #{skip_value_stripping}, " \
130
138
  "csv_paths: #{csv_paths}, " \
131
139
  "merge_policy: #{merge_policy}, " \
132
140
  "output_path: #{output_path}, " \
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module AdLocalize
3
- VERSION = "6.1.0"
3
+ VERSION = "6.3.0"
4
4
  end
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: 6.1.0
4
+ version: 6.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edouard Siegel
@@ -21,124 +21,8 @@ authors:
21
21
  autorequire:
22
22
  bindir: exe
23
23
  cert_chain: []
24
- date: 2023-09-12 00:00:00.000000000 Z
24
+ date: 2024-11-04 00:00:00.000000000 Z
25
25
  dependencies:
26
- - !ruby/object:Gem::Dependency
27
- name: bundler
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 1.12.0
33
- - - "<"
34
- - !ruby/object:Gem::Version
35
- version: 3.0.0
36
- type: :development
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 1.12.0
43
- - - "<"
44
- - !ruby/object:Gem::Version
45
- version: 3.0.0
46
- - !ruby/object:Gem::Dependency
47
- name: rake
48
- requirement: !ruby/object:Gem::Requirement
49
- requirements:
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 12.3.0
53
- - - "<"
54
- - !ruby/object:Gem::Version
55
- version: 14.0.0
56
- type: :development
57
- prerelease: false
58
- version_requirements: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - ">="
61
- - !ruby/object:Gem::Version
62
- version: 12.3.0
63
- - - "<"
64
- - !ruby/object:Gem::Version
65
- version: 14.0.0
66
- - !ruby/object:Gem::Dependency
67
- name: minitest
68
- requirement: !ruby/object:Gem::Requirement
69
- requirements:
70
- - - "~>"
71
- - !ruby/object:Gem::Version
72
- version: '5.11'
73
- type: :development
74
- prerelease: false
75
- version_requirements: !ruby/object:Gem::Requirement
76
- requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: '5.11'
80
- - !ruby/object:Gem::Dependency
81
- name: minitest-reporters
82
- requirement: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - "~>"
85
- - !ruby/object:Gem::Version
86
- version: '1.3'
87
- type: :development
88
- prerelease: false
89
- version_requirements: !ruby/object:Gem::Requirement
90
- requirements:
91
- - - "~>"
92
- - !ruby/object:Gem::Version
93
- version: '1.3'
94
- - !ruby/object:Gem::Dependency
95
- name: diffy
96
- requirement: !ruby/object:Gem::Requirement
97
- requirements:
98
- - - "~>"
99
- - !ruby/object:Gem::Version
100
- version: '3.3'
101
- type: :development
102
- prerelease: false
103
- version_requirements: !ruby/object:Gem::Requirement
104
- requirements:
105
- - - "~>"
106
- - !ruby/object:Gem::Version
107
- version: '3.3'
108
- - !ruby/object:Gem::Dependency
109
- name: debug
110
- requirement: !ruby/object:Gem::Requirement
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 1.0.0
115
- - - "<"
116
- - !ruby/object:Gem::Version
117
- version: '2.0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: 1.0.0
125
- - - "<"
126
- - !ruby/object:Gem::Version
127
- version: '2.0'
128
- - !ruby/object:Gem::Dependency
129
- name: rubocop
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - "~>"
133
- - !ruby/object:Gem::Version
134
- version: '1.0'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '1.0'
142
26
  - !ruby/object:Gem::Dependency
143
27
  name: activesupport
144
28
  requirement: !ruby/object:Gem::Requirement
@@ -165,14 +49,14 @@ dependencies:
165
49
  requirements:
166
50
  - - "~>"
167
51
  - !ruby/object:Gem::Version
168
- version: '0.8'
52
+ version: '1.0'
169
53
  type: :runtime
170
54
  prerelease: false
171
55
  version_requirements: !ruby/object:Gem::Requirement
172
56
  requirements:
173
57
  - - "~>"
174
58
  - !ruby/object:Gem::Version
175
- version: '0.8'
59
+ version: '1.0'
176
60
  - !ruby/object:Gem::Dependency
177
61
  name: google-apis-sheets_v4
178
62
  requirement: !ruby/object:Gem::Requirement
@@ -223,6 +107,7 @@ files:
223
107
  - Gemfile
224
108
  - Gemfile.lock
225
109
  - LICENSE.txt
110
+ - Makefile
226
111
  - README.md
227
112
  - Rakefile
228
113
  - ad_localize.gemspec
@@ -292,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
292
177
  requirements:
293
178
  - - ">="
294
179
  - !ruby/object:Gem::Version
295
- version: '2.7'
180
+ version: '3.1'
296
181
  - - "<"
297
182
  - !ruby/object:Gem::Version
298
183
  version: '4.0'
@@ -302,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
187
  - !ruby/object:Gem::Version
303
188
  version: '0'
304
189
  requirements: []
305
- rubygems_version: 3.4.10
190
+ rubygems_version: 3.5.16
306
191
  signing_key:
307
192
  specification_version: 4
308
193
  summary: AdLocalize helps with mobile and web applications wording