fastlane-plugin-google_sheet_localize 0.3.11 → 0.3.12

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: 9b5d87c095c7e5ca644cad2b1843e389dc0772a30f10ee213fb21e8d5bb64e14
4
- data.tar.gz: d85062c292448a24ca74fce441cb57369a588d30a3581f4929281bf605acbb3f
3
+ metadata.gz: 9fced4de18f8a5080a5434880e0cfaf1a913b94ce99fa0cf616d4c3aef17841e
4
+ data.tar.gz: a31f53557155e56132a9591069c9f145deeadcb43cb1c1de26c21b577c832dc0
5
5
  SHA512:
6
- metadata.gz: 129d2376d444e9b473a455085a7b1fd58ced4a95820f4a8dd339a3c8e0021e44f505bee4c6cbdfd522200a6033017653230cfd78dded79259a09375d4141221e
7
- data.tar.gz: 1130f9c3f659b4b0ad46c7d09745fb002cce7d16b3de2fc78c32e14121d84f57d733e4b8ee2c62e999a5d077149bd57d73a9e2f8342d41378ff5500548e9ca0f
6
+ metadata.gz: 20e49808b8a3c5a3ea3570ce9d87d833ea4d152136e8c792d1571d1a61b227051d9d046e1db533ad1a3968fb09b292ab7cf05ea973e42edf848c556e26081e60
7
+ data.tar.gz: 403dc72598654501cd42e7acca89a98e7d6963513c03cbd5b5d79e542163b9cfff0df5aaa39e4ced4163656cc81508a45a4120ece9237746109e4b117602e876
@@ -519,30 +519,40 @@ module Fastlane
519
519
  result = Array.new
520
520
  filtered = self.mapInvalidPlaceholder(text)
521
521
 
522
- stringIndexes = filtered.scan(/%[0-9]?[s@]/)
523
- intIndexes = filtered.scan(/%[0-9]?[d]/)
524
- floatIndexes = filtered.scan(/%[0-9]?[f]/)
525
- doubleIndexes = filtered.scan(/%[0-9]?ld/)
522
+ stringIndexes = self.scan_str(filtered, /%[0-9]?[s@]/)
523
+ intIndexes = self.scan_str(filtered, /%[0-9]?[d]/)
524
+ floatIndexes = self.scan_str(filtered, /%[0-9]?[f]/)
525
+ doubleIndexes = self.scan_str(filtered, /%[0-9]?ld/)
526
526
 
527
527
  if stringIndexes.count > 0
528
- result = result.concat(stringIndexes.map { |e| { "index": e, "type": "String" }})
528
+ result = result.concat(stringIndexes.map { |e| { "index": e[0], "offset": e[1], "type": "String" }})
529
529
  end
530
530
 
531
531
  if intIndexes.count > 0
532
- result = result.concat(intIndexes.map { |e| { "index": e, "type": "Int" }})
532
+ result = result.concat(intIndexes.map { |e| { "index": e[0], "offset": e[1], "type": "Int" }})
533
533
  end
534
534
 
535
535
  if floatIndexes.count > 0
536
- result = result.concat(floatIndexes.map { |e| { "index": e, "type": "Float" }})
536
+ result = result.concat(floatIndexes.map { |e| { "index": e[0], "offset": e[1], "type": "Float" }})
537
537
  end
538
538
 
539
539
  if doubleIndexes.count > 0
540
- result = result.concat(doubleIndexes.map { |e| { "index": e, "type": "Double" }})
540
+ result = result.concat(doubleIndexes.map { |e| { "index": e[0], "offset": e[1], "type": "Double" }})
541
541
  end
542
542
 
543
+ result = result.sort_by! { |k| k["offset"] }.reverse!
544
+
543
545
  return result
544
546
  end
545
547
 
548
+ def self.scan_str(str, pattern)
549
+ res = []
550
+ (0..str.length).each do |i|
551
+ res << [Regexp.last_match.to_s, i] if str[i..-1] =~ /^#{pattern}/
552
+ end
553
+ res
554
+ end
555
+
546
556
  def self.mapInvalidPlaceholder(text)
547
557
  filtered = text.gsub('%s', '%@').gsub('"', '\"')
548
558
  return filtered
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module GoogleSheetLocalize
3
- VERSION = "0.3.11"
3
+ VERSION = "0.3.12"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-google_sheet_localize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.11
4
+ version: 0.3.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mario Hahn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-24 00:00:00.000000000 Z
11
+ date: 2021-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google_drive