Class: Bcdatabase::Commands::GenKey

Inherits:
Object
  • Object
show all
Defined in:
lib/bcdatabase/commands/gen_key.rb

Instance Method Summary collapse

Constructor Details

#initialize(streaming) ⇒ GenKey

Returns a new instance of GenKey.



7
8
9
10
# File 'lib/bcdatabase/commands/gen_key.rb', line 7

def initialize(streaming)
  @streaming = streaming
  @hl = HighLine.new($stdin, $stderr)
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
# File 'lib/bcdatabase/commands/gen_key.rb', line 12

def run
  begin
    key = random_key(128)
    outio.write key
  ensure
    @outio.close if @close_out && @outio
  end
end