Class: Sanctum::Command::Create

Inherits:
Base
  • Object
show all
Defined in:
lib/sanctum/command/create.rb

Instance Attribute Summary

Attributes inherited from Base

#args, #config_file, #options, #targets, #transit_key

Instance Method Summary collapse

Methods inherited from Base

#initialize, #vault_client

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(&block) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/sanctum/command/create.rb', line 11

def run(&block)
  if args.one?
    path = args[0]
    validate_path(path)
    create_file(path, &block)
  else
    raise ArgumentError, red('Please pass only one path argument')
  end
end