Module: Secret

Defined in:
lib/secret.rb,
lib/secret/file.rb,
lib/secret/version.rb,
lib/secret/container.rb,
lib/secret/encryption.rb

Defined Under Namespace

Modules: Encryption Classes: Container, File, FileEncryptedError, FileUnreadableError

Constant Summary collapse

CHMOD_MODE =

The chmod mode to use for files.

0700
FILE_EXT =

The file extension for secret files

".sf"
VERSION =
"0.0.3"

Class Method Summary collapse

Class Method Details

.configure_default(directory, auto_create = true) ⇒ Object

Configures the default container once



22
23
24
25
26
27
28
29
30
# File 'lib/secret.rb', line 22

def self.configure_default(directory, auto_create = true)
  unless @default
    @default = Secret::Container.new(directory, auto_create)
    @default.initialize_once!
    return true
  else
    return false
  end
end

.defaultSecret::Container

Gets the default container

Returns:

Raises:

  • (ArgumentError)


16
17
18
19
# File 'lib/secret.rb', line 16

def self.default
  raise ArgumentError, "Must call 'Secret.configure_default' before you can access the default container" unless @default
  return @default
end