0.0
No commit activity in last 3 years
No release in over 3 years
rack-weinre inserts a script tag that loads a weinre target js into html files.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.1.2
~> 2.9.0
 Project Readme

rack-weinre

rack-weinre is a rack middleware, which inserts a script tag that loads weinre target script file into your text/html pages.

Setup

First, add to your Gemfile:

gem 'rack-weinre'

then bundle as usual.

with Rails

in config/environments/development.rb:

MyApp::Application.configure do
  ...
  config.middleware.use 'Rack::Weinre'
end

with config.ru

use Rack::Weinre

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:

<script src="http://localhost:8080/target/target-script-min.js#anonymous"></script>

but the host name depends on to which host the request was made.

Options

port

you may use a port number other than 8080, say, 9090. :port option will come in handy then.

use Rack::Weinre, :port => 9090

Toggle tag

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

Copyright © 2012 Hiroki Yoshioka. See MIT-LICENSE for further details.