Wednesday 4 April 2012

**** Autoreloader ****

In App dir path:

1. Gemfile:
group :development do
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
gem 'guard'
gem 'growl'
gem 'guard-livereload'
end


2.terminal:
init and start the server
1.guard init livereload
2.guard

msRoot:guard
WARNING: You are using Guard outside of Bundler, this is dangerous and may not work. Using `bundle exec guard` is safer.
Guard uses Growl to send notifications.
Guard is now watching at '/Users/ioannis/Development/video_app'
LiveReload 1.6 is waiting for a browser to connect.
Browser connected.
Browser URL: http://localhost:3030/




3.add js to your page
https://github.com/livereload/livereload-js
or copy to public dir
http://localhost:3030/livereload.js"


5.Add plugin to Safari
https://github.com/mockko/livereload/blob/master/README-old.md

4. Right click
"ENABLE REALOADJS everytime u refesh the page maualy

Boom! My dreams comes true. No more refresh




note: It doent work in firefox

EDIT:
realo all files in App



guard 'livereload' do
  # Realod everything in App
  watch(%r{app/*})
 
  # 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)).*})  { |m| "/assets/#{m[2]}" }
end

No comments:

Post a Comment