Class: Gity::Landing

Inherits:
Object
  • Object
show all
Includes:
Common, Operation, Overview, TR::CondUtils
Defined in:
lib/gity/landing.rb

Instance Method Summary collapse

Methods included from Common

#_cls, #_fmt, #_logger, #_pastel, #_prmt, #print_header

Methods included from Operation

#prompt_operation

Methods included from Operation::Delete

#delete

Methods included from Operation::Diff

#diff

Methods included from Operation::RemoveStaged

#remove_staged

Methods included from Operation::Ignore

#ignore

Methods included from Operation::Add

#add

Methods included from Operation::Commit

#commit

Methods included from Operation::CommitAll

#commit_all

Methods included from Overview

#print_overview, #print_workspace_items

Methods included from Status

#status

Instance Method Details

#run(root, opts = {}) ⇒ Object

Raises:



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/gity/landing.rb', line 16

def run(root, opts = {})

  @ws = GitCli::Workspace.new(root)
  raise Error, "Given path '#{root}' is not a workspace" if not @ws.is_workspace?

  opts = {} if opts.nil?
  opts[:loop] = true if is_empty?(opts[:loop])

  loop do

    _cls
    print_header
    _prmt.puts
    res = print_overview(@ws, opts) do |ws, files, optts|
      _prmt.puts
      prompt_operation(ws, files, optts)
    end


    break if not opts[:loop] or res.clean?
  end

end