tmsync 0.2.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2feb4ddab0578aa817fde936f9bfc69bf6684a72
4
- data.tar.gz: 0fc15599460f6b338dff4ef6b5d3bc63ecdf69d3
3
+ metadata.gz: cebd6cabe522817b08e27a68674f876ac6230bf0
4
+ data.tar.gz: 05a305e4fa9e9f3fcc3ab1a778374a24cf66adb3
5
5
  SHA512:
6
- metadata.gz: 2b5ece11d498aa43af6f62e396e65fe932c4c642b4bc5ccf6536a668972503ddd0beae88f571f58af251a01734b6d3847932716dd357bed5e81612691f54a356
7
- data.tar.gz: 23c92a976e5b645e718257478a98813dda9f9bb293ffe7ba7025d58501548698cb785a82012a02e8f63489bf52b9223460446f2b579f443e76cb67b460a75d61
6
+ metadata.gz: e2253480e605e1f27dfb92b1a284da70c3a43b0c5ccca9c8d3646ebed75a45ed7baa66b05959816545afecbbb49c0a65bc94980946150b358c390b292e0a880e
7
+ data.tar.gz: 0151f6219e93d24f8007f71ede107bfc8d321cb12e0c39ab29a7c50c5450389e68fcc9940d1786fd63a2f7fac897c256104a9f6d7f6f1d2f00060b36c5146144
data/lib/tmsync/cli.rb CHANGED
@@ -49,6 +49,8 @@ module Tmsync
49
49
  file_directory[0] = '' if file_directory[0] == '/'
50
50
  file_extension = File.extname(file_path)
51
51
  file_name = File.basename(file_path, file_extension)
52
+ android_module = ''
53
+ android_module = file_path.to_a.first if options[:platform] == 'android'
52
54
 
53
55
  command = options[:command]
54
56
  .gsub('<LANGUAGE>', language)
@@ -56,6 +58,7 @@ module Tmsync
56
58
  .gsub('<FILE_DIR>', file_directory)
57
59
  .gsub('<FILE_EXT>', file_extension)
58
60
  .gsub('<FILE_NAME>', file_name)
61
+ .gsub('<ANDROID_MODULE>', android_module)
59
62
 
60
63
  puts "Executing: '#{command}'"
61
64
  output = %x(#{command})
@@ -1,3 +1,3 @@
1
1
  module Tmsync
2
- VERSION = "0.2.2"
2
+ VERSION = "0.3.0"
3
3
  end
data/lib/tmsync.rb CHANGED
@@ -5,7 +5,7 @@ module Tmsync
5
5
  IOS_MATCHING_REGEX = '.*\/(\S+)\.lproj\/.*\.strings'
6
6
  IOS_EXCLUDE_REGEX = '\/Carthage\/|\/Pods\/'
7
7
 
8
- ANDROID_MATCHING_REGEX = 'app\/src\/main\/res\/values-?(\S+)?\/strings.xml'
8
+ ANDROID_MATCHING_REGEX = '[^\/]+\/src\/main\/res\/values-?(\S+)?\/strings.xml'
9
9
  ANDROID_EXCLUDE_REGEX = '\A\z'
10
10
 
11
11
  FALLBACK_LANGUAGE = 'en'
@@ -38,7 +38,7 @@ module Tmsync
38
38
  found_files = found_files.select { |file_path|
39
39
  file_path =~ @matching_regex
40
40
  }.map { |file_path|
41
- [file_path.match(@matching_regex).captures.first, file_path]
41
+ [file_path.match(@matching_regex).captures.last, file_path]
42
42
  }
43
43
 
44
44
  result = found_files.group_by(&:first).map { |k,v| [k, v.each(&:shift).flatten] }.to_h
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmsync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cihat Gündüz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-21 00:00:00.000000000 Z
11
+ date: 2018-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor