dronejob 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/dronejob/version.rb +1 -1
- data/lib/dronejob/workspace_file.rb +5 -0
- data/lib/dronejob/workspace_file/net.rb +13 -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: 3a053063871d054184346aa3ea1acbb3c6f92dca
|
4
|
+
data.tar.gz: c5a3c8fb448ba5a0053535c77b1f80cfdc4c0673
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04dd42e28b428bb1262c457987ebcae4b23ba1b4b182b1b590ff3ae7cb301e2732dfadfb51314c3369604cd17108968d278ce7f3c5a2d3b30bb4326547cfd2f4
|
7
|
+
data.tar.gz: 8549ea35cf607779092d917024f3a354ed342e2c2fa7039900969eb1f3910f6865bd486107426bfa9d3f02594f2c610a6f6775dc60d4f34a06cc97c956908156
|
data/Gemfile.lock
CHANGED
data/lib/dronejob/version.rb
CHANGED
@@ -88,5 +88,10 @@ module Dronejob
|
|
88
88
|
FileUtils.mv(to_s, dir.file(filename).to_s) if exists?
|
89
89
|
@path = dir.file(filename).path
|
90
90
|
end
|
91
|
+
|
92
|
+
def valid_p12?(password="")
|
93
|
+
require "openssl"
|
94
|
+
OpenSSL::PKCS12::new(contents, password).certificate.not_after > DateTime.now rescue false
|
95
|
+
end
|
91
96
|
end
|
92
97
|
end
|
@@ -18,9 +18,19 @@ module Dronejob
|
|
18
18
|
bucket = storage.bucket(options[:bucket])
|
19
19
|
bucket.create_file(to_s, key, acl: "public", content_type: options[:content_type])
|
20
20
|
end
|
21
|
-
|
22
|
-
def cdn_download(key)
|
23
|
-
|
21
|
+
|
22
|
+
def cdn_download(key, cdn_bucket: nil, project_id: nil, secure: false)
|
23
|
+
cdn_bucket ||= Dronejob::Base.option(:cdn_bucket)
|
24
|
+
project_id ||= Dronejob::Base.option(:google_cloud_project_id)
|
25
|
+
if secure
|
26
|
+
require "google/cloud/storage"
|
27
|
+
storage = Google::Cloud::Storage.new(project: project_id, keyfile: File.expand_path("~/gcloud-service-account.json"))
|
28
|
+
bucket = storage.bucket(cdn_bucket)
|
29
|
+
bucket.file(key)&.download(to_s)
|
30
|
+
self
|
31
|
+
else
|
32
|
+
download("#{Dronejob::Base.option(:cdn_scheme)}://#{cdn_bucket}/#{key}")
|
33
|
+
end
|
24
34
|
end
|
25
35
|
|
26
36
|
def queue_download(url, &block)
|