cdnget 1.0.1 → 1.0.2
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 +4 -4
- data/CHANGES.md +7 -0
- data/MIT-LICENSE +1 -1
- data/README.md +27 -8
- data/Rakefile +2 -2
- data/bin/cdnget +9 -3
- data/cdnget.gemspec +1 -1
- data/lib/cdnget.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a15b7d4a8a638272f3e873db934d701725fbf8c8
|
4
|
+
data.tar.gz: 374210aaf1122decc1d332b98b21c6d3b047bd5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f73bfdda505b56f7fbcc1e6507740b86e627b6ee6a4d8962c56fa61a7f8a2171494cd8338cb526e55ae38ecced235bb1502c06f095aea14c9186c65d98e331fd
|
7
|
+
data.tar.gz: 4bfd3e5be8ef37557643252acef75902fa750f5b127cf95265ea21a1e6c738c0fa5cfb684ddcf0a7e45fc246584ed6ec2c0018050dd7a1d7148a268664dbd7fc
|
data/CHANGES.md
CHANGED
data/MIT-LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
$Copyright: copyright(c) 2016 kuwata-lab.com all rights reserved $
|
3
|
+
$Copyright: copyright(c) 2016-2021 kuwata-lab.com all rights reserved $
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
CDNget
|
2
2
|
======
|
3
3
|
|
4
|
-
($Release: 1.0.
|
4
|
+
($Release: 1.0.2 $)
|
5
5
|
|
6
6
|
CDNget is a utility script to download files from CDNJS, jsDelivr, UNPKG or Google.
|
7
7
|
|
@@ -24,20 +24,39 @@ Usage
|
|
24
24
|
-----
|
25
25
|
|
26
26
|
$ cdnget # list CDN (cdnjs/jsdelivr/unpkg/google)
|
27
|
-
$ cdnget [-q] cdnjs # list libraries
|
27
|
+
$ cdnget [-q] cdnjs # list libraries (except jsdelivr/unpkg)
|
28
28
|
$ cdnget [-q] cdnjs '*jquery*' # search libraries
|
29
29
|
$ cdnget [-q] cdnjs jquery # list library versions
|
30
30
|
$ cdnget [-q] cdnjs jquery latest # show latest version
|
31
31
|
$ cdnget [-q] cdnjs jquery 2.2.0 # list library files
|
32
|
-
$
|
33
|
-
|
34
|
-
/
|
35
|
-
/
|
32
|
+
$ mkdir -p static/lib # create a directory
|
33
|
+
$ cdnget [-q] cdnjs jquery 2.2.0 static/lib # download files
|
34
|
+
static/lib/jquery/2.2.0/jquery.js ... Done (258,388 byte)
|
35
|
+
static/lib/jquery/2.2.0/jquery.min.js ... Done (85,589 byte)
|
36
|
+
static/lib/jquery/2.2.0/jquery.min.map ... Done (129,544 byte)
|
36
37
|
|
37
|
-
$ ls /
|
38
|
+
$ ls static/lib/jquery/2.2.0
|
38
39
|
jquery.js jquery.min.js jquery.min.map
|
39
40
|
|
40
41
|
|
42
|
+
Tips
|
43
|
+
----
|
44
|
+
|
45
|
+
CDNget downloads files with keeping file structures, therefore you can
|
46
|
+
switch file source URL easily (CDN <=> local development server).
|
47
|
+
|
48
|
+
```erb
|
49
|
+
<%
|
50
|
+
if ENV['RACK_ENV'] == "development"
|
51
|
+
static_baseurl = "/static/lib"
|
52
|
+
else # production
|
53
|
+
static_baseurl = "https://cdnjs.cloudflare.com/ajax/libs"
|
54
|
+
end
|
55
|
+
%>
|
56
|
+
<script src="<%= static_baseurl %>/jquery/2.2.0/jquery.min.js"></script>
|
57
|
+
```
|
58
|
+
|
59
|
+
|
41
60
|
Todo
|
42
61
|
----
|
43
62
|
|
@@ -48,6 +67,6 @@ Todo
|
|
48
67
|
Copyright and License
|
49
68
|
---------------------
|
50
69
|
|
51
|
-
$Copyright: copyright(c) 2016 kuwata-lab.com all rights reserved $
|
70
|
+
$Copyright: copyright(c) 2016-2021 kuwata-lab.com all rights reserved $
|
52
71
|
|
53
72
|
$License: MIT License $
|
data/Rakefile
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
###
|
4
4
|
|
5
|
-
RELEASE = '$Release: 1.0.
|
6
|
-
COPYRIGHT = 'copyright(c) 2016 kuwata-lab.com all rights reserved'
|
5
|
+
RELEASE = '$Release: 1.0.2 $'.split()[1]
|
6
|
+
COPYRIGHT = 'copyright(c) 2016-2021 kuwata-lab.com all rights reserved'
|
7
7
|
LICENSE = 'MIT License'
|
8
8
|
|
9
9
|
PROJECT = 'cdnget'
|
data/bin/cdnget
CHANGED
@@ -30,7 +30,7 @@ require 'pp'
|
|
30
30
|
module CDNGet
|
31
31
|
|
32
32
|
|
33
|
-
RELEASE = '$Release: 1.0.
|
33
|
+
RELEASE = '$Release: 1.0.2 $'.split()[1]
|
34
34
|
|
35
35
|
|
36
36
|
class HttpConnection
|
@@ -610,8 +610,14 @@ Example:
|
|
610
610
|
$ #{script} [-q] cdnjs 'jquery*' # search libraries
|
611
611
|
$ #{script} [-q] cdnjs jquery # list versions
|
612
612
|
$ #{script} [-q] cdnjs jquery latest # show latest version
|
613
|
-
$ #{script} [-q] cdnjs jquery
|
614
|
-
$
|
613
|
+
$ #{script} [-q] cdnjs jquery 2.2.0 # list files
|
614
|
+
$ mkdir -p static/lib # create a directory
|
615
|
+
$ #{script} [-q] cdnjs jquery 2.2.0 static/lib # download files
|
616
|
+
static/lib/jquery/2.2.0/jquery.js ... Done (258,388 byte)
|
617
|
+
static/lib/jquery/2.2.0/jquery.min.js ... Done (85,589 byte)
|
618
|
+
static/lib/jquery/2.2.0/jquery.min.map ... Done (129,544 byte)
|
619
|
+
$ ls static/lib/jquery/2.2.0
|
620
|
+
jquery.js jquery.min.js jquery.min.map
|
615
621
|
|
616
622
|
END
|
617
623
|
end
|
data/cdnget.gemspec
CHANGED
data/lib/cdnget.rb
CHANGED
@@ -30,7 +30,7 @@ require 'pp'
|
|
30
30
|
module CDNGet
|
31
31
|
|
32
32
|
|
33
|
-
RELEASE = '$Release: 1.0.
|
33
|
+
RELEASE = '$Release: 1.0.2 $'.split()[1]
|
34
34
|
|
35
35
|
|
36
36
|
class HttpConnection
|
@@ -610,8 +610,14 @@ Example:
|
|
610
610
|
$ #{script} [-q] cdnjs 'jquery*' # search libraries
|
611
611
|
$ #{script} [-q] cdnjs jquery # list versions
|
612
612
|
$ #{script} [-q] cdnjs jquery latest # show latest version
|
613
|
-
$ #{script} [-q] cdnjs jquery
|
614
|
-
$
|
613
|
+
$ #{script} [-q] cdnjs jquery 2.2.0 # list files
|
614
|
+
$ mkdir -p static/lib # create a directory
|
615
|
+
$ #{script} [-q] cdnjs jquery 2.2.0 static/lib # download files
|
616
|
+
static/lib/jquery/2.2.0/jquery.js ... Done (258,388 byte)
|
617
|
+
static/lib/jquery/2.2.0/jquery.min.js ... Done (85,589 byte)
|
618
|
+
static/lib/jquery/2.2.0/jquery.min.map ... Done (129,544 byte)
|
619
|
+
$ ls static/lib/jquery/2.2.0
|
620
|
+
jquery.js jquery.min.js jquery.min.map
|
615
621
|
|
616
622
|
END
|
617
623
|
end
|