fastlane-plugin-upload_to_server 0.1.4 → 0.1.5

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: 27c8c5ee154a7737e71ad90591308619cdc93594
4
- data.tar.gz: b3d5482f8bc1f2739113603ae15d2e629221a4f7
3
+ metadata.gz: 1809a71584d013a3eb54ae034f12455d1115f0ee
4
+ data.tar.gz: d20b92b02aa1849a748a9d67ce0752c603ac04d8
5
5
  SHA512:
6
- metadata.gz: 67024f4371d5ea9f4b25a0e86c0be046d4ce77662a93b62291eba9a3547f02b3b22fe9bb2a41ec6bef93c950b8446feb155cefa2ab247ce0b412bb04961f1ceb
7
- data.tar.gz: 76f37f5954c22548789726772026ced8aeef2914674d5b50b377af842fb627fb13a783340f2c41d687aae61bee8cc962e0874c6f52dbb325cf56eca796380237
6
+ metadata.gz: 2d8e7e81575746489bbd15fa168f23fd7f6ec9c176416ad502f424a64fb463d61355efbb89cf82cc024426aad9654f998f1da077058b760bdfe4613c94d4c8b1
7
+ data.tar.gz: d09b78b0495cd4780f1bfeca4d17d649da6388a7963af7c5757e38820d8b2efdcb3410aa00c4c69076520afdfe7300e208a42575561ea8c79569b939e7012781
data/README.md CHANGED
@@ -33,6 +33,7 @@ upload_to_server(
33
33
  // here goes any multipart data you want to add
34
34
  :param1 => 'param1data',
35
35
  :param2 => 'param2data',
36
+ :fileFormFieldName => "this is the file field name that you expect on your backend"
36
37
  },
37
38
  headers: {
38
39
  //required headers
@@ -26,37 +26,24 @@ module Fastlane
26
26
  UI.user_error!("No IPA or APK or a file path given, pass using `ipa: 'ipa path'` or `apk: 'apk path' or file:`") if ipa_file.to_s.length == 0 && apk_file.to_s.length == 0 && custom_file.to_s.length == 0
27
27
  UI.user_error!("Please only give IPA path or APK path (not both)") if ipa_file.to_s.length > 0 && apk_file.to_s.length > 0
28
28
 
29
- upload_apk(params, apk_file) if apk_file.to_s.length > 0
30
- upload_ipa(params, ipa_file) if ipa_file.to_s.length > 0
29
+ upload_custom_file(params, apk_file) if apk_file.to_s.length > 0
30
+ upload_custom_file(params, ipa_file) if ipa_file.to_s.length > 0
31
31
  upload_custom_file(params, custom_file) if custom_file.to_s.length > 0
32
32
 
33
33
  end
34
34
 
35
35
  def self.upload_custom_file(params, custom_file)
36
36
  multipart_payload = params[:multipartPayload]
37
-
38
- multipart_payload[:multipart] = true
39
- multipart_payload[:file] = File.new(params[:file], 'rb')
40
-
41
- upload_file(params, multipart_payload)
42
- end
43
-
44
- def self.upload_apk(params, apk_file)
45
- multipart_payload = params[:multipartPayload]
46
-
47
37
  multipart_payload[:multipart] = true
48
- multipart_payload[:file] = File.new(params[:apk], 'rb')
49
-
50
- upload_file(params, multipart_payload)
51
- end
52
-
53
- def self.upload_ipa(params, ipa_file)
54
- multipart_payload = params[:multipartPayload]
55
-
56
- multipart_payload[:multipart] = true
57
- multipart_payload[:file] = File.new(params[:ipa], 'rb')
58
-
59
- upload_file(params, multipart_payload)
38
+ if multipart_payload[:fileFormFieldName]
39
+ key = multipart_payload[:fileFormFieldName]
40
+ multipart_payload["#{key}"] = File.new(custom_file, 'rb')
41
+ else
42
+ multipart_payload[:file] = File.new(custom_file, 'rb')
43
+ end
44
+
45
+ UI.message multipart_payload
46
+ upload_file(params, multipart_payload)
60
47
  end
61
48
 
62
49
  def self.upload_file(params, multipart_payload)
@@ -105,7 +92,7 @@ module Fastlane
105
92
  FastlaneCore::ConfigItem.new(key: :file,
106
93
  env_name: "",
107
94
  description: "file to be uploaded to the server",
108
- optional: true,
95
+ optional: true),
109
96
  FastlaneCore::ConfigItem.new(key: :multipartPayload,
110
97
  env_name: "",
111
98
  description: "payload for the multipart request ",
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module UploadToServer
3
- VERSION = "0.1.4"
3
+ VERSION = "0.1.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-upload_to_server
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maxim Toyberman