Class: Nib::Crypt::Initializer
- Inherits:
-
Object
- Object
- Nib::Crypt::Initializer
- Defined in:
- lib/nib/crypt/initializer.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#call ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/AbcSize.
-
#initialize ⇒ Initializer
constructor
A new instance of Initializer.
Constructor Details
#initialize ⇒ Initializer
Returns a new instance of Initializer.
7 8 9 |
# File 'lib/nib/crypt/initializer.rb', line 7 def initialize @key = Key.new end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/nib/crypt/initializer.rb', line 5 def key @key end |
Instance Method Details
#call ⇒ Object
rubocop:disable Metrics/MethodLength, Metrics/AbcSize
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/nib/crypt/initializer.rb', line 12 def call if key.remote? && !key.local? puts 'Pulling existing key from S3' key.pull elsif !key.local? puts 'Key does not yet exist, creating' key.create! puts 'Pushing new key to to S3' key.push elsif !key.remote? puts 'Pushing existing key to to S3' key.push else puts 'Project already inialized' end end |