Class: Toga::Commands::Top

Inherits:
Toga::Command show all
Defined in:
lib/toga/commands/top.rb

Direct Known Subclasses

Now

Class Method Summary collapse

Methods included from Error

included

Class Method Details

.run!(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/toga/commands/top.rb', line 5

def self.run!(*args)
  # Move the given task to the top of the group
  if args.first && args.first.count > 0
    Togafile.promote(args.first.join(' '))
  end
  
  lines = Togafile.lines_in_group(:current)        
  
  lines.shift
  lines.delete_if {|l| l.strip.length == 0 }
  
  lines.first
end