Class: SafeCredentialsCLI
- Inherits:
-
Thor
- Object
- Thor
- SafeCredentialsCLI
- Defined in:
- lib/safe_credentials/cli.rb
Instance Method Summary collapse
Instance Method Details
#decrypt ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/safe_credentials/cli.rb', line 31 def decrypt puts "" puts " Decrypting file #{[:from]}" print " Enter your password: " password = STDIN.noecho(&:gets) puts '' config = SafeCredentials::Config.load_encrypted(password, [:from]) config.decrypt!([:vars]) config.save([:to]) puts " Result stored in #{[:to]}" add_to_gitignore([:to]) puts "" end |
#encrypt ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/safe_credentials/cli.rb', line 10 def encrypt puts " Encrypting file #{[:from]}" print " Enter your password: " password = STDIN.noecho(&:gets) puts '' config = SafeCredentials::Config.new([:from], password) config.encrypt!([:vars]) config.save([:to]) puts " Result stored in #{[:to]}" add_to_gitignore([:from]) puts "" end |