Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
YUI integration with the Rails 3.1 Asset Pipeline
branch: master

This branch is 11 commits ahead, 32 commits behind nextmat:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
vendor/assets/javascripts
.gitignore
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
yui-rails.gemspec

README.md

YUI-rails

No-hassle integration of YUI with the Rails 3.1 asset pipeline.

Usage

This gem vendors the latest YUI 3 for easy use. Once installed, add YUI to your app by adding:

//= require yui

To your app/assets/javascripts/application.js.

You can use debug or pre-minimized versions by requiring yui-debug or yui-min.

Requirements

Rails 3.1 or greater.

Installation

Existing Rails project

Add the gem to your Gemfile:

gem 'yui-rails'

Update your gem bundle:

$ bundle install

New Rails project

You can use the --javascript flag with rails to specify your preferred library when creating a new rails project. For example:

rails new foo --javascript=yui

This will create a new project named 'foo' with yui-rails already installed.

TODO

Plans for improvement in no particular order:

  • Decide how much (all?) of YUI to vendor (with debug versions everything is ~15.5mb, seems awfully heavy)
  • Provide intelligent loader to mimic CDN's ability to load a group of dependencies on demand as a single file

Credits

Inspired by the jquery-rails gem by Steve Schwartz.

License

Copyright (c) 2011 Matt Sanders. Released under the MIT license. Copyright (c) 2012 Trader Analytics Corp. (Hong Kong) Limited. Released under the MIT license.

Something went wrong with that request. Please try again.