From d0f905f0a7e4518d80ef65fb3691dc17ed8caf4f Mon Sep 17 00:00:00 2001 From: Steven Sauther <> Date: Wed, 12 Jun 2019 12:18:38 -0700 Subject: [PATCH 1/2] Allow port to be set in the asset tags for theme previews. --- lib/zendesk_apps_tools/theme.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/zendesk_apps_tools/theme.rb b/lib/zendesk_apps_tools/theme.rb index 4100ab53..f1be77f3 100644 --- a/lib/zendesk_apps_tools/theme.rb +++ b/lib/zendesk_apps_tools/theme.rb @@ -102,17 +102,17 @@ def generate_payload def inject_external_tags(head_template) live_reload_script_tag = <<-html - + html js_tag = <<-html - + html css_tag = <<-html - + html template = StringIO.new From 68943cefe0bf6f7ae4aeb672809dec8fd345c3fa Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 25 Feb 2020 07:25:35 -0800 Subject: [PATCH 2/2] Updated references from the static port to the options hash. --- lib/zendesk_apps_tools/theme.rb | 2 +- lib/zendesk_apps_tools/theming/common.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/zendesk_apps_tools/theme.rb b/lib/zendesk_apps_tools/theme.rb index f1be77f3..36ad2733 100644 --- a/lib/zendesk_apps_tools/theme.rb +++ b/lib/zendesk_apps_tools/theme.rb @@ -141,7 +141,7 @@ def start_server(callbacks_after_upload) server.set :livereload, options[:livereload] server.set :callbacks_after_load, callbacks_after_upload server.set :callback_map, {} - server.use Rack::LiveReload, live_reload_port: 4567 if options[:livereload] + server.use Rack::LiveReload, live_reload_port: options[:port] if options[:livereload] server.run! end end diff --git a/lib/zendesk_apps_tools/theming/common.rb b/lib/zendesk_apps_tools/theming/common.rb index ed1d5538..0d39cf5c 100644 --- a/lib/zendesk_apps_tools/theming/common.rb +++ b/lib/zendesk_apps_tools/theming/common.rb @@ -9,7 +9,7 @@ def url_for(package_file) relative_path = relative_path_for(package_file) path_parts = recursive_pathname_split(relative_path) path_parts.shift - "http://localhost:4567/guide/#{path_parts.join('/')}" + "http://localhost:#{options[:port]}/guide/#{path_parts.join('/')}" end def relative_path_for(filename)