blobs 0.3.2 → 0.3.3
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/blobs.gemspec +1 -0
- data/lib/blobs.rb +20 -0
- data/lib/blobs/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 395f297decc49f36421080255f26d85d502ad2ee
|
4
|
+
data.tar.gz: ba6c2e780cf4296324b8d9e83ba8ab7fa0c851f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac576986908480a12adaf1be88434c52d9fd5977d32690529a0cf8c916bc82914054e19b8fcfba987905138df6de308f558baaf7702e0ffeb2a62ac9e073ecde
|
7
|
+
data.tar.gz: 677e2cf2c062d6f320cfe899e4576f0582818461e605f1e9a1f515d078d03b25041672c08b15d95d6e148c78603d92c6e26dc9f61d91f6d9fa3d0297b468d30f
|
data/blobs.gemspec
CHANGED
data/lib/blobs.rb
CHANGED
@@ -6,6 +6,7 @@ require 'securerandom'
|
|
6
6
|
require 'cgi'
|
7
7
|
require 'yaml'
|
8
8
|
require 'securerandom'
|
9
|
+
require 'rqrcode'
|
9
10
|
|
10
11
|
module Blobs
|
11
12
|
DEBUG = false
|
@@ -116,6 +117,25 @@ module Blobs
|
|
116
117
|
export_file
|
117
118
|
end
|
118
119
|
|
120
|
+
def export_key_file_qrcode(key_file = "#{ENV['HOME']}/.blobs.key.enc")
|
121
|
+
encryption_key unless @encryption_key and @iv
|
122
|
+
key_file_json_str = Base64.encode64({ key: @encryption_key, iv: @iv }.to_json)
|
123
|
+
qrcode = RQRCode::QRCode.new(key_file_json_str)
|
124
|
+
png = qrcode.as_png(
|
125
|
+
resize_gte_to: false,
|
126
|
+
resize_exactly_to: false,
|
127
|
+
fill: 'white',
|
128
|
+
color: 'black',
|
129
|
+
size: 240,
|
130
|
+
border_modules: 4,
|
131
|
+
module_px_size: 6,
|
132
|
+
file: nil # path to write
|
133
|
+
)
|
134
|
+
qrcode_file_path = "#{ENV['HOME']}/blobs.key-#{SecureRandom.hex(4)}#{Time.now.to_i}.png"
|
135
|
+
IO.write(qrcode_file_path, png.to_s)
|
136
|
+
qrcode_file_path
|
137
|
+
end
|
138
|
+
|
119
139
|
def file_to_json(file_path)
|
120
140
|
encoded_string = Base64.encode64(File.open(file_path, 'rb').read)
|
121
141
|
{ file: encoded_string, file_name: file_path.split('/').last,
|
data/lib/blobs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blobs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Kiessler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 0.13.7
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rqrcode
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.10.1
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.10.1
|
55
69
|
description: An HTTP API Client for the blob-store service.
|
56
70
|
email:
|
57
71
|
- kiessler@inceedo.com
|