encrypt_env 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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/encrypt_env.rb +3 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cda6569c48f049f69633e197c09111d47bda9fa0cb17ab82ea7c34815e5509f0
4
- data.tar.gz: f4a45e714400ad45c77ec0c61edebe2188ee21ebdf1e57b0f2bb79cb8cdf4dd8
3
+ metadata.gz: 8e693dd23d4628870c64fd6709d83263b8c47ce1adbb38a894be301b9352d9d9
4
+ data.tar.gz: 2b0d99cd7ebee8c8696be54d3aedb3a9b0932570b180b5096263b4ec7de591ca
5
5
  SHA512:
6
- metadata.gz: 3d908d51b1aee75ea96fde1655454a9714c3a08edcdc930921675d8df31658955c52574071c442d1d907d8cd5630dd6f2a663ffa747acc578ce1f23cf862acc7
7
- data.tar.gz: 0503a0765c2495658448ae513ad089048c60a994d328f385ebfe0723cd8e5a96b5418763e120c06fc18d569af42a094da4d51721d37bdc6dc7e470f65ec7449b
6
+ metadata.gz: e2f5ae62315c67e5263c832c265143b63f4606372b6696bae32d97664aa292015469be681be58f453b2dd6a81210394f83bdc8a4d7850fe4eb871f6cea877de1
7
+ data.tar.gz: 647cce7fadde39fb6365ac920da670173f956ec851b09c98122fe7df24a40a98d0fa9165910dca36af41a128887282230d0653ad03dfeb820f0a04faf8ea17d8
data/lib/encrypt_env.rb CHANGED
@@ -27,7 +27,8 @@ class EncryptEnv
27
27
  iv = cipher.random_iv
28
28
  encrypted = cipher.update(content) + cipher.final
29
29
  tag = cipher.auth_tag
30
- hex_string = (encrypted + iv + tag).unpack1('H*')
30
+ # rubocop: disable all
31
+ hex_string = (encrypted + iv + tag).unpack('H*').first
31
32
  File.open("#{@path_root}/config/secrets.yml.enc", 'w') { |file| file.write(hex_string) }
32
33
  end
33
34
 
@@ -58,7 +59,7 @@ class EncryptEnv
58
59
  @secret_file = File.expand_path("#{@path_root}/config/secrets.yml")
59
60
  key = OpenSSL::Random.random_bytes(16)
60
61
  # save key in master.key file
61
- File.open("#{@path_root}/config/master.key", 'w') { |file| file.write(key.unpack1('H*')) }
62
+ File.open("#{@path_root}/config/master.key", 'w') { |file| file.write(key.unpack('H*').first) }
62
63
  encrypt(File.read(@secret_file))
63
64
  end
64
65
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: encrypt_env
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nhu Tan