rack-jquery_ui 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.md +5 -1
- data/examples/config.rb +3 -3
- data/lib/rack/jquery_ui.rb +1 -6
- data/lib/rack/jquery_ui/version.rb +1 -1
- data/spec/rack_jquery_ui_spec.rb +1 -1
- metadata +1 -1
data/CHANGES.md
CHANGED
data/examples/config.rb
CHANGED
@@ -36,21 +36,21 @@ __END__
|
|
36
36
|
%html
|
37
37
|
%head
|
38
38
|
= Rack::JQuery.cdn( :google )
|
39
|
-
= Rack::JQueryUI.cdn( :
|
39
|
+
= Rack::JQueryUI.cdn( :google )
|
40
40
|
= yield
|
41
41
|
|
42
42
|
@@microsoft
|
43
43
|
%html
|
44
44
|
%head
|
45
45
|
= Rack::JQuery.cdn( :microsoft )
|
46
|
-
= Rack::JQueryUI.cdn( :
|
46
|
+
= Rack::JQueryUI.cdn( :microsoft )
|
47
47
|
= yield
|
48
48
|
|
49
49
|
@@mediatemple
|
50
50
|
%html
|
51
51
|
%head
|
52
52
|
= Rack::JQuery.cdn( :media_temple )
|
53
|
-
= Rack::JQueryUI.cdn( :
|
53
|
+
= Rack::JQueryUI.cdn( :media_temple )
|
54
54
|
= yield
|
55
55
|
|
56
56
|
@@unspecified
|
data/lib/rack/jquery_ui.rb
CHANGED
@@ -28,14 +28,9 @@ STR
|
|
28
28
|
TEN_YEARS = 60 * 60 * 24 * 365 * 10
|
29
29
|
|
30
30
|
|
31
|
-
# default options when setting up the CDN
|
32
|
-
CDN_DEFAULTS = {css: true, js: true, fallback: true}
|
33
|
-
|
34
31
|
# @param [Symbol] organisation Choose which CDN to use, either :google, :microsoft or :media_temple
|
35
32
|
# @return [String] The HTML script tags to get the CDN.
|
36
|
-
def self.cdn(
|
37
|
-
opts = CDN_DEFAULTS.merge opts
|
38
|
-
organisation = opts.fetch :organisation, :google
|
33
|
+
def self.cdn( organisation=:google )
|
39
34
|
script = case organisation
|
40
35
|
when :media_temple then MEDIA_TEMPLE
|
41
36
|
when :microsoft then MICROSOFT
|
data/spec/rack_jquery_ui_spec.rb
CHANGED
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
require_relative "../lib/rack/jquery_ui.rb"
|
5
5
|
|
6
6
|
describe "The class methods" do
|
7
|
-
subject { Rack::JQueryUI.cdn
|
7
|
+
subject { Rack::JQueryUI.cdn organisation }
|
8
8
|
context "Given an argument" do
|
9
9
|
context "of nil (the default)" do
|
10
10
|
let(:organisation) { nil }
|