poeditor-cli 0.4.0 → 0.5.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 +4 -4
- data/lib/poeditor/commands/pull_command.rb +1 -0
- data/lib/poeditor/configuration.rb +6 -1
- data/lib/poeditor/core.rb +5 -2
- data/lib/poeditor/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: 38d11059d33891455aa05f4c6f93239ad2344de2
|
4
|
+
data.tar.gz: abc518b713d6cfb30513811c040a81f266f3db10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0750508130838a5aae2bdd22b97f01f2e420f084c0092d5d6df62b9b0daa5943f68c6ba4672b4dab89841a70147c7b0d4bbf3927bf2b14febe63a82f69099ce2'
|
7
|
+
data.tar.gz: 6fda57c6d3e8ffbe49d88de0a3eae01f5e4f40fbe5487b13e2ee2f4b4389016407d1b13eaf6e8f644b592ad13692941487cbb3dc7fa654720026cc44dcd540ec
|
@@ -42,6 +42,7 @@ Configuration file doesn't exist: #{config_path}.
|
|
42
42
|
project_id: get_or_raise(yaml, "project_id"),
|
43
43
|
type: get_or_raise(yaml, "type"),
|
44
44
|
tags: yaml["tags"],
|
45
|
+
filters: yaml["filters"],
|
45
46
|
languages: get_or_raise(yaml, "languages"),
|
46
47
|
language_alias: yaml["language_alias"],
|
47
48
|
path: get_or_raise(yaml, "path"),
|
@@ -12,6 +12,9 @@ module POEditor
|
|
12
12
|
|
13
13
|
# @return [Array<String>] Tag filters (optional)
|
14
14
|
attr_accessor :tags
|
15
|
+
|
16
|
+
# @return [Array<String>] Filters by 'translated', 'untranslated', 'fuzzy', 'not_fuzzy', 'automatic', 'not_automatic', 'proofread', 'not_proofread' (optional)
|
17
|
+
attr_accessor :filters
|
15
18
|
|
16
19
|
# @return [Array<String>] The languages codes
|
17
20
|
attr_accessor :languages
|
@@ -26,12 +29,13 @@ module POEditor
|
|
26
29
|
attr_accessor :path_replace
|
27
30
|
|
28
31
|
def initialize(api_key:, project_id:, type:, tags:nil,
|
29
|
-
languages:, language_alias:nil,
|
32
|
+
filters:nil, languages:, language_alias:nil,
|
30
33
|
path:, path_replace:nil)
|
31
34
|
@api_key = from_env(api_key)
|
32
35
|
@project_id = from_env(project_id.to_s)
|
33
36
|
@type = type
|
34
37
|
@tags = tags || []
|
38
|
+
@filters = filters || []
|
35
39
|
|
36
40
|
@languages = languages
|
37
41
|
@language_alias = language_alias || {}
|
@@ -53,6 +57,7 @@ module POEditor
|
|
53
57
|
values = {
|
54
58
|
"type" => self.type,
|
55
59
|
"tags" => self.tags,
|
60
|
+
"filters" => self.filters,
|
56
61
|
"languages" => self.languages,
|
57
62
|
"language_alias" => self.language_alias,
|
58
63
|
"path" => self.path,
|
data/lib/poeditor/core.rb
CHANGED
@@ -39,7 +39,8 @@ module POEditor
|
|
39
39
|
:project_id => @configuration.project_id,
|
40
40
|
:language => language,
|
41
41
|
:type => @configuration.type,
|
42
|
-
:tags => @configuration.tags
|
42
|
+
:tags => @configuration.tags,
|
43
|
+
:filters => @configuration.filters)
|
43
44
|
write(language, content)
|
44
45
|
|
45
46
|
for alias_to, alias_from in @configuration.language_alias
|
@@ -57,14 +58,16 @@ module POEditor
|
|
57
58
|
# @param language [String]
|
58
59
|
# @param type [String]
|
59
60
|
# @param tags [Array<String>]
|
61
|
+
# @param filters [Array<String>]
|
60
62
|
#
|
61
63
|
# @return Downloaded translation content
|
62
|
-
def export(api_key:, project_id:, language:, type:, tags:nil)
|
64
|
+
def export(api_key:, project_id:, language:, type:, tags:nil, filters:nil)
|
63
65
|
options = {
|
64
66
|
"id" => project_id,
|
65
67
|
"language" => convert_to_poeditor_language(language),
|
66
68
|
"type" => type,
|
67
69
|
"tags" => (tags || []).join(","),
|
70
|
+
"filters" => (filters || []).join(","),
|
68
71
|
}
|
69
72
|
response = self.api("projects/export", api_key, options)
|
70
73
|
data = JSON(response.body)
|
data/lib/poeditor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poeditor-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suyeol Jeon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|