Project

durl-rails

0.0
No commit activity in last 3 years
No release in over 3 years
This gem provides dURL for your Rails 3+ application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

< 5.0, >= 3.0
< 2.0, >= 0.14
 Project Readme

durl-rails

dURL! For Rails!

This gem provides:

  • dURL

See VERSIONS.md to see which versions of durl-rails bundle which versions of dURL.

Versions

patch version bump = updates to durl-rails, and patch-level updates to dURL
minor version bump = minor-level updates to dURL
major version bump = major-level updates to dURL and updates to rails which may be backwards-incompatible

Installation

Gemfile

gem "durl-rails"

And run bundle install. The rest of the installation depends on whether the asset pipeline is being used.

Rails 3.1 or greater (with asset pipeline enabled)

The dURL files will be added to the asset pipeline and available for you to use. add these lines to app/assets/javascripts/application.js:

//= require durl

Rails 3.0 (or greater with asset pipeline disabled)

This gem adds a single generator: durl:install. Running the generator will copy dURL to the public/javascripts directory.

This gem will also hook into the Rails configuration process, adding dURL to the javascript files included by the javascript_include_tag(:defaults) call. While this gem contains the minified and un-minified versions of dURL, only the minified versions will be included in the :defaults when Rails is run in production or test mode (un-minified versions will be included when Rails is run in development mode).

To invoke the generator, run:

rails generate durl:install

You're done!

Contributing

If the NPM DURL library changes, run rake update_durl and commit. It will pull from source the latest version of DURL and will also bump the version of this gem.

Acknowledgements

This gem's structure and technique for wrapping a JS library into a rails friendly package is based entirely on jquery-rails. Many thanks are due to all of the jquery-rails contributors.

Copyright Tyler Kasten, released under the MIT License.