locraft 1.1.5 → 1.2.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
  SHA1:
3
- metadata.gz: 035fdcefa4f566e6304981baae085bc6ed947724
4
- data.tar.gz: 9a7ae9a816358a8cca6f69cb7d29561bdf85930b
3
+ metadata.gz: 00ea80f567e4b2549c83f9d7c405207eda4d3c23
4
+ data.tar.gz: 86647c6f7d1980763c6f287aefb7ca220810fc5a
5
5
  SHA512:
6
- metadata.gz: f2f663e25a1fd1cd3560cb4644cad793137f9903e55cbc9bce81183f9acc8ddf8f838adde7192b2b59389db5948c51b86d613a597e77d34920ec0031ec11370f
7
- data.tar.gz: d27362acec990592bed5bcabb236f49c8b19202d2b9b1d13953459d0389b44e2715084fedf00702bed00e7de1b53fc13d50a057e6073528ca785e8a49f3ee2cc
6
+ metadata.gz: 5cbb931ecf45f66c6ce3191b90c51a25344a7b8b27c28b410cf63ecd6fbb805fe71a0f899dec287244ed2387deaa029ea8c08fff6c98472c9f0209a9cb2384c4
7
+ data.tar.gz: acd5d4ab92d6f3648a7629faa87178a47a7958925687c6a48a7a77856faf131d197aff1d1a6adf92ff87b57b18b072cdab49bcc64a1104cf9707a9e3b7b2f3d7
@@ -46,10 +46,13 @@ module Locraft
46
46
  end
47
47
 
48
48
  def row_hash(row, lang)
49
+ value = row[lang] || row[@config.default_lang]
50
+ key = row[@config.gdoc_keys_column] || row[@config.default_lang]
51
+ comment = row[@config.gdoc_comments_column]
49
52
  {
50
- comment: row[@config.gdoc_comments_column],
51
- value: row[lang] || row[@config.default_lang],
52
- key: row[@config.gdoc_keys_column] || row[@config.default_lang]
53
+ comment: comment&.strip,
54
+ value: value&.strip,
55
+ key: key&.strip
53
56
  }
54
57
  end
55
58
 
@@ -30,6 +30,7 @@ module Locraft
30
30
  if worksheets.count > @config.gdoc_sheet
31
31
  sheet = worksheets[@config.gdoc_sheet]
32
32
  file = File.join(@config.relative_destination_dir, EXPORTED_CSV_FILE)
33
+ File.delete(file) if File.exist?(file)
33
34
  sheet.export_as_file(file)
34
35
  file
35
36
  else
@@ -21,8 +21,8 @@ module Locraft
21
21
  end
22
22
 
23
23
  def info_plist_from(localizable_file)
24
- filter = /"(NS|CF).*"\s*=\s*".*";/
25
- File.readlines(localizable_file).select { |l| l =~ filter }.join("\n")
24
+ filter = /"(?:NS|CF).*"\s*=\s*"[^;]*";/
25
+ File.read(localizable_file).scan(filter).join("\n")
26
26
  end
27
27
  end
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locraft
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sroik