zendesk_apps_tools 2.9.4 → 2.9.5

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
- SHA1:
3
- metadata.gz: a8c2f458d08f9dede5b4775ccdc17ff072e3a50b
4
- data.tar.gz: 20c51fcb1cc8847ced610aa663c84b3dd4b1ea3d
2
+ SHA256:
3
+ metadata.gz: 434d24f23b9e07f418808149ea0c86c4241645be15a613dbddd86145c6789fd0
4
+ data.tar.gz: aad40dbfb893f8ab4e200fba2b056a669c2e7fb0cb3d96bbf72a97c59c1f21bc
5
5
  SHA512:
6
- metadata.gz: 5565db5aa8066339cb2dd9340d268af409bd5d9c40a62428d3645f5a1d3ca865386d4391a34acc5bd4307590f031cb655078bd9503a556092adeb8b8f9185875
7
- data.tar.gz: b2d6e14881700ea6dad32c8040c78bcae350d83cd343f2e252b6d0d0de42ce2cf88b6f23e7ca0584db6a0cb6e69dfaa0052ddf06eb90ae914f1660a4ac1eb67f
6
+ metadata.gz: 6092e39e119c703cc6d70eb1071c91d3d26440ae2c2f0dd41f0ec863e20331a01995d793b6a017f8fa7b370e019e115f41848182757535acdfe3abb00a7663fb
7
+ data.tar.gz: d5b5a41c243fb84199b3a80c23b5c53982c65b49b8477c0a6e30d3a9a7474ce922481af4fc2b36592c32f3cd19acce0f18443c2ea4a0f1fefe3f1c7e07a32044
@@ -191,10 +191,12 @@ module ZendeskAppsTools
191
191
  @command = 'Update'
192
192
 
193
193
  app_id = cache.fetch('app_id') || find_app_id
194
- unless /\d+/ =~ app_id.to_s
194
+ app_url = "/api/v2/apps/#{app_id}.json"
195
+ unless /\d+/ =~ app_id.to_s && app_exists?(app_id)
195
196
  say_error_and_exit "App id not found\nPlease try running command with --clean or check your internet connection"
196
197
  end
197
- deploy_app(:put, "/api/v2/apps/#{app_id}.json", {})
198
+
199
+ deploy_app(:put, app_url, {})
198
200
  end
199
201
 
200
202
  desc 'migrate', 'Helps with the migration of a v1 app to v2'
@@ -17,6 +17,16 @@ module ZendeskAppsTools
17
17
  say_error_and_exit e.message
18
18
  end
19
19
 
20
+ def app_exists?(app_id)
21
+ url = "/api/v2/apps/#{app_id}.json"
22
+ connection = get_connection
23
+ response = connection.send(:get) do |req|
24
+ req.url url
25
+ end
26
+
27
+ %w(200 201 202).include? response.status.to_s
28
+ end
29
+
20
30
  def install_app(poll_job, product_name, installation)
21
31
  connection = get_connection
22
32
  response = connection.post do |req|
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ZendeskAppsTools
3
- VERSION = '2.9.4'
3
+ VERSION = '2.9.5'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_apps_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.4
4
+ version: 2.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - James A. Rosen
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-06-18 00:00:00.000000000 Z
14
+ date: 2018-06-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -321,7 +321,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  version: 1.3.6
322
322
  requirements: []
323
323
  rubyforge_project:
324
- rubygems_version: 2.5.2
324
+ rubygems_version: 2.7.3
325
325
  signing_key:
326
326
  specification_version: 4
327
327
  summary: Tools to help you develop Zendesk Apps.