confidential_info_manager 0.2.1 → 0.2.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 761b5723d7a922ebab89253972793269f10f71e8
|
4
|
+
data.tar.gz: 599e7447cc1b360e89d175eecf46094d08c97033
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14eec241dfb3b457940851d7b7c0708b7adec285429195c57d26e89dac8e089f0d456c0b4f0ae2278032acdcb7fb1dda4bdef74e5272f2b4ef70caff276c805e
|
7
|
+
data.tar.gz: 6e2216fc017c66654fe23ccbbaf73bc5869beaa398d2b10ba89b91a4cf11fd3f86c28597e3dd52ac9a01f5a4f2bec2c84e56a3ea2e6cc7269da89ff0fa0e9b10
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
module ConfidentialInfoManager
|
4
|
+
|
5
|
+
class JSON < Core
|
6
|
+
|
7
|
+
##
|
8
|
+
# JSON file save
|
9
|
+
# @param [Object] secret_data
|
10
|
+
# @note Object is a String or Array or Hash
|
11
|
+
# @param [String] file_path
|
12
|
+
def save(secret_data, file_path)
|
13
|
+
File.open(file_path, "w") { |file| file.write(::JSON.pretty_generate(encrypt_only_value(secret_data))) }
|
14
|
+
end
|
15
|
+
|
16
|
+
##
|
17
|
+
# JSON file load
|
18
|
+
# @param [String] file_path
|
19
|
+
# @return [Hash]
|
20
|
+
def load(file_path)
|
21
|
+
decrypt_only_value(::JSON.parse(File.read(file_path), { symbolize_names: true }))
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confidential_info_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tatsu07
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- confidential_info_manager.gemspec
|
88
88
|
- lib/confidential_info_manager.rb
|
89
89
|
- lib/confidential_info_manager/core.rb
|
90
|
+
- lib/confidential_info_manager/json.rb
|
90
91
|
- lib/confidential_info_manager/version.rb
|
91
92
|
- lib/confidential_info_manager/yaml.rb
|
92
93
|
homepage: https://github.com/tatsu07/confidential_info_manager
|