tmsync 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/lib/tmsync/cli.rb +11 -1
- data/lib/tmsync/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb59f477a2835fdd3d18cac8aa62b73aa64b1505
|
4
|
+
data.tar.gz: 726daf9b9a90166302ae6f02cda66e6aacdc0109
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3329cafd6e68434cc8c6fb7c80934383a1399cd357053cff4c953e5a547bb7727a2ca8fae450a029bcfef64ab0b390f35e8bb9d3b42f6e4e94139e1a01e5b030
|
7
|
+
data.tar.gz: 6b7da8070d7b13ce546d51b514c20287b1942bab39960c883158009f7717c72bde574fcb1c3b4250086c9fac6a8f933bdf9ed4dd85eaacb3a9a56099e7f96cfb
|
data/README.md
CHANGED
@@ -10,32 +10,32 @@ Simply run the following to install it:
|
|
10
10
|
|
11
11
|
## Usage
|
12
12
|
|
13
|
-
Run TMSync simply by calling `tmsync execute` in the command line. The following options are
|
13
|
+
Run TMSync simply by calling `tmsync execute` in the command line. The following options are **required**:
|
14
14
|
|
15
15
|
- `--path=` / `-p`: Specify the absolute path to search for localization files. Usually the root directory of your project.
|
16
|
-
- `--command=` / `-cmd`: Specify the command of your translation manager to download/upload a single translation file. `<LANGUAGE
|
16
|
+
- `--command=` / `-cmd`: Specify the command of your translation manager to download/upload a single translation file. `<LANGUAGE>`, `<FILE_PATH>`, `<FILE_DIR>`, `<FILE_NAME>`, `<FILE_EXT>` will be replaced by the according values.
|
17
17
|
|
18
|
-
In addition to the required fields you need to either specify a platform (currently supported: `ios`, `android`)
|
18
|
+
In addition to the required fields you need to either specify a platform (currently supported: `ios`, `android`) **OR** you need to specify a matching regular expression as well as an exclusion regular expression yourself. Note that the matching regular expression needs to have a capture group which catches the language so you can access `<LANGUAGE>` in your command:
|
19
19
|
- `--platform=`: Preconfigured regexes for the iOS and Android platform. Specify `ios` or `android`.
|
20
20
|
- `--matching_regex=` / `-matching`: Specify a custom regex for matching the translation files in search. This should include a catch group for the language.
|
21
21
|
- `--exclude_regex=` / `-exclude`: Specify a custom for excluding some files that were found with the matching regex.
|
22
22
|
|
23
|
-
Here's a
|
23
|
+
Here's a **complete example for iOS**:
|
24
24
|
|
25
25
|
```
|
26
|
-
tmsync execute --command="echo <LANGUAGE> <FILE_PATH>" -p "/absolute/path/to/
|
26
|
+
tmsync execute --command="echo <LANGUAGE> <FILE_PATH> <FILE_DIR> <FILE_NAME> <FILE_EXT>" -p "/absolute/path/to/project" --platform=ios
|
27
27
|
```
|
28
28
|
|
29
|
-
Here's a
|
29
|
+
Here's a **complete example for Android**:
|
30
30
|
|
31
31
|
```
|
32
|
-
tmsync execute --command="echo <LANGUAGE> <FILE_PATH>" -p "/absolute/path/to/
|
32
|
+
tmsync execute --command="echo <LANGUAGE> <FILE_PATH> <FILE_DIR> <FILE_NAME> <FILE_EXT>" -p "/absolute/path/to/project" --platform=android
|
33
33
|
```
|
34
34
|
|
35
|
-
Here's a
|
35
|
+
Here's a **complete custom example**:
|
36
36
|
|
37
37
|
```
|
38
|
-
tmsync execute --command="echo <LANGUAGE> <FILE_PATH>" -p "/Users/JamitLabs/Code/Apple/FitterYou" -matching ".*\/\S+\.(\S+)\.yml"
|
38
|
+
tmsync execute --command="echo <LANGUAGE> <FILE_PATH> <FILE_DIR> <FILE_NAME> <FILE_EXT>" -p "/Users/JamitLabs/Code/Apple/FitterYou" -matching ".*\/\S+\.(\S+)\.yml"
|
39
39
|
```
|
40
40
|
|
41
41
|
|
data/lib/tmsync/cli.rb
CHANGED
@@ -45,7 +45,17 @@ module Tmsync
|
|
45
45
|
else
|
46
46
|
result.keys.each do |language|
|
47
47
|
result[language].each do |file_path|
|
48
|
-
|
48
|
+
file_directory = File.dirname(file_path)
|
49
|
+
file_extension = File.extname(file_path)
|
50
|
+
file_name = File.basename(file_path, file_extension)
|
51
|
+
|
52
|
+
command = options[:command]
|
53
|
+
.gsub('<LANGUAGE>', language)
|
54
|
+
.gsub('<FILE_PATH>', file_path)
|
55
|
+
.gsub('<FILE_DIR>', file_directory)
|
56
|
+
.gsub('<FILE_EXT>', file_extension)
|
57
|
+
.gsub('<FILE_NAME>', file_name)
|
58
|
+
|
49
59
|
puts "Executing: '#{command}'"
|
50
60
|
output = %x(#{command})
|
51
61
|
|
data/lib/tmsync/version.rb
CHANGED
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.
|
4
|
+
version: 0.2.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-
|
11
|
+
date: 2017-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|