Middleman Weinre

A simple extension to start the Weinre server and a helper method to inject the script tag in your template/layout.

Requirements

Installation

Add this to your Middleman project's Gemfile

gem "middleman-weinre"

and run

$ bundle install

Usage

Activate the extension in your config.rb file:

activate :weinre

Config examples

activate :weinre,
  :hostname => "localhost",
  :port => 8080,
  :bin => "/usr/local/bin/weinre"

Template helpers

You can insert the Weinre javascript tag in your template or layout with

<%= weinre_include_tag %>

Options

:hostname (default: nil)

Hostname to inject if not using the default of "localhost"

:port (default: 8080)

The port to setup Weinre on when running the server and injecting the tag.

:bin (default: "/usr/local/bin/weinre")

THe local path to the weinre bin

ToDo

  • Auto inject script tag at end of layout