confidential_info_manager 0.2.1 → 0.2.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86783fb57b4dc727d3ef12543409d6bfdee7ea12
4
- data.tar.gz: 2fe02e464ee31d662c73397cd712d1dd3eaf7b4e
3
+ metadata.gz: 761b5723d7a922ebab89253972793269f10f71e8
4
+ data.tar.gz: 599e7447cc1b360e89d175eecf46094d08c97033
5
5
  SHA512:
6
- metadata.gz: a455c8a69f56363fdf5e932cb82dd97b866110c90bc7a01a6591a9a95418e044b015b7722201f75ee435fc49ef3adeaa087168a39d04bc1ab6c4c0d60d448328
7
- data.tar.gz: c4abc8a5f69529c77a367d8db95931af518174db22e9bef7ae9aa6fa2a3b7f2ff4523047fc6c433068ce754bc0883e7f4e3f7d6d23d4d6cf43cf7cdf49a6ac27
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
@@ -1,3 +1,3 @@
1
1
  module ConfidentialInfoManager
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -7,6 +7,7 @@ require "base64"
7
7
  require "confidential_info_manager/version"
8
8
  require "confidential_info_manager/core"
9
9
  require "confidential_info_manager/yaml"
10
+ require "confidential_info_manager/json"
10
11
 
11
12
  module ConfidentialInfoManager
12
13
  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.1
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: 2015-12-27 00:00:00.000000000 Z
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