lucarecord 0.7.3 → 0.7.4

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
  SHA256:
3
- metadata.gz: 69e3e577310289d8d99054cbfa806d62650fa25263fc3f832381cae085af123e
4
- data.tar.gz: 933a159f84ef1118223297727a028e15db9ca1d82dc40b2410051f05edf44977
3
+ metadata.gz: ab8d42ca9b608b1523b0cf5cdf85ace0795c2852c0e7abb840c7ab63c6cf10d8
4
+ data.tar.gz: 7fbd74937cbcacf501a5be5296eaa586162a3646817cd46d6f973fe6740db93e
5
5
  SHA512:
6
- metadata.gz: e2bcd328ef856b99970549f9405ea5b0c89f91a5ecfa4877b7304180bd9096f4e5c5595f0fe0b94e5b4ac67e904f830157f5678ce95442e89df7220ad6c52939
7
- data.tar.gz: c2caec75adf8894cb97fcb5eec66474f6235ead40666d214c24471b21e9b89aea9c94898df17e72e8cdbb397f6af0fb5458ac2c926f6297a038fe1de33d6f2ae
6
+ metadata.gz: cef169faf34676d409b44d1b40ac5ae671f9e53ff0f4900ce42734a04ba98573ae906eb51cd95798bed89e2d74a4c5189e032b60ae390fdb442130572451278d
7
+ data.tar.gz: 61b8f6864ae81c2f7b90540e019be72f3be41b835274cca6fe84c9014d00126167b8d7d5b7fb08aa445fc5562fd4edf61a3fe359218d1e24b1a72b17133a9b3d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## LucaRecord 0.7.4
2
+
3
+ * `LucaSupport::ENC.encrypt() / decrypt()` use env `LUCA_ENC_PASSWORD` for automation.
4
+
1
5
  ## LucaRecord 0.7.3
2
6
 
3
7
  * 'config/' inside the project data dir is now used as a primary configuration dir.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LucaRecord
4
- VERSION = '0.7.3'
4
+ VERSION = '0.7.4'
5
5
  end
@@ -13,8 +13,11 @@ module LucaSupport # :nodoc:
13
13
  # TODO: check space in dir string
14
14
  # TODO: check if origin exists
15
15
  def encrypt(dir, iter: 10000, cleanup: false)
16
+ passopt = ENV['LUCA_ENC_PASSWORD'] ? "-pass pass:#{ENV['LUCA_ENC_PASSWORD']}" : ''
16
17
  Dir.chdir(Pathname(CONST.pjdir) / 'data') do
17
- system "tar -czf - #{dir} | openssl enc -e -aes256 -iter #{iter} -out #{dir}.tar.gz"
18
+ abort "Directory #{dir} not found. exit..." unless Dir.exist?(dir)
19
+
20
+ system "tar czf - #{dir} | openssl enc -e -aes256 -iter #{iter} -out #{dir}.tar.gz #{passopt}"
18
21
  return if ! cleanup
19
22
 
20
23
  FileUtils.rm_rf dir
@@ -23,8 +26,11 @@ module LucaSupport # :nodoc:
23
26
 
24
27
  # TODO: check space in dir string
25
28
  def decrypt(dir, iter: 10000)
29
+ passopt = ENV['LUCA_ENC_PASSWORD'] ? "-pass pass:#{ENV['LUCA_ENC_PASSWORD']}" : ''
26
30
  Dir.chdir(Pathname(CONST.pjdir) / 'data') do
27
- system "openssl enc -d -aes256 -iter #{iter} -in #{dir}.tar.gz | tar xz"
31
+ abort "Archive #{dir}.tar.gz not found. exit..." unless File.exist?("#{dir}.tar.gz")
32
+
33
+ system "openssl enc -d -aes256 -iter #{iter} -in #{dir}.tar.gz #{passopt} | tar xz"
28
34
  end
29
35
  end
30
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucarecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chuma Takahiro
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-11 00:00:00.000000000 Z
11
+ date: 2024-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler