jquery-rails-cdn 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +11 -17
- data/lib/jquery-rails-cdn.rb +2 -1
- data/lib/jquery-rails-cdn/version.rb +1 -1
- metadata +10 -19
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8b3dbd0aad54f56177a8a5e9d6070a93c79c3d87
|
4
|
+
data.tar.gz: 5bd758410e11bccbf8f3cf533f2a851e48bcf3fc
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: a8848d85c5f20df537eda69d18dd2610d7d8bbb75c80eae4839e228ad4a6721747927dc247ed91ef39216bf245ae1729507404932a7c53c5a1667e18547d1e75
|
7
|
+
data.tar.gz: 7bcc2663fe991611e0253acad54a41af53236677316871001ca557f493963474e9fec8c64c9377385a74b88245b1e01a00afbea7576d4b889d61f8bfffc4a3de
|
data/README.md
CHANGED
@@ -43,27 +43,27 @@ gem 'jquery-rails-cdn'
|
|
43
43
|
|
44
44
|
## Usage
|
45
45
|
|
46
|
-
This gem adds two methods `jquery_include_tag`
|
46
|
+
This gem adds two methods `jquery_include_tag` and `jquery_url`.
|
47
47
|
|
48
|
-
If you're using asset pipeline with Rails 3.1+,
|
48
|
+
If you're using asset pipeline with Rails 3.1+,
|
49
49
|
|
50
|
-
|
50
|
+
- Remove `//= require jquery` from `application.js`.
|
51
|
+
- Put the following line in `config/application.rb`, so that jquery.js will be served from your server when CDN is not available.
|
51
52
|
|
52
53
|
```ruby
|
53
|
-
|
54
|
-
= javascript_include_tag 'application'
|
54
|
+
config.assets.precompile += ['jquery.js']
|
55
55
|
```
|
56
56
|
|
57
|
-
|
57
|
+
Then in layout:
|
58
58
|
|
59
59
|
```ruby
|
60
|
-
:google
|
61
|
-
|
62
|
-
:jquery
|
63
|
-
:yandex
|
60
|
+
= jquery_include_tag :google
|
61
|
+
= javascript_include_tag 'application'
|
64
62
|
```
|
65
63
|
|
66
|
-
|
64
|
+
Note that valid CDN symbols are `:google`, `:microsoft`, `:jquery`, `:cloudflare` and `:yandex`.
|
65
|
+
|
66
|
+
Now, it will generate the following on production:
|
67
67
|
|
68
68
|
```html
|
69
69
|
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
|
@@ -80,12 +80,6 @@ on development:
|
|
80
80
|
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
|
81
81
|
```
|
82
82
|
|
83
|
-
Be sure to put the following line in `config/application.rb`, as it will be served when CDN is not available.
|
84
|
-
|
85
|
-
```ruby
|
86
|
-
config.assets.precompile += ['jquery.js']
|
87
|
-
```
|
88
|
-
|
89
83
|
If you want to check the production URL, you can pass `:force => true` as an option.
|
90
84
|
|
91
85
|
```ruby
|
data/lib/jquery-rails-cdn.rb
CHANGED
@@ -9,7 +9,8 @@ module Jquery::Rails::Cdn
|
|
9
9
|
:google => "//ajax.googleapis.com/ajax/libs/jquery/#{JQUERY_VERSION}/jquery.min.js",
|
10
10
|
:microsoft => "//ajax.aspnetcdn.com/ajax/jQuery/jquery-#{JQUERY_VERSION}.min.js",
|
11
11
|
:jquery => "http://code.jquery.com/jquery-#{JQUERY_VERSION}.min.js",
|
12
|
-
:yandex => "//yandex.st/jquery/#{JQUERY_VERSION}/jquery.min.js"
|
12
|
+
:yandex => "//yandex.st/jquery/#{JQUERY_VERSION}/jquery.min.js",
|
13
|
+
:cloudflare => "//cdnjs.cloudflare.com/ajax/libs/jquery/#{JQUERY_VERSION}/jquery.min.js"
|
13
14
|
}
|
14
15
|
|
15
16
|
def jquery_url(name, options = {})
|
metadata
CHANGED
@@ -1,30 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery-rails-cdn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.4.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kenn Ejima
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2013-03-22 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: jquery-rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
description: Add CDN support to jquery-rails
|
@@ -44,32 +41,26 @@ files:
|
|
44
41
|
- lib/jquery-rails-cdn/version.rb
|
45
42
|
homepage: https://github.com/kenn/jquery-rails-cdn
|
46
43
|
licenses: []
|
44
|
+
metadata: {}
|
47
45
|
post_install_message:
|
48
46
|
rdoc_options: []
|
49
47
|
require_paths:
|
50
48
|
- lib
|
51
49
|
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
-
none: false
|
53
50
|
requirements:
|
54
|
-
- -
|
51
|
+
- - '>='
|
55
52
|
- !ruby/object:Gem::Version
|
56
53
|
version: '0'
|
57
|
-
segments:
|
58
|
-
- 0
|
59
|
-
hash: -221945476204649298
|
60
54
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
55
|
requirements:
|
63
|
-
- -
|
56
|
+
- - '>='
|
64
57
|
- !ruby/object:Gem::Version
|
65
58
|
version: '0'
|
66
|
-
segments:
|
67
|
-
- 0
|
68
|
-
hash: -221945476204649298
|
69
59
|
requirements: []
|
70
60
|
rubyforge_project:
|
71
|
-
rubygems_version:
|
61
|
+
rubygems_version: 2.0.3
|
72
62
|
signing_key:
|
73
|
-
specification_version:
|
63
|
+
specification_version: 4
|
74
64
|
summary: Add CDN support to jquery-rails
|
75
65
|
test_files: []
|
66
|
+
has_rdoc:
|