From 08a372cb75548b73ee41451b0e695c90d04c4ceb Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 29 Sep 2015 13:50:28 +0200 Subject: [PATCH] update livereload settings --- Gemfile | 6 +++--- Gemfile.lock | 3 --- Guardfile | 8 +++++--- config/environments/development.rb | 10 ++++------ 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Gemfile b/Gemfile index 999424f09..ed0d2ebb3 100644 --- a/Gemfile +++ b/Gemfile @@ -78,10 +78,10 @@ group :development, :test do gem 'selenium-webdriver' # livereload on template changes (html, js, css) - gem 'guard', '>= 2.2.2', require: false - gem 'guard-livereload', require: false + gem 'guard', '>= 2.2.2', :require => false + gem 'guard-livereload', :require => false gem 'rack-livereload' - gem 'rb-fsevent', require: false + gem 'rb-fsevent', :require => false # code QA gem 'rubocop' diff --git a/Gemfile.lock b/Gemfile.lock index 93b3a5cd5..51cdaa3eb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -340,6 +340,3 @@ DEPENDENCIES twitter (~> 5.13.0) uglifier writeexcel - -BUNDLED WITH - 1.10.5 diff --git a/Guardfile b/Guardfile index 1ff367bc1..d4854e991 100644 --- a/Guardfile +++ b/Guardfile @@ -1,11 +1,13 @@ # A sample Guardfile # More info at https://github.com/guard/guard#readme -guard 'livereload', port: '35738' do +guard :livereload, :port => "35738" do watch(%r{app/views/.+\.(erb|haml|slim)$}) watch(%r{app/helpers/.+\.rb}) - watch(%r{public/.+\.(css|js|html|svg)}) + 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|svg))).*}) { |m| "/assets/#{m[3]}" } + watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" } + watch(%r{(app|vendor)(/assets/\w+/(.+)\.(scss))}) { |m| "/assets/#{m[3]}.css" } + watch(%r{(app|vendor)(/assets/\w+/(.+)\.(svg))}) { |m| "/assets/#{m[3]}.svg" } end diff --git a/config/environments/development.rb b/config/environments/development.rb index 579372943..bf3dae130 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -32,12 +32,10 @@ Rails.application.configure do config.assets.debug = false # 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: 35_738, - source: :vendored + config.middleware.insert_after(ActionDispatch::Static, Rack::LiveReload, + :min_delay => 500, # default 1000 + :max_delay => 10_000, # default 60_000 + :live_reload_port => 35738 ) # Asset digests allow you to set far-future HTTP expiration dates on all assets,