Last active
November 20, 2015 15:10
-
-
Save terrierscript/618b4001479c877abe10 to your computer and use it in GitHub Desktop.
bowerやrails-assetsの代替としてjsdelivrを使う ref: http://qiita.com/inuscript/items/f709283b377f3c349a62
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://cdn.jsdelivr.net/g/jquery@1.11.3,jquery.ui@1.11.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://cdn.jsdelivr.net/g/パッケージ名(@version),パッケージ名... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate_jsdelivr_url(pkgs) | |
path = pkgs.map{ |pkg_name, v| "#{pkg_name}@#{v}" }.join(",") | |
"https://cdn.jsdelivr.net/g/#{path}" | |
end | |
pkgs = { | |
"jquery": "1.11.3", | |
"jquery.ui": "1.11.4" | |
} | |
generate_jsdelivr_url(pkgs) | |
// => "https://cdn.jsdelivr.net/g/jquery@1.11.3,jquery.ui@1.11.4" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment