zendesk_apps_tools 2.1.1 → 2.2.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: da30795684a3afadcb02afa5ec6674dad6b920f0
4
- data.tar.gz: d918dac59b2d482b8025ab42b21653c3aff962b4
3
+ metadata.gz: 86a5bffe2b41f67024b894124a626b33cac4baf9
4
+ data.tar.gz: c395d5bc24133995f3924333aff18cee1328c86e
5
5
  SHA512:
6
- metadata.gz: 42d9a2ee4be1807eca51bf6558a8e0341760a5bf2452cb59d75b0bcfdda7ed9a69c1fc0f72c86e1c415cf68a92754d0d7802dee5b5c559c758e0aa092bd77fbd
7
- data.tar.gz: 32c37c63cd8e429ebee2171c63546ae9a72976f5d4e59f828c5a67e59bddd6c17264c2c65b5952e18a9dbe358db37b1865d65ee0f08df9efdf47158a64f2f080
6
+ metadata.gz: c3043aa89f53521955d90ad1d32e58814727807744a42f246fb99a8c18061c83bcddef905d8fff7fb409203b2612f1dea91b0b726893a2a02d0216ea74b1555d
7
+ data.tar.gz: 841946d2c7b3537aa56da22a87767212960673f5fa633089aefcdf8c2e0381ef2eb460ee2a18a90a8317541c594ef779ba8bf218c48821adf4df07cc654807f8
@@ -5,6 +5,7 @@ Feature: upload an app to the apps marketplace
5
5
  Given an app is created in directory "tmp/aruba"
6
6
  Given a .zat file in "tmp/aruba"
7
7
  When I run the command "zat create --path tmp/aruba --no-install" to create the app
8
+ And the command output should contain "info Checking for new version of zendesk_apps_tools"
8
9
  And the command output should contain "validate OK"
9
10
  And the command output should contain "package created"
10
11
  And the command output should contain "Status working"
@@ -8,6 +8,7 @@ unless defined?(Cucumber)
8
8
  WebMock::API.stub_request(:post, 'https://app-account.zendesk.com/api/v2/apps/uploads.json').to_return(body: JSON.dump(id: '123'))
9
9
  WebMock::API.stub_request(:post, 'https://app-account.zendesk.com/api/apps.json').with(body: JSON.dump(name: 'John Test App', upload_id: '123')).to_return(body: JSON.dump(job_id: '987'))
10
10
  WebMock::API.stub_request(:get, 'https://app-account.zendesk.com/api/v2/apps/job_statuses/987').to_return(body: JSON.dump(status: 'working')).then.to_return(body: JSON.dump(status: 'completed', app_id: '55'))
11
+ WebMock::API.stub_request(:get, 'https://rubygems.org/api/v1/gems/zendesk_apps_tools.json').to_return(body: JSON.dump(status: 'working')).then.to_return(body: JSON.dump(name: 'zendesk_apps_tools', version: '2.1.1'))
11
12
 
12
13
  WebMock.enable!
13
14
  WebMock.disable_net_connect!
@@ -63,6 +63,7 @@ module ZendeskAppsTools
63
63
  desc 'validate', 'Validate your app'
64
64
  shared_options(except: [:unattended])
65
65
  def validate
66
+ check_for_update
66
67
  setup_path(options[:path])
67
68
  begin
68
69
  errors = app_package.validate(marketplace: false)
@@ -201,7 +202,7 @@ module ZendeskAppsTools
201
202
  end
202
203
 
203
204
  def product_codes(manifest)
204
- manifest.location_options.collect{ |option| option.location.product_code }
205
+ manifest.location_options.collect{ |option| option.location.product_code }
205
206
  end
206
207
 
207
208
  def setup_path(path)
@@ -234,5 +235,26 @@ module ZendeskAppsTools
234
235
  say_status 'warning', message, :yellow
235
236
  end
236
237
  end
238
+
239
+ def check_for_update
240
+ begin
241
+ require 'net/http'
242
+
243
+ return unless (cache.fetch "zat_update_check").nil? || Date.parse(cache.fetch "zat_update_check") < Date.today - 7
244
+
245
+ say_status 'info', 'Checking for new version of zendesk_apps_tools'
246
+ response = Net::HTTP.get_response(URI('https://rubygems.org/api/v1/gems/zendesk_apps_tools.json'))
247
+
248
+ latest_version = Gem::Version.new(JSON.parse(response.body)["version"])
249
+ current_version = Gem::Version.new(ZendeskAppsTools::VERSION)
250
+
251
+ cache.save 'zat_latest' => latest_version
252
+ cache.save 'zat_update_check' => Date.today
253
+
254
+ say_status 'warning', 'Your version of Zendesk Apps Tools is outdated. Update by running: gem update zendesk_apps_tools', :yellow if current_version < latest_version
255
+ rescue SocketError
256
+ say_status 'warning', 'Unable to check for new versions of zendesk_apps_tools gem', :yellow
257
+ end
258
+ end
237
259
  end
238
260
  end
@@ -7,7 +7,11 @@ module ZendeskAppsTools
7
7
  end
8
8
 
9
9
  def manifest
10
- @manifest ||= app_package.manifest
10
+ begin
11
+ @manifest ||= app_package.manifest
12
+ rescue
13
+ say_status "error", "Manifest file cannot be found in the given path. Check you are pointing to the path that contains your manifest.json", :red and exit 1
14
+ end
11
15
  end
12
16
 
13
17
  def zip(archive_path)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ZendeskAppsTools
3
- VERSION = '2.1.1'
3
+ VERSION = '2.2.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.1.1
4
+ version: 2.2.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-07-31 00:00:00.000000000 Z
14
+ date: 2017-08-18 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -75,14 +75,14 @@ dependencies:
75
75
  requirements:
76
76
  - - "~>"
77
77
  - !ruby/object:Gem::Version
78
- version: 3.4.4
78
+ version: 3.5.0
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - "~>"
84
84
  - !ruby/object:Gem::Version
85
- version: 3.4.4
85
+ version: 3.5.0
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: sinatra-cross_origin
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: 1.3.6
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.4.5.1
250
+ rubygems_version: 2.6.8
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Tools to help you develop Zendesk Apps.