kbsecret 0.9.0.pre.3 → 0.9.0.pre.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
  SHA1:
3
- metadata.gz: e3e48fed3c7adcab87abbce97d3fe3cf7b5f56ed
4
- data.tar.gz: 2cd6cb7f5da242bdd4f3460f125fe5210f836108
3
+ metadata.gz: a56885dd4b7ed499ad570dda02ce9c84c21bc36f
4
+ data.tar.gz: 89f8a58b9837a958118e6e5e241ceaa590dfd342
5
5
  SHA512:
6
- metadata.gz: ca11e0f0d9d842ea042cba89d4d2cb7d88827a3ecdae4334efdce498879716afadc238c0731d5e6c1c349e2e080abc5e582fbd741acc6e35c02d151795fab0b5
7
- data.tar.gz: aaaf97b96f65b6e491c608e168866892942942c293c83c0d617833f032bbd264d3e097ec99daf437d2217b6eceeb0ec96246e7f6cacd7274df6c79bb21226803
6
+ metadata.gz: 9141687ce87771322f9263fac4edcdfa8c08813bef5d403345ca61715f353032791ff1b7f64f2ec31bae14fdd9604765fcbcb141be2195de0638ec6607a36ee0
7
+ data.tar.gz: 97a85c941222f3679a6daa1ea608dd6a71bdbe772e732d3877db7d6a2b5fa07a5fd280fb62e84ad9093aad251e7f7115db91a896ce560e36b4129470c55d3ecb
data/README.md CHANGED
@@ -79,4 +79,4 @@ join us in `#kbsecret` on Freenode.
79
79
 
80
80
  KBSecret is licensed under the MIT License.
81
81
 
82
- KBSecret's logo was created by [Dylan Ball](https://github.com/arathnim).
82
+ KBSecret's logo was created by [Arathnim](http://arathnim.me).
@@ -26,6 +26,6 @@ Config.session_labels.each do |sess_name|
26
26
 
27
27
  puts <<~EOS
28
28
  \tUsers: #{session_hash[:users].join(", ")}
29
- \tSecrets root: #{session_hash[:root]} (#{session.directory})
29
+ \tSecrets root: #{session_hash[:root]} (#{session.path})
30
30
  EOS
31
31
  end
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.directory, "#{label}.json")
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.directory, "#{label}.json")
145
+ @path = File.join(session.path, "#{label}.json")
146
146
  @defer_sync = false
147
147
  end
148
148
 
@@ -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 kbsecret records types.
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
@@ -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 :directory
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
- @directory = rel_path mkdir: true
31
- @records = load_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 directory
102
- # will be deleted. Furthermore, the session directory itself will
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(directory)
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(directory, "*.json")]
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 directory
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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module KBSecret
4
4
  # kbsecret's current version
5
- VERSION = "0.9.0.pre.3"
5
+ VERSION = "0.9.0.pre.4"
6
6
  end
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.3
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-17 00:00:00.000000000 Z
11
+ date: 2017-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fpm