Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Support schemeless URL for Google CDN.

  • Loading branch information...
commit 220761c088fc7a6e34655a9ceecf54b5922c411f 1 parent 794025e
Kenn Ejima authored
15 README.md
Source Rendered
@@ -23,6 +23,11 @@ On top of that, if you're using asset pipeline, you may have noticed that the ma
23 23 * Updating your js code won't evict the entire cache in browsers - your code changes more often than jQuery upgrades, right?
24 24 * `rake assets:precompile` takes less peak memory usage.
25 25
  26 +Changelog:
  27 +
  28 +* v0.1.0: Added :google_schemeless for sites that support both ssl / non-ssl
  29 +* v0.0.1: Initial release
  30 +
26 31 ## Installation
27 32
28 33 Add this line to your application's Gemfile:
@@ -44,7 +49,15 @@ Then in layout:
44 49 = javascript_include_tag 'application'
45 50 ```
46 51
47   -Note that valid CDN symbols are `:google`, `:google_ssl`, `:microsoft` and `:jquery`.
  52 +Note that valid CDN symbols are:
  53 +
  54 +```ruby
  55 +:google
  56 +:google_ssl
  57 +:google_schemeless
  58 +:microsoft
  59 +:jquery
  60 +```
48 61
49 62 It will generate the following on production:
50 63
10 lib/jquery-rails-cdn.rb
@@ -3,12 +3,14 @@
3 3
4 4 module Jquery::Rails::Cdn
5 5 module ActionViewExtensions
  6 + JQUERY_VERSION = Jquery::Rails::JQUERY_VERSION
6 7 OFFLINE = (Rails.env.development? or Rails.env.test?)
7 8 URL = {
8   - :google => "http://ajax.googleapis.com/ajax/libs/jquery/#{Jquery::Rails::JQUERY_VERSION}/jquery.min.js",
9   - :google_ssl => "https://ajax.googleapis.com/ajax/libs/jquery/#{Jquery::Rails::JQUERY_VERSION}/jquery.min.js",
10   - :microsoft => "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-#{Jquery::Rails::JQUERY_VERSION}.min.js",
11   - :jquery => "http://code.jquery.com/jquery-#{Jquery::Rails::JQUERY_VERSION}.min.js"
  9 + :google => "http://ajax.googleapis.com/ajax/libs/jquery/#{JQUERY_VERSION}/jquery.min.js",
  10 + :google_ssl => "https://ajax.googleapis.com/ajax/libs/jquery/#{JQUERY_VERSION}/jquery.min.js",
  11 + :google_schemeless => "//ajax.googleapis.com/ajax/libs/jquery/#{JQUERY_VERSION}/jquery.min.js",
  12 + :microsoft => "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-#{JQUERY_VERSION}.min.js",
  13 + :jquery => "http://code.jquery.com/jquery-#{JQUERY_VERSION}.min.js"
12 14 }
13 15
14 16 def jquery_url(name, options = {})
2  lib/jquery-rails-cdn/version.rb
... ... @@ -1,7 +1,7 @@
1 1 module Jquery
2 2 module Rails
3 3 module Cdn
4   - VERSION = "0.0.1"
  4 + VERSION = "0.1.0"
5 5 end
6 6 end
7 7 end

0 comments on commit 220761c

Please sign in to comment.
Something went wrong with that request. Please try again.