fastlane-plugin-upload_to_onesky 0.1.1 → 0.1.2
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: df21fc9058fe9bcd922134204271ef24bfd4fc00
|
4
|
+
data.tar.gz: 7d114bd3c03528292ca454ed2a1b6c9815ae3568
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b37074851e080745d7c285b1cbef969e60aaadfa594fb3ce4f0a510444fd04d04e52f387df0c9ab93819dccb993dc562de15ed93ce8f86fe23f1ce4f048fa8
|
7
|
+
data.tar.gz: d937ea192f47f5786ab717d9d1207f05e7a8d2e5eb9d08f5b8c924815036eae4ff958bf9d211b72b0e00f451adf467bbb19afb1708d5638be17a55bb73b85abf
|
@@ -2,15 +2,28 @@ module Fastlane
|
|
2
2
|
module Actions
|
3
3
|
class UploadToOneskyAction < Action
|
4
4
|
def self.run(params)
|
5
|
-
|
6
|
-
require 'onesky'
|
5
|
+
require 'rest-client'
|
7
6
|
|
8
|
-
|
7
|
+
file_path = File.expand_path(params[:strings_file_path])
|
9
8
|
|
10
|
-
|
9
|
+
file = File.new(file_path, 'rt')
|
10
|
+
|
11
|
+
request_params = {
|
12
|
+
content_type: :json,
|
13
|
+
params: self.auth_hash(params[:public_key], params[:secret_key])
|
14
|
+
|
15
|
+
}
|
11
16
|
|
12
17
|
UI.success 'Starting the upload to OneSky'
|
13
|
-
|
18
|
+
url = "https://platform.api.onesky.io/1/projects/#{params[:project_id]}/files"
|
19
|
+
|
20
|
+
body_hash = {
|
21
|
+
file: file,
|
22
|
+
file_format: params[:strings_file_format],
|
23
|
+
multipart: true
|
24
|
+
}
|
25
|
+
|
26
|
+
resp = RestClient.post(url,body_hash, request_params)
|
14
27
|
|
15
28
|
if resp.code == 201
|
16
29
|
UI.success "#{File.basename params[:strings_file_path]} was successfully uploaded to project #{params[:project_id]} in OneSky"
|
@@ -20,6 +33,16 @@ module Fastlane
|
|
20
33
|
|
21
34
|
end
|
22
35
|
|
36
|
+
def self.auth_hash(api_key, secret_key)
|
37
|
+
now = Time.now.to_i
|
38
|
+
|
39
|
+
{
|
40
|
+
api_key: api_key,
|
41
|
+
timestamp: now,
|
42
|
+
dev_hash: Digest::MD5.hexdigest(now.to_s + secret_key)
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
23
46
|
def self.description
|
24
47
|
'Upload a strings file to OneSky'
|
25
48
|
end
|
metadata
CHANGED
@@ -1,35 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-upload_to_onesky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joshrlesch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: onesky-ruby
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.0'
|
20
|
-
- - ">="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.0.1
|
23
|
-
type: :runtime
|
24
|
-
prerelease: false
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
requirements:
|
27
|
-
- - "~>"
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: '1.0'
|
30
|
-
- - ">="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.0.1
|
33
13
|
- !ruby/object:Gem::Dependency
|
34
14
|
name: pry
|
35
15
|
requirement: !ruby/object:Gem::Requirement
|