Class: Sanctum::Command::View
Instance Attribute Summary
Attributes inherited from Base
#args, #config_file, #options, #targets, #transit_key
Instance Method Summary collapse
Methods inherited from Base
Methods included from PathsHelper
#build_path, #get_local_paths, #join_path, #read_local_files
Methods included from EditorHelper
#decrypt_data, #secure_erase, #validate, #validate_json, #validate_yaml, #write_encrypted_data, #write_random_data
Methods included from Sanctum::Colorizer
#blue, #colorize, colorize=, colorize?, #green, #light_blue, #pink, #red, #yellow
Methods included from DiffHelper
#compare_secrets, #confirmed_with_user?, #hash_diff, #only_changes
Constructor Details
This class inherits a constructor from Sanctum::Command::Base
Instance Method Details
#run(command = "less") ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/sanctum/command/view.rb', line 7 def run(command="less") raise ArgumentError, red('Please provide at least one path') if args.empty? local_secrets = read_local_files(args) local_secrets = VaultTransit.decrypt(vault_client, local_secrets, transit_key) begin IO.popen(command, "w") { |f| f.puts "#{local_secrets.to_yaml}" } rescue puts light_blue(local_secrets.to_yaml) end end |