cdnget 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +6 -0
- data/README.md +1 -1
- data/Rakefile +1 -1
- data/bin/cdnget +10 -1
- data/cdnget.gemspec +1 -1
- data/lib/cdnget.rb +10 -1
- data/test/cdnget_test.rb +22 -0
- 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: f08c962b34e126b4223544721dccd62fdfc242fc
|
4
|
+
data.tar.gz: f461d62a21806c43c138c17a0fc69fb3df5a2f6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9862859cc9a25407431036702dbbb7fddc4419b2306c9c5f87a6027f4fa650409c549bb14939c8844d85d55ef5e6e4b939788c5550faada3074a899d2108029
|
7
|
+
data.tar.gz: 9aea1f38fcbb4e332d97c5993905d7d18761f57769fb489fb2aaa056bfa6cc4f71294ef9be50d7df7ef5088c7432a7465397ef2f2bbdd3de656f8602984712b2
|
data/CHANGES.md
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
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.1 $'.split()[1]
|
34
34
|
|
35
35
|
|
36
36
|
class HttpConnection
|
@@ -137,8 +137,15 @@ module CDNGet
|
|
137
137
|
target_dir = d[:destdir] ? File.join(basedir, d[:destdir]) \
|
138
138
|
: File.join(basedir, library, version)
|
139
139
|
http = nil
|
140
|
+
skipfile = d[:skipfile] # ex: /\.DS_Store\z/
|
140
141
|
d[:files].each do |file|
|
141
142
|
filepath = File.join(target_dir, file)
|
143
|
+
#
|
144
|
+
if skipfile && file =~ skipfile
|
145
|
+
puts "#{filepath} ... Skipped" # for example, skip '.DS_Store' files
|
146
|
+
next
|
147
|
+
end
|
148
|
+
#
|
142
149
|
if filepath.end_with?('/')
|
143
150
|
if File.exist?(filepath)
|
144
151
|
puts "#{filepath} ... Done (Already exists)" unless quiet
|
@@ -149,6 +156,7 @@ module CDNGet
|
|
149
156
|
end
|
150
157
|
next
|
151
158
|
end
|
159
|
+
#
|
152
160
|
dirpath = File.dirname(filepath)
|
153
161
|
print "#{filepath} ..." unless quiet
|
154
162
|
url = File.join(d[:baseurl], file) # not use URI.join!
|
@@ -471,6 +479,7 @@ module CDNGet
|
|
471
479
|
baseurl: baseurl,
|
472
480
|
default: jdata["default"],
|
473
481
|
destdir: "#{library}@#{version}",
|
482
|
+
skipfile: /\.DS_Store\z/, # downloading '.DS_Store' from UNPKG results in 403
|
474
483
|
})
|
475
484
|
return dict
|
476
485
|
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.1 $'.split()[1]
|
34
34
|
|
35
35
|
|
36
36
|
class HttpConnection
|
@@ -137,8 +137,15 @@ module CDNGet
|
|
137
137
|
target_dir = d[:destdir] ? File.join(basedir, d[:destdir]) \
|
138
138
|
: File.join(basedir, library, version)
|
139
139
|
http = nil
|
140
|
+
skipfile = d[:skipfile] # ex: /\.DS_Store\z/
|
140
141
|
d[:files].each do |file|
|
141
142
|
filepath = File.join(target_dir, file)
|
143
|
+
#
|
144
|
+
if skipfile && file =~ skipfile
|
145
|
+
puts "#{filepath} ... Skipped" # for example, skip '.DS_Store' files
|
146
|
+
next
|
147
|
+
end
|
148
|
+
#
|
142
149
|
if filepath.end_with?('/')
|
143
150
|
if File.exist?(filepath)
|
144
151
|
puts "#{filepath} ... Done (Already exists)" unless quiet
|
@@ -149,6 +156,7 @@ module CDNGet
|
|
149
156
|
end
|
150
157
|
next
|
151
158
|
end
|
159
|
+
#
|
152
160
|
dirpath = File.dirname(filepath)
|
153
161
|
print "#{filepath} ..." unless quiet
|
154
162
|
url = File.join(d[:baseurl], file) # not use URI.join!
|
@@ -471,6 +479,7 @@ module CDNGet
|
|
471
479
|
baseurl: baseurl,
|
472
480
|
default: jdata["default"],
|
473
481
|
destdir: "#{library}@#{version}",
|
482
|
+
skipfile: /\.DS_Store\z/, # downloading '.DS_Store' from UNPKG results in 403
|
474
483
|
})
|
475
484
|
return dict
|
476
485
|
end
|
data/test/cdnget_test.rb
CHANGED
@@ -1023,6 +1023,28 @@ END
|
|
1023
1023
|
end
|
1024
1024
|
|
1025
1025
|
|
1026
|
+
describe "cdnget CDN bulma 0.9.3 dir" do
|
1027
|
+
|
1028
|
+
before do
|
1029
|
+
@tmpdir = "tmpdir1"
|
1030
|
+
Dir.mkdir @tmpdir
|
1031
|
+
end
|
1032
|
+
|
1033
|
+
after do
|
1034
|
+
FileUtils.rm_rf @tmpdir
|
1035
|
+
end
|
1036
|
+
|
1037
|
+
it "(unpkg) skips '.DS_Store' files." do
|
1038
|
+
sout, serr = capture_io do()
|
1039
|
+
CDNGet::Main.new("cdnget").run("unpkg", "bulma", "0.9.3", @tmpdir)
|
1040
|
+
end
|
1041
|
+
ok {sout}.include?("#{@tmpdir}/bulma@0.9.3/sass/.DS_Store ... Skipped\n")
|
1042
|
+
ok {sout}.include?("#{@tmpdir}/bulma@0.9.3/sass/base/.DS_Store ... Skipped\n")
|
1043
|
+
end
|
1044
|
+
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
|
1026
1048
|
describe "cdnget CDN jquery 2.2.0 foo bar" do
|
1027
1049
|
|
1028
1050
|
it "results in argument error." do
|