lib/knj/cmd_parser.rb in knjrbfw-0.0.30 vs lib/knj/cmd_parser.rb in knjrbfw-0.0.31
- old
+ new
@@ -1,5 +1,10 @@
+#This class can help you parse results from command-line commands.
class Knj::Cmd_parser
+ #Parses the results of "ls -l".
+ #===Examples
+ # str = %x[ls -l]
+ # Knj::Cmd_parser.lsl(str) #=> <Array> holding a lot of info about the various listed files.
def self.lsl(str, args = {})
ret = []
str.lines.each do |line|
next if line.match(/^total ([\d\.,]+)(M|k|G|)$/)
\ No newline at end of file