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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57e55da2deb1f0420ab6ea93b7812d61c5c26ed9
4
- data.tar.gz: ed3d1cf01b2187da443ec31bf9901506098ceb2b
3
+ metadata.gz: 3a053063871d054184346aa3ea1acbb3c6f92dca
4
+ data.tar.gz: c5a3c8fb448ba5a0053535c77b1f80cfdc4c0673
5
5
  SHA512:
6
- metadata.gz: 1393f73c798ca97090f1a64c156b43197e0f126b3e937ce6d921aa961b458e0be36421f8e510f834c8ec5edb67ddecb3ad597f098c779b94c8f661fe845e94f8
7
- data.tar.gz: 08330299e5a45b88b5887d35099f81b1d7bd9a4dd955f237baa0154906b0b19a24fffbdf7dfdbf69240a26f17e5eb397aa4d4aad6c1d94447f913396e289f493
6
+ metadata.gz: 04dd42e28b428bb1262c457987ebcae4b23ba1b4b182b1b590ff3ae7cb301e2732dfadfb51314c3369604cd17108968d278ce7f3c5a2d3b30bb4326547cfd2f4
7
+ data.tar.gz: 8549ea35cf607779092d917024f3a354ed342e2c2fa7039900969eb1f3910f6865bd486107426bfa9d3f02594f2c610a6f6775dc60d4f34a06cc97c956908156
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dronejob (1.2.6)
4
+ dronejob (1.2.7)
5
5
  actionpack (>= 4.0)
6
6
  activejob (~> 4.2)
7
7
  bundler (>= 1.3.0, < 2.0)
@@ -173,4 +173,4 @@ DEPENDENCIES
173
173
  rspec (~> 3.3)
174
174
 
175
175
  BUNDLED WITH
176
- 1.13.2
176
+ 1.13.6
@@ -1,3 +1,3 @@
1
1
  module Dronejob
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
@@ -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
- download("#{Dronejob::Base.option(:cdn_scheme)}://#{Dronejob::Base.option(:cdn_bucket)}/#{key}")
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dronejob
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer