rack-jquery_ui 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/CHANGES.md +8 -0
- data/README.md +2 -2
- data/lib/rack/jquery_ui.rb +9 -7
- data/lib/rack/jquery_ui/version.rb +1 -1
- data/rack-jquery_ui.gemspec +1 -1
- data/spec/rack_jquery_ui_spec.rb +2 -2
- metadata +2 -2
data/.gitignore
CHANGED
data/CHANGES.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# CH CH CHANGES #
|
2
2
|
|
3
|
+
## Friday the 19th of July 2013, v2.2.0 ##
|
4
|
+
|
5
|
+
* Made Media Temple the default CDN as Google (and Microsoft) have sided with the Elzebub, otherwise known as the NSA and GCHQ, and there's no need to make tracking people around the net easier for them.
|
6
|
+
* Updated the docs.
|
7
|
+
|
8
|
+
----
|
9
|
+
|
10
|
+
|
3
11
|
## Friday the 5th of July 2013 ##
|
4
12
|
|
5
13
|
### v2.1.1 ###
|
data/README.md
CHANGED
@@ -24,9 +24,9 @@ Have a look in the examples directory, but here's a snippet.
|
|
24
24
|
%head
|
25
25
|
= Rack::JQueryUI.cdn
|
26
26
|
|
27
|
-
Now you have the script tags to
|
27
|
+
Now you have the script tags to Media Temple's CDN in the head (you can also use Google or Microsoft, or Cloudflare, see the docs).
|
28
28
|
|
29
|
-
It also adds in a bit of javascript that will load in a locally kept version of jQuery, just incase the CDN is unreachable. The script will use the "/js/jquery-ui/1.10.
|
29
|
+
It also adds in a bit of javascript that will load in a locally kept version of jQuery, just incase the CDN is unreachable. The script will use the "/js/jquery-ui/1.10.3/jquery-ui.min.js" path (or, instead of 1.10.3, whatever is in {Rack::JQuery::VERSION}). You can change the "/js" bit if you like (see the docs).
|
30
30
|
|
31
31
|
That was easy.
|
32
32
|
|
data/lib/rack/jquery_ui.rb
CHANGED
@@ -18,14 +18,14 @@ module Rack
|
|
18
18
|
|
19
19
|
# Script tags for the Media Temple CDN
|
20
20
|
MEDIA_TEMPLE = "http://code.jquery.com/ui/#{JQUERY_UI_VERSION}/jquery-ui.js"
|
21
|
-
|
21
|
+
|
22
22
|
# Script tags for the Google CDN
|
23
23
|
GOOGLE = "//ajax.googleapis.com/ajax/libs/jqueryui/#{JQUERY_UI_VERSION}/jquery-ui.min.js"
|
24
|
-
|
24
|
+
|
25
25
|
# Script tags for the Microsoft CDN
|
26
26
|
MICROSOFT = "//ajax.aspnetcdn.com/ajax/jquery.ui/#{JQUERY_UI_VERSION}/jquery-ui.min.js"
|
27
|
-
|
28
|
-
|
27
|
+
|
28
|
+
|
29
29
|
# Script tags for the Cloudflare CDN
|
30
30
|
CLOUDFLARE = "//cdnjs.cloudflare.com/ajax/libs/jqueryui/#{JQUERY_UI_VERSION}/jquery-ui.min.js"
|
31
31
|
end
|
@@ -38,9 +38,9 @@ module Rack
|
|
38
38
|
STR
|
39
39
|
|
40
40
|
|
41
|
-
# @param [Symbol] organisation Choose which CDN to use, either :google, :microsoft or :media_temple
|
41
|
+
# @param [Symbol] organisation Choose which CDN to use, either :google, :microsoft or :media_temple, or :cloudflare
|
42
42
|
# @return [String] The HTML script tags to get the CDN.
|
43
|
-
def self.cdn( organisation=:
|
43
|
+
def self.cdn( organisation=:media_temple, options={} )
|
44
44
|
raise = (opt = options[:raise]).nil? ?
|
45
45
|
raise? :
|
46
46
|
opt
|
@@ -50,8 +50,10 @@ STR
|
|
50
50
|
CDNs::MICROSOFT
|
51
51
|
elsif organisation === :cloudflare
|
52
52
|
CDNs::CLOUDFLARE
|
53
|
-
|
53
|
+
elsif organisation === :google
|
54
54
|
CDNs::GOOGLE
|
55
|
+
else
|
56
|
+
CDNs::MEDIA_TEMPLE
|
55
57
|
end
|
56
58
|
"<script src='#{script}'></script>\n#{FALLBACK}"
|
57
59
|
end
|
data/rack-jquery_ui.gemspec
CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "https://github.com/yb66/rack-jquery_ui"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files`.split($/).reject{|x| x.start_with?("vendor") && !x.include?(Rack::JQueryUI::JQUERY_UI_VERSION) }
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
data/spec/rack_jquery_ui_spec.rb
CHANGED
@@ -8,7 +8,7 @@ describe "The class methods" do
|
|
8
8
|
context "Given an argument" do
|
9
9
|
context "of nil (the default)" do
|
10
10
|
let(:organisation) { nil }
|
11
|
-
it { should == "<script src='#{Rack::JQueryUI::CDNs::
|
11
|
+
it { should == "<script src='#{Rack::JQueryUI::CDNs::MEDIA_TEMPLE}'></script>\n#{Rack::JQueryUI::FALLBACK}" }
|
12
12
|
end
|
13
13
|
context "of :google" do
|
14
14
|
let(:organisation) { :google }
|
@@ -111,7 +111,7 @@ describe "Inserting the CDN" do
|
|
111
111
|
end
|
112
112
|
it_should_behave_like "Any route"
|
113
113
|
subject { last_response.body }
|
114
|
-
let(:expected) { Rack::JQueryUI::CDNs::
|
114
|
+
let(:expected) { Rack::JQueryUI::CDNs::MEDIA_TEMPLE }
|
115
115
|
it { should include expected }
|
116
116
|
end
|
117
117
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-jquery_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|