-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #377 from wearefuturegov/docker-hot-reload
Add support for hotreload in docker - if you are using docker for development you may need to rebuild using the instructions in the README
- Loading branch information
Showing
8 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# A sample Guardfile | ||
# More info at https://github.com/guard/guard#readme | ||
|
||
## Uncomment and set this to only include directories you want to watch | ||
# directories %w(app lib config test spec features) \ | ||
# .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")} | ||
|
||
## Note: if you are using the `directories` clause above and you are not | ||
## watching the project directory ('.'), then you will want to move | ||
## the Guardfile to a watched dir and symlink it back, e.g. | ||
# | ||
# $ mkdir config | ||
# $ mv Guardfile config/ | ||
# $ ln -s config/Guardfile . | ||
# | ||
# and, you'll have to watch "config/Guardfile" instead of "Guardfile" | ||
|
||
guard 'livereload' do | ||
extensions = { | ||
css: :css, | ||
scss: :css, | ||
sass: :css, | ||
js: :js, | ||
coffee: :js, | ||
html: :html, | ||
png: :png, | ||
gif: :gif, | ||
jpg: :jpg, | ||
jpeg: :jpeg | ||
} | ||
|
||
rails_view_exts = %w[erb haml slim] | ||
|
||
# file types LiveReload may optimize refresh for | ||
compiled_exts = extensions.values.uniq | ||
watch(%r{public/.+\.(#{compiled_exts * '|'})}) | ||
|
||
extensions.each do |ext, type| | ||
watch(%r{ | ||
(?:app|vendor) | ||
(?:/assets/\w+/(?<path>[^.]+) # path+base without extension | ||
(?<ext>\.#{ext})) # matching extension (must be first encountered) | ||
(?:\.\w+|$) # other extensions | ||
}x) do |m| | ||
path = m[1] | ||
"/assets/#{path}.#{type}" | ||
end | ||
end | ||
|
||
# file needing a full reload of the page anyway | ||
watch(%r{app/views/.+\.(#{rails_view_exts * '|'})$}) | ||
watch(%r{app/helpers/.+\.rb}) | ||
watch(%r{config/locales/.+\.yml}) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
web: bundle exec rails s -b '0.0.0.0' | ||
guard: bundle exec guard -i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters