0.0
No commit activity in last 3 years
No release in over 3 years
Rails-compatible helpers for setting the heap.js snippet
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0
>= 0.8.10
>= 2.0.1
>= 5.8.4
>= 3.12
>= 0.11.2
>= 0.8.7.6

Runtime

~> 1.0
 Project Readme

Heap Helpers for Ruby

Build Status Coverage Status Dependency Status Yard Docs Gem Version

This Ruby gem contains helpers for embedding the heap.js snippet used to instal Heap on a site.

Prerequisites

This gem is tested on Ruby 1.8.7 and above, and is expected to work with Rails 2.3.8 and above. The gem depends on the official heap gem.

Installation

If you're using bundler, add the following line to your Gemfile.

gem 'heap-helpers'

Otherwise, install the heap-helpers gem and activate it in your code manually.

gem install heap
require 'heap-helpers'

Setup

Follow the instructions for the heap gem.

Usage

Add the following in your layouts or views, before the closing </head> tag. In a typical Ruby on Rails application, this change would go into app/views/layouts/application.html.erb.

<%= Heap.javascript_tag %>

The helper supports advanced heap.js options.

<%= Heap.javascript_tag force_ssl: true %>

You can also specify advanced options in the initialization code. This is especially useful if you're using the same helper in multiple places in your code.

Heap.app_id = 'YOUR_APP_ID'
Heap.js_options = { force_ssl: true }

Copyright

Copyright (c) 2016 Victor Costan, released under the MIT license.