ci_toolkit 1.5.21 → 1.5.22

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
  SHA256:
3
- metadata.gz: c1e460504bc5d274e82021dacfcd7065ff46b65ca747956a0809d734e0985d8f
4
- data.tar.gz: 938bfce127bc20430c4543bb6fefda1b5ae203563ae8234950724578f57c1015
3
+ metadata.gz: 659ab6668b76e08f2df9bdad69f510b72af0a3c84c911a181accdc0cbfdedb18
4
+ data.tar.gz: 828fee99088355562ba0cd0607909759be93bb6ef834fcd8d0225391aa405509
5
5
  SHA512:
6
- metadata.gz: 6964d3d2d9e1108b8513aabb6011501b5db2ee0eebe85e7ef4e253e952b81acfbd89148ba496524fffed5f1e790d2f6e3455a79e8e82cf75f0590d8021290dae
7
- data.tar.gz: 5238ece91784b8962584eab1d057943b7f3d1dc23814bdfa3fc8622e040b76ad69dec80484b4917dd1f2fb61847d30325df284067b573a57f659927cc7d0b108
6
+ metadata.gz: d2e976214a79a78ada20daa29b1e76b5e755e7ed6e90ea47075e42a2b652f39e87f3e25cbd060f59afcbdb8d3bc528cdd393aeef066bd222aeda8730e5218c60
7
+ data.tar.gz: 691b4025c6d27609d284fef5e947b290a549db505484d26fa16c4966acaf5983695b376b2be178818b2f380a32eb7cae328aa2f9a4030562e95a846733b5a23f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ci_toolkit (1.5.21)
4
+ ci_toolkit (1.5.22)
5
5
  faraday
6
6
  faraday-multipart
7
7
  faraday_middleware
@@ -45,10 +45,7 @@ module CiToolkit
45
45
  )
46
46
  # Application with unique name already exist. Replace it.
47
47
  elsif response.status == ERROR && !response.data.nil? && !response.data.uniqueName.nil?
48
- application_info_response = faraday_get_application_info(unique_name)
49
- application_id = application_info_response[0].id
50
- response = replace_existing_application(
51
- application_id,
48
+ response = replace_existing_application_by_unique_name(
52
49
  project_name,
53
50
  unique_name,
54
51
  full_path_to_file,
@@ -83,6 +80,17 @@ module CiToolkit
83
80
  response
84
81
  end
85
82
 
83
+ def replace_existing_application_by_unique_name(project_name, unique_name, full_path_to_file, content_type)
84
+ application_info_response = faraday_get_application_info(unique_name)
85
+ application_info_response.each do |app_response|
86
+ next unless app_response.uniqueName == unique_name
87
+
88
+ response = replace_existing_application(app_response.id, project_name, unique_name, full_path_to_file,
89
+ content_type)
90
+ return response if response.status == SUCCESS
91
+ end
92
+ end
93
+
86
94
  def faraday_upload_file_with_error_handling(
87
95
  project_name,
88
96
  unique_name,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.21
4
+ version: 1.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gero Keller
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-18 00:00:00.000000000 Z
11
+ date: 2023-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday