fastlane-plugin-poeditor_export 0.2.0 → 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: f2a587922eb9f759bf04ddab0cbb0a0b6eded586
4
- data.tar.gz: 412a3090cab4dea5caadc5194016ecf89f06f6d1
3
+ metadata.gz: 12f870e8a4ae0445aa4eed68717fbe73d37ab561
4
+ data.tar.gz: eaf7f47bfaf78154f41e36fb148e5ad62f244d90
5
5
  SHA512:
6
- metadata.gz: 8cb0f0f92ed7c66e36a6d2d5fb7524edb96aa2859cb7a391707c918f4ae9ec6ff27d697cea0e122c547bc9988960758cd4a76e3a7bc57d0a4878cca678f1f3cb
7
- data.tar.gz: 2f698b3393954444759fd7d3ab218fe96817c7f4a0b4647f4690083cdc27d500ab8262c1e25b57ac44e1b76097388d7719883d1ff4d02889d83b8d3fe07a2abe
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.export_for_lanaguage(params)
6
+ file_uri = Helper::PoeditorExportHelper.export_for_language(params)
7
7
  res = Net::HTTP.get_response(file_uri)
8
-
9
- File.open(params[:output_path], 'w+') { |file| file.write(res.body) }
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: false,
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.export_for_lanaguage(params)
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
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module PoeditorExport
3
- VERSION = "0.2.0"
3
+ VERSION = "0.3.0"
4
4
  end
5
5
  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.2.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: 2016-07-11 00:00:00.000000000 Z
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.4.8
129
+ rubygems_version: 2.5.1
130
130
  signing_key:
131
131
  specification_version: 4
132
132
  summary: Exports translations from POEditor.com