class Speedflow::Plugin::Git::Prompt

Plugin prompt

Attributes

prompt[W]

@return [<Speedflow::Plugin::Prompt>] Plugin prompt.

Public Instance Methods

ask_branch() click to toggle source

Public: Prompt ask branch.

Returns String of title.

# File lib/speedflow/plugin/git/prompt.rb, line 12
def ask_branch
  ask('What is the name of branch?', required: true)
end
branch(branches) click to toggle source

Public: Prompt branch.

branches - List of branches.

Returns branch name.

# File lib/speedflow/plugin/git/prompt.rb, line 21
def branch(branches)
  prompt.select('Choose the branch:', required: true) do |menu|
    menu.choice 'Re-select branch type', :retry
    branches.each do |branch|
      next if branch.name.include? '->'
      branch_full = branch.name
      branch_full = "#{branch.remote}/#{branch.name}" if branch.remote
      menu.choice branch.name, branch_full
    end
  end
end
branch_type() click to toggle source

Public: Prompt branch type.

Returns String of type (:local or :remote).

# File lib/speedflow/plugin/git/prompt.rb, line 36
def branch_type
  prompt.select('Choose the branch type:', required: true) do |menu|
    menu.choice 'Local branches', :local
    menu.choice 'Remote branches', :remote
  end
end
errors(exception) click to toggle source

Public: Errors from Git exception.

exception - Git exception.

Returns nothing.

# File lib/speedflow/plugin/git/prompt.rb, line 48
def errors(exception)
  prompt.error 'Git errors'
  prompt.warn exception.message
end
method_missing(method, *args, &block) click to toggle source

Delegate.

method - Method. args - Arguments. block - Block.

Returns wathever.

# File lib/speedflow/plugin/git/prompt.rb, line 60
def method_missing(method, *args, &block)
  prompt.send(method, *args, &block)
end
prompt() click to toggle source

Public: TTY prompt.

Returns ::Speedflow::Plugin::Prompt instance.

# File lib/speedflow/plugin/git/prompt.rb, line 67
def prompt
  @prompt ||= ::Speedflow::Plugin::Prompt.new
end