fastlane-plugin-poeditor_export 0.2.0 → 0.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12f870e8a4ae0445aa4eed68717fbe73d37ab561
|
4
|
+
data.tar.gz: eaf7f47bfaf78154f41e36fb148e5ad62f244d90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91eab0e021c585da57a0d404e6af683cc4fee401bf1c82f8405b13a2dd125a04fb010d626e9d52ddb4b8b3d1a5c58f8df6ad7704e24028ea823391f77c416e8f
|
7
|
+
data.tar.gz: b23a70773decb021d89402917c1c8eb45a9edb7240314901e47bb09c2359578b51970ea8d2a24045ea980395c669b4682e5b3ab16eff52f56effa8b428c267f4
|
@@ -3,10 +3,17 @@ module Fastlane
|
|
3
3
|
class PoeditorExportAction < Action
|
4
4
|
def self.run(params)
|
5
5
|
|
6
|
-
file_uri = Helper::PoeditorExportHelper.
|
6
|
+
file_uri = Helper::PoeditorExportHelper.export_for_language(params)
|
7
7
|
res = Net::HTTP.get_response(file_uri)
|
8
|
-
|
9
|
-
|
8
|
+
|
9
|
+
unless params[:output_path].nil?
|
10
|
+
output = params[:output_path]
|
11
|
+
else
|
12
|
+
output = params[:language] + '.strings'
|
13
|
+
end
|
14
|
+
|
15
|
+
File.open(output, 'w+') { |file| file.write(res.body) }
|
16
|
+
|
10
17
|
UI.message('Exported from POEditor!')
|
11
18
|
end
|
12
19
|
|
@@ -15,7 +22,7 @@ module Fastlane
|
|
15
22
|
end
|
16
23
|
|
17
24
|
def self.authors
|
18
|
-
["James Campbell"]
|
25
|
+
["James Campbell","Bruno Scheele"]
|
19
26
|
end
|
20
27
|
|
21
28
|
def self.available_options
|
@@ -40,10 +47,15 @@ module Fastlane
|
|
40
47
|
description: "The language to export",
|
41
48
|
optional: false,
|
42
49
|
type: String),
|
50
|
+
FastlaneCore::ConfigItem.new(key: :tag,
|
51
|
+
env_name: "POEDITOR_TAG",
|
52
|
+
description: "The tag to export",
|
53
|
+
optional: true,
|
54
|
+
type: String),
|
43
55
|
FastlaneCore::ConfigItem.new(key: :output_path,
|
44
56
|
env_name: "POEDITOR_OUTPUT_PATH",
|
45
|
-
description: "The output path for exported file",
|
46
|
-
optional:
|
57
|
+
description: "The output path for exported file. If not provided, it defaults to the export language with the .strings extension",
|
58
|
+
optional: true,
|
47
59
|
type: String)
|
48
60
|
]
|
49
61
|
end
|
@@ -3,8 +3,8 @@ module Fastlane
|
|
3
3
|
class PoeditorExportHelper
|
4
4
|
API_URL = 'https://poeditor.com/api/'
|
5
5
|
EXPORT_ACTION = 'export'
|
6
|
-
|
7
|
-
def self.
|
6
|
+
|
7
|
+
def self.export_for_language(params)
|
8
8
|
uri = URI(API_URL)
|
9
9
|
|
10
10
|
export_params = {
|
@@ -12,11 +12,16 @@ module Fastlane
|
|
12
12
|
action: EXPORT_ACTION,
|
13
13
|
id: params[:project_id],
|
14
14
|
type: params[:export_format],
|
15
|
-
language: params[:language]
|
15
|
+
language: params[:language],
|
16
16
|
}
|
17
|
+
|
18
|
+
unless params[:tag].nil?
|
19
|
+
export_params["tags"] = params[:tag]
|
20
|
+
end
|
17
21
|
|
18
22
|
res = Net::HTTP.post_form(uri, export_params)
|
19
23
|
json = JSON.parse(res.body)
|
24
|
+
|
20
25
|
URI(json["item"])
|
21
26
|
end
|
22
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-poeditor_export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Campbell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|
@@ -126,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
126
126
|
version: '0'
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
|
-
rubygems_version: 2.
|
129
|
+
rubygems_version: 2.5.1
|
130
130
|
signing_key:
|
131
131
|
specification_version: 4
|
132
132
|
summary: Exports translations from POEditor.com
|