kbsecret 0.9.0.pre.3 → 0.9.0.pre.4
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/README.md +1 -1
- data/lib/kbsecret/cli/kbsecret-sessions +1 -1
- data/lib/kbsecret/cli.rb +9 -0
- data/lib/kbsecret/record/abstract.rb +2 -2
- data/lib/kbsecret/record.rb +1 -1
- data/lib/kbsecret/session.rb +8 -8
- data/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a56885dd4b7ed499ad570dda02ce9c84c21bc36f
|
4
|
+
data.tar.gz: 89f8a58b9837a958118e6e5e241ceaa590dfd342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9141687ce87771322f9263fac4edcdfa8c08813bef5d403345ca61715f353032791ff1b7f64f2ec31bae14fdd9604765fcbcb141be2195de0638ec6607a36ee0
|
7
|
+
data.tar.gz: 97a85c941222f3679a6daa1ea608dd6a71bdbe772e732d3877db7d6a2b5fa07a5fd280fb62e84ad9093aad251e7f7115db91a896ce560e36b4129470c55d3ecb
|
data/README.md
CHANGED
data/lib/kbsecret/cli.rb
CHANGED
@@ -151,6 +151,15 @@ module KBSecret
|
|
151
151
|
STDERR.puts "#{"Info".green}: #{msg}"
|
152
152
|
end
|
153
153
|
|
154
|
+
# Print an informational message via {#info} and exit successfully.
|
155
|
+
# @param msg [String] the message to print
|
156
|
+
# @return [void]
|
157
|
+
# @note This method does not return!
|
158
|
+
def bye(msg)
|
159
|
+
info msg
|
160
|
+
exit
|
161
|
+
end
|
162
|
+
|
154
163
|
# Print a warning message unless warnings have been suppressed.
|
155
164
|
# @param msg [String] the message to print
|
156
165
|
# @return [void]
|
@@ -127,7 +127,7 @@ module KBSecret
|
|
127
127
|
@label = label.to_s
|
128
128
|
@type = self.class.type
|
129
129
|
@data = { @type => body }
|
130
|
-
@path = File.join(session.
|
130
|
+
@path = File.join(session.path, "#{label}.json")
|
131
131
|
@defer_sync = false
|
132
132
|
|
133
133
|
populate_internal_fields
|
@@ -142,7 +142,7 @@ module KBSecret
|
|
142
142
|
@label = hsh[:label]
|
143
143
|
@type = hsh[:type].to_sym
|
144
144
|
@data = hsh[:data]
|
145
|
-
@path = File.join(session.
|
145
|
+
@path = File.join(session.path, "#{label}.json")
|
146
146
|
@defer_sync = false
|
147
147
|
end
|
148
148
|
|
data/lib/kbsecret/record.rb
CHANGED
@@ -10,7 +10,7 @@ Dir[File.join(KBSecret::Config::CUSTOM_TYPES_DIR, "*.rb")].each { |t| require_re
|
|
10
10
|
Dir[File.join(__dir__, "record/*.rb")].each { |t| require_relative t }
|
11
11
|
|
12
12
|
module KBSecret
|
13
|
-
# The namespace for
|
13
|
+
# The namespace for {KBSecret} record types.
|
14
14
|
module Record
|
15
15
|
# @return [Array<Class>] the class objects of all non-abstract record types
|
16
16
|
def self.record_classes
|
data/lib/kbsecret/session.rb
CHANGED
@@ -14,7 +14,7 @@ module KBSecret
|
|
14
14
|
attr_reader :config
|
15
15
|
|
16
16
|
# @return [String] the fully-qualified path of the session
|
17
|
-
attr_reader :
|
17
|
+
attr_reader :path
|
18
18
|
|
19
19
|
# @param label [String, Symbol] the label of the session to initialize
|
20
20
|
# @raise [Exceptions::SessionLoadError] if the session has no users or any invalid Keybase users
|
@@ -27,8 +27,8 @@ module KBSecret
|
|
27
27
|
|
28
28
|
raise Exceptions::SessionLoadError, "no users in session" if @config[:users].empty?
|
29
29
|
|
30
|
-
@
|
31
|
-
@records
|
30
|
+
@path = rel_path mkdir: true
|
31
|
+
@records = load_records!
|
32
32
|
end
|
33
33
|
|
34
34
|
# @param label [String, Symbol] the label of the record to fetch
|
@@ -98,16 +98,16 @@ module KBSecret
|
|
98
98
|
|
99
99
|
# Delete the entire session.
|
100
100
|
# @return [void]
|
101
|
-
# @note Use this with caution, as *all* files under the session
|
102
|
-
# will be deleted. Furthermore, the session
|
101
|
+
# @note Use this with caution, as *all* files under the session path
|
102
|
+
# will be deleted. Furthermore, the session path itself will
|
103
103
|
# be deleted, and this object will become garbage.
|
104
104
|
def unlink!
|
105
|
-
FileUtils.rm_rf(
|
105
|
+
FileUtils.rm_rf(path)
|
106
106
|
end
|
107
107
|
|
108
108
|
# @return [Array<String>] the fully qualified paths of all records in the session
|
109
109
|
def record_paths
|
110
|
-
Dir[File.join(
|
110
|
+
Dir[File.join(path, "*.json")]
|
111
111
|
end
|
112
112
|
|
113
113
|
# Load all records associated with the session.
|
@@ -119,7 +119,7 @@ module KBSecret
|
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
|
-
# @param mkdir [Boolean] whether or not to make the session
|
122
|
+
# @param mkdir [Boolean] whether or not to make the session path
|
123
123
|
# @return [String] the fully qualified path to the session
|
124
124
|
# @api private
|
125
125
|
def rel_path(mkdir: false)
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kbsecret
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0.pre.
|
4
|
+
version: 0.9.0.pre.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Woodruff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fpm
|