Class: ShopifyCLI::Theme::DevServer::HotReload::RemoteFileReloader
- Inherits:
-
Object
- Object
- ShopifyCLI::Theme::DevServer::HotReload::RemoteFileReloader
- Defined in:
- lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb
Instance Method Summary collapse
-
#initialize(ctx, theme:, streams:) ⇒ RemoteFileReloader
constructor
A new instance of RemoteFileReloader.
- #reload(file) ⇒ Object
Constructor Details
#initialize(ctx, theme:, streams:) ⇒ RemoteFileReloader
Returns a new instance of RemoteFileReloader.
8 9 10 11 12 |
# File 'lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb', line 8 def initialize(ctx, theme:, streams:) @ctx = ctx @theme = theme @streams = streams end |
Instance Method Details
#reload(file) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb', line 14 def reload(file) retries = 6 until retries.zero? retries -= 1 _status, body = fetch_asset(file) retries = 0 if updated_file?(body, file) wait end notify(file) end |