Module: EasyCreds::Actions::Local

Defined in:
lib/easy_creds/actions/local.rb,
lib/easy_creds/actions/local/edit.rb,
lib/easy_creds/actions/local/init.rb,
lib/easy_creds/actions/local/delete.rb,
lib/easy_creds/actions/local/status.rb,
lib/easy_creds/actions/local/sync_key.rb,
lib/easy_creds/actions/local/editor_edit.rb

Defined Under Namespace

Modules: Delete, Edit, EditorEdit, Init, Status, SyncKey

Class Method Summary collapse

Class Method Details

.call(ctx) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/easy_creds/actions/local.rb', line 6

def self.call(ctx)
  loop do
    Views::Header.render(ctx)
    action = Views::LocalMenu.ask(ctx.prompt, ctx.env)

    case action
    when :status      then Local::Status.call(ctx)
    when :init        then Local::Init.call(ctx)
    when :edit        then Local::Edit.call(ctx)
    when :editor_edit then Local::EditorEdit.call(ctx)
    when :sync_key    then Local::SyncKey.call(ctx)
    when :delete      then Local::Delete.call(ctx)
    when :back        then break
    end

    next if action == :back

    puts ''
    ctx.prompt.keypress("  #{Theme.dim('Press any key to continue...')}", keys: %i[return space])
  rescue TTY::Reader::InputInterrupt
    break
  end
end