Class: Nib::Crypt::Key
- Inherits:
-
Object
show all
- Defined in:
- lib/nib/crypt/key.rb
Defined Under Namespace
Classes: MissingBucketError
Instance Method Summary
collapse
Instance Method Details
#create! ⇒ Object
4
5
6
|
# File 'lib/nib/crypt/key.rb', line 4
def create!
`openssl rand -out #{name} -hex 512`
end
|
#local? ⇒ Boolean
8
9
10
|
# File 'lib/nib/crypt/key.rb', line 8
def local?
@local ||= File.exist?(name)
end
|
#pull ⇒ Object
20
21
22
|
# File 'lib/nib/crypt/key.rb', line 20
def pull
`aws s3 cp s3://#{bucket}/${PWD##*/}.#{name} #{name}`
end
|
#push ⇒ Object
16
17
18
|
# File 'lib/nib/crypt/key.rb', line 16
def push
`aws s3 cp #{name} s3://#{bucket}/${PWD##*/}.#{name}`
end
|
#remote? ⇒ Boolean
12
13
14
|
# File 'lib/nib/crypt/key.rb', line 12
def remote?
@remote ||= !`aws s3 ls s3://#{bucket}/${PWD##*/}.#{name}`.empty?
end
|