rack-weinre is a rack middleware, which inserts a script tag that loads weinre target script file into your text/html pages.
First, add to your Gemfile:
bundle as usual.
MyApp::Application.configure do ... config.middleware.use 'Rack::Weinre' end
How it works
Once enabled (see below), it inserts a
script tag just before the closing
head tag of your html pages. the tag is something like:
but the host name depends on to which host the request was made.
you may use a port number other than 8080, say, 9090.
:port option will come in handy then.
use Rack::Weinre, :port => 9090
if you give a
:switch option, it is considered as a file name in a relative path from the working rack application. in that case, rake-weinre is active only when the file exists at the exact path.
use Rack::Weinre, :switch => 'file' # inserts tag if the file exists (relative)
it is always active when no
:switch option is given.
Copyright © 2012 Hiroki Yoshioka. See MIT-LICENSE for further details.