add live reload
http://blog.55minutes.com/2013/01/lightning-fast-sass-reloading-in-rails-32/
This commit is contained in:
parent
37ae82bd05
commit
b5f3d35a94
3 changed files with 24 additions and 0 deletions
6
Gemfile
6
Gemfile
|
@ -85,6 +85,12 @@ group :development, :test do
|
|||
# rest client lib for unit tests
|
||||
gem 'faraday'
|
||||
|
||||
# livereload on template changes (html, js, css)
|
||||
gem 'guard', '>= 2.2.2', :require => false
|
||||
gem 'guard-livereload', :require => false
|
||||
gem 'rack-livereload'
|
||||
gem 'rb-fsevent', :require => false
|
||||
|
||||
# websocket unit tests
|
||||
# gem 'em-websocket-client'
|
||||
end
|
||||
|
|
11
Guardfile
Normal file
11
Guardfile
Normal file
|
@ -0,0 +1,11 @@
|
|||
# A sample Guardfile
|
||||
# More info at https://github.com/guard/guard#readme
|
||||
|
||||
guard 'livereload' do
|
||||
watch(%r{app/views/.+\.(erb|haml|slim)$})
|
||||
watch(%r{app/helpers/.+\.rb})
|
||||
watch(%r{public/.+\.(css|js|html)})
|
||||
watch(%r{config/locales/.+\.yml})
|
||||
# Rails Assets Pipeline
|
||||
watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" }
|
||||
end
|
|
@ -30,4 +30,11 @@ Zammad::Application.configure do
|
|||
# Expands the lines which load the assets
|
||||
config.assets.debug = true
|
||||
|
||||
# Automatically inject JavaScript needed for LiveReload
|
||||
config.middleware.use(Rack::LiveReload,
|
||||
:min_delay => 500, # default 1000
|
||||
:max_delay => 10_000, # default 60_000
|
||||
:live_reload_port => 67789, # default 35729
|
||||
:source => :vendored
|
||||
)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue