nub 0.0.47 → 0.0.48

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nub/config.rb +6 -0
  3. data/lib/nub/sys.rb +9 -0
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80625172a64171a409b3afdb9e8928f850719c08575c300de040735040c62528
4
- data.tar.gz: 5d3c5119a5cdc9a8cd1a5d25cb94e0e6a80f3a4d9aa5c7fe0defce5a6d8063c6
3
+ metadata.gz: dd4f2a86566eb5437068e162cc7ac20c109ea8b84eb64a78441ba5e1d803d9ec
4
+ data.tar.gz: e96f44af477ecb179665d809dd24d982d9ec18df6f050f34e9b1354b77a8fc59
5
5
  SHA512:
6
- metadata.gz: e4aa2a4c6635bdb0da77aa2c2b3f6b7bb941835a97405ca048323d7150fc2bfbb8f7e5e4e8ca177e8dd768059a1922fec4eb11c6a9305007d8ba21274d365094
7
- data.tar.gz: 18fe28198971fadd11975e0cc9e5d27020bca5320b795a432c3348979ebc88374b47cf3b7be1c83117f71099f74b0b5757b81f609e862c7bc9cc6881308addd8
6
+ metadata.gz: 896c9795ecb976b6694a061068c085b1131bd6a74284e14d0d624e41306ec7b310bee8a1cc9a4dc1ffd7f76a5231986d91f1b430438700a5779fca73e4040057
7
+ data.tar.gz: fa150deaf63ab606d815cb0ead6b81e167856656e60e41e2373821459fa0752803db845625a0c2877e5661427170ed8c4b57ec67cbda83167562111284f717c3
data/lib/nub/config.rb CHANGED
@@ -72,6 +72,12 @@ module Config
72
72
  return @@_yml[key] = val
73
73
  end
74
74
 
75
+ # Get the given key and raise an error if it doesn't exist
76
+ def get!(key)
77
+ Log.die("couldn't find '#{key}' in config") if !@@_yml.key?(key)
78
+ return @@_yml[key]
79
+ end
80
+
75
81
  # Save the config file
76
82
  def save
77
83
  File.write(@path, @@_yml.to_yaml) if @@_yml
data/lib/nub/sys.rb CHANGED
@@ -69,6 +69,15 @@ module Sys
69
69
 
70
70
  return OpenStruct.new(result: result, stdout: stdout.string, stderr: stderr.string)
71
71
  end
72
+
73
+ # Read a password from stdin without echoing
74
+ # @returns pass [String] the password read in
75
+ def getpass
76
+ print("Enter Password: ")
77
+ pass = STDIN.noecho(&:gets).strip
78
+ puts
79
+ return pass
80
+ end
72
81
  end
73
82
 
74
83
  # vim: ft=ruby:ts=2:sw=2:sts=2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.47
4
+ version: 0.0.48
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Crummett