No commit activity in last 3 years
No release in over 3 years
Uses Facebook's "fb-flo" package to live-update JS code.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.6
~> 0
 Project Readme

batman-rails-flo

Gem Version

Live-reload your batman.js app with fb-flo.

Example

Features

  • Live reloading Models, Controllers and Views
  • Live reloading HTML templates
  • Live reloading CSS
  • Fires liveReload on MyApp so you can define custom handlers

Also, any class on MyApp can implement the class method liveReload(className, newCodeString), where:

  • className is the class that was reloaded
  • newCodeString is a bunch of JavaScript to be eval'd to load the new class.

Learn more in the wiki!

Installation

Get the fb-flo Chrome extension.

Add this line to your application's Gemfile:

gem 'batman-rails-flo'

And then execute:

$ bundle

Add the client code to your batman.js app's Sprockets manifest:

#= require batman/live_reload

Also, if your app isn't in the /assets/batman folder, you will need to set the pathToHTML variable here so that it knows where to find your views.

Batman.config.pathToHTML = '/assets/html'

Run the live-reload server

You'll need node.js. Execute:

$ bundle exec rake batman:live_reload

And re-connect with the fb-flo plugin if necessary

Known Issues

  • You have to reload after adding new files

Contributing

  1. Fork it ( https://github.com/[my-github-username]/batman-rails-flo/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request