GithubHelp home page GithubHelp logo

isabella232 / guard-autorefresh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from guard/guard-autorefresh

0.0 0.0 0.0 80 KB

automatically reload your browser when 'view' files are modified

Home Page: https://github.com/21croissants/guard-autorefresh

License: MIT License

guard-autorefresh's Introduction

Guard::Autorefresh

Autorefresh guard allows to automatically reload your browser when ‘view’ files are modified.

It is using logankoester / autorefresh to do its job.

No need for a browser extension, it just works.

I wrote it in 3 pomodori as I could not make guard-livereload work on my machine and I did not want to bother installing an extension.

Install

Please be sure to have Guard installed before continue.

Install the gem:

gem install guard-autorefresh

Add it to your Gemfile (inside development group):

gem 'guard-autorefresh'

Add guard definition to your Guardfile by running this command:

guard init autorefresh

Add autorefresh socket setup to your layout files:

<head>
    <%= AutoRefresh.channel('my_awesome_app') if Rails.env.development? %>
</head>

Do not rename ‘my_awesome_app’, your app must be awesome and it is hardcoded inside the library.

Usage

Please read Guard usage doc

Guardfile

You can adapt your ‘view’ files like you want. Please read Guard doc for more info about Guardfile DSL.

guard 'autorefresh' do
  watch(%r{app/.+\.(erb|haml)})
  watch(%r{app/helpers/.+\.rb})
  watch(%r{(public/|app/assets).+\.(css|js|html)})
  watch(%r{(app/assets/.+\.css)\.scss}) { |m| m[1] }
  watch(%r{(app/assets/.+\.js)\.coffee}) { |m| m[1] }
  watch(%r{config/locales/.+\.yml})
end

Development

Pull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change you make.

TODO

  • autorefresh has a dependency on watchr :(

  • travis CI ;)

Authors

Jean-Michel Garnier

guard-autorefresh's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.