r_decryptor 0.0.2 → 0.0.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/lib/r_decryptor.rb +20 -20
- data/lib/r_decryptor/version.rb +1 -1
- 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: ca166d4d1e1d303dd611190f093faecebae030a1
|
4
|
+
data.tar.gz: 616458ffb3a582bb39083bb61fc40e58560bab0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d55ddb654043a49e1e3a55a34396195f35b4be5a29981607bd1cb524a58e84a0b33334e9616b50a38a96be76bc0f1d1b2566d3792d9b8c923298f11af425266
|
7
|
+
data.tar.gz: 3d762566c383b08df694e958328627764a66f9e5bdb7ed201e15761e5b1eabc076f37bfa6ad20d9f123a50fdc15ba9ba82bf7e0d91fb9f96d63aa28ef0b18fe3
|
data/lib/r_decryptor.rb
CHANGED
@@ -24,25 +24,25 @@ module RDecryptor
|
|
24
24
|
decipher.decrypt
|
25
25
|
decipher.key = key
|
26
26
|
decipher.iv = iv
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
#
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
#
|
46
|
-
|
27
|
+
File.open(File.expand_path('../application2.yml', __FILE__), 'wb') do |dec|
|
28
|
+
File.open(encrypted_db_yml, 'rb') do |f|
|
29
|
+
loop do
|
30
|
+
r = f.read(4096)
|
31
|
+
break unless r
|
32
|
+
decoded = decipher.update(r)
|
33
|
+
dec << decoded
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
dec << decipher.final
|
38
|
+
end
|
39
|
+
|
40
|
+
# Create CONFIG[:foo] constants from temp application2.yml
|
41
|
+
CONFIG = YAML.load(File.read(File.expand_path('../application2.yml', __FILE__)))
|
42
|
+
CONFIG.merge! CONFIG.fetch(Rails.env, {})
|
43
|
+
CONFIG.symbolize_keys!
|
44
|
+
|
45
|
+
# Delete temp application2.yml
|
46
|
+
File.delete(File.expand_path('../application2.yml', __FILE__))
|
47
47
|
end
|
48
48
|
end
|
data/lib/r_decryptor/version.rb
CHANGED