zendesk_apps_tools 2.0.2 → 2.0.3

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: c5a42403e98b8e00185bef65cc8674a60320e19e
4
- data.tar.gz: ae23f493f1e0d7b2aedac919ea6d882fe413308d
3
+ metadata.gz: 8fa17296fe2740b040ec387eba8e872e61a8e9cb
4
+ data.tar.gz: d340332d05f696a9da82b51a15775d5dd35c74a2
5
5
  SHA512:
6
- metadata.gz: 4912126d17c2e624a028c0e33c5253d98680b8da59834c32782673b70fdd7c40d5662c340534cc015fa41f98e260e196c7a71b1c25bd47c8242ab4234ba7a825
7
- data.tar.gz: d1c1ab758b6747b6883e99aa3e66151acfc7e97d994433e483bc9578f377f1f2b8b9c7cf5d70a60bc59dfb4ef1042b514c4bc5301880c5e7cd30402f5f8a6fbb
6
+ metadata.gz: a4f8735f33c0583de5f19fc344f9aaad771b80fc8dcf0b7dbdea4b225ca63832e46c3c6991e5641f0bf00071a91e5d7fb4067d4564e27222d44ed0f4bff0b60e
7
+ data.tar.gz: 83da607f342417be89efdca57a2cb1bbb3a5042ca91492724a49621681055d81d724c40a0e327e0a4da27dacfb6deaa070a8a9e628bc600c985a234a45098dd2
@@ -2,7 +2,7 @@
2
2
  <head>
3
3
  <meta charset="utf-8">
4
4
  <!-- http://garden.zendesk.com -->
5
- <link rel="stylesheet" href="https://assets.zendesk.com/apps/sdk-assets/css/0/zendesk_garden.css" type="text/css">
5
+ <link rel="stylesheet" href="https://assets.zendesk.com/apps/sdk-assets/css/1/zendesk_garden.css" type="text/css">
6
6
  </head>
7
7
  <body>
8
8
  <h2 class="u-gamma">Hello, World!</h2>
Binary file
@@ -130,6 +130,9 @@ module ZendeskAppsTools
130
130
  method_option :app_id, default: DEFAULT_APP_ID, required: false, type: :numeric
131
131
  method_option :bind, required: false
132
132
  def server
133
+ if app_package.has_file?('assets/app.js')
134
+ say 'Warning: creating assets/app.js causes zat server to behave badly.', :yellow
135
+ end
133
136
  setup_path(options[:path])
134
137
 
135
138
  require 'zendesk_apps_tools/server'
@@ -9,6 +9,12 @@ module ZendeskAppsTools
9
9
  ZENDESK_DOMAINS_REGEX = %r{^http(?:s)?://[a-z0-9-]+\.(?:zendesk|zopim|zd-(?:dev|master|staging))\.com$}
10
10
 
11
11
  get '/app.js' do
12
+ serve_installed_js
13
+ end
14
+
15
+ enable :cross_origin
16
+
17
+ def serve_installed_js
12
18
  access_control_allow_origin
13
19
  content_type 'text/javascript'
14
20
 
@@ -38,11 +44,16 @@ module ZendeskAppsTools
38
44
  ZendeskAppsSupport::Installed.new([app_js], [installation]).compile
39
45
  end
40
46
 
41
- enable :cross_origin
42
-
43
47
  def send_file(*args)
44
- access_control_allow_origin
45
- super(*args)
48
+ # does the request look like a request from the host product for the generated
49
+ # installed.js file? If so, send that. Otherwise send the static file in the
50
+ # app's public_folder (./assets).
51
+ if request.env['PATH_INFO'] == '/app.js' && params.key?('locale') && params.key?('subdomain')
52
+ serve_installed_js
53
+ else
54
+ access_control_allow_origin
55
+ super(*args)
56
+ end
46
57
  end
47
58
 
48
59
  def request_from_zendesk?
@@ -37,6 +37,11 @@ module ZendeskAppsTools
37
37
  en_yml = YAML.load_file("#{destination_root}/translations/en.yml")
38
38
  package = /^txt.apps.([^\.]+)/.match(en_yml['parts'][0]['translation']['key'])[1]
39
39
  translations = en_yml['parts'].map { |part| part['translation'] }
40
+ translations.select! do |translation|
41
+ obsolete = translation['obsolete']
42
+ next true unless obsolete
43
+ Date.parse(obsolete.to_s) > Date.today
44
+ end
40
45
  en_hash = array_to_nested_hash(translations)['txt']['apps'][package]
41
46
  en_hash['app']['package'] = package
42
47
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ZendeskAppsTools
3
- VERSION = '2.0.2'
3
+ VERSION = '2.0.3'
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.0.2
4
+ version: 2.0.3
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-04-03 00:00:00.000000000 Z
14
+ date: 2017-06-15 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: thor
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  version: 1.3.6
257
257
  requirements: []
258
258
  rubyforge_project:
259
- rubygems_version: 2.6.11
259
+ rubygems_version: 2.6.12
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Tools to help you develop Zendesk Apps.