zendesk_apps_tools 2.4.0 → 2.5.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: c9671e253af31f401823ee8fbe0ca6b9aed32b1c
4
- data.tar.gz: ba2aa8edc896d0d1f3d22e5da360ea2e569dd94d
3
+ metadata.gz: 1759ec280d16f7db3c51feacbd9f69f295186e4e
4
+ data.tar.gz: ec4ee0de225fdb1ba80d8365beb0cb5a33244e05
5
5
  SHA512:
6
- metadata.gz: 869b048a92f9721b689030c45ec5f5b355cb7640a8d16c738d28664c600a6c52e039008bf26e11db2247af3879e0b5729e41173e09642f903861fcb88d58ba36
7
- data.tar.gz: 988d22c6814670f837304c52365a7a07f67fd08d536ad5d2f57ce306a94fd8abb67ff708d6041085ba5afbec57223d4b936e47835cbad088a12cf68d4fb8f4e6
6
+ metadata.gz: a39f8cbfd6551ed3f5f5e6697e939c10411f91a31d4a0b13cda0bcfe808ccabf6934577eb5e2a58029baacc649fd540696d9c8d432488afa2a951f07ba9b8176
7
+ data.tar.gz: 77000f5bbb1a974133c70acf6960eb0fd03d392e2dcc9a958ded36bd4b63acea0879dfe344c0100cf473d223868a1709aeaf1e261a13f83479067fc053684aae
@@ -194,6 +194,28 @@ module ZendeskAppsTools
194
194
  deploy_app(:put, "/api/v2/apps/#{app_id}.json", {})
195
195
  end
196
196
 
197
+ desc 'migrate', 'Helps with the migration of a v1 app to v2'
198
+ shared_options(except: [:unattended, :clean])
199
+ method_option %s(replace-v1), default: false, required: false, type: :boolean, aliases: '-r'
200
+ method_option :auto, default: false, required: false, type: :boolean, aliases: '-a'
201
+ def migrate
202
+ cache.clear
203
+ setup_path(options[:path])
204
+ @command = 'Migrate'
205
+ say_error_and_exit("Node.js and NPM are required to use the Zendesk App Migration Helper \
206
+ Please see installation instructions at https://nodejs.org/en/download/") unless package_installed('npm')
207
+ unless package_installed('app_migrator')
208
+ try_install = get_value_from_stdin("The Zendesk App Migration Helper isn't installed yet. Would you like to try installing now?", limited_to: ['y', 'yes', 'n', 'no'], default: 'y' )
209
+ say_error_and_exit("Please install the Zendesk App Migration Helper before running this command") if (try_install =~ /^y(es)?$/).nil? # thats a no
210
+ install_migration_helper
211
+ say_error_and_exit("Unable to install the Zendesk App Migration Helper \
212
+ Please follow the installation instructions at \
213
+ https://github.com/zendesk/zendesk_app_migrator \
214
+ before running this command again") unless package_installed('app_migrator')
215
+ end
216
+ migrate_app(options)
217
+ end
218
+
197
219
  desc "version, -v", "Print the version"
198
220
  def version
199
221
  say ZendeskAppsTools::VERSION
@@ -201,6 +223,21 @@ module ZendeskAppsTools
201
223
 
202
224
  protected
203
225
 
226
+ def package_installed(package_name)
227
+ !!system(package_name, "--version", out: File::NULL)
228
+ end
229
+
230
+ def install_migration_helper
231
+ system("npm install -g zendesk_app_migrator", out: File::NULL)
232
+ end
233
+
234
+ def migrate_app(options = {})
235
+ cmds = ["app_migrator", "migrate", "--path=#{options[:path]}"]
236
+ cmds << "--replace-v1" if options[:"replace-v1"]
237
+ cmds << "--auto" if options[:auto]
238
+ system(*cmds)
239
+ end
240
+
204
241
  def product_names(manifest)
205
242
  product_codes(manifest).collect{ |code| ZendeskAppsSupport::Product.find_by( code: code ) }.collect(&:name)
206
243
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ZendeskAppsTools
3
- VERSION = '2.4.0'
3
+ VERSION = '2.5.0'
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.4.0
4
+ version: 2.5.0
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: 2017-09-26 00:00:00.000000000 Z
14
+ date: 2017-10-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -103,14 +103,14 @@ dependencies:
103
103
  requirements:
104
104
  - - "~>"
105
105
  - !ruby/object:Gem::Version
106
- version: 4.2.0
106
+ version: 4.4.2
107
107
  type: :runtime
108
108
  prerelease: false
109
109
  version_requirements: !ruby/object:Gem::Requirement
110
110
  requirements:
111
111
  - - "~>"
112
112
  - !ruby/object:Gem::Version
113
- version: 4.2.0
113
+ version: 4.4.2
114
114
  - !ruby/object:Gem::Dependency
115
115
  name: sinatra-cross_origin
116
116
  requirement: !ruby/object:Gem::Requirement
@@ -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.6.13
324
+ rubygems_version: 2.6.11
325
325
  signing_key:
326
326
  specification_version: 4
327
327
  summary: Tools to help you develop Zendesk Apps.
@@ -336,4 +336,3 @@ test_files:
336
336
  - features/support/helpers.rb
337
337
  - features/support/webmock.rb
338
338
  - features/validate.feature
339
- has_rdoc: