Method: Snip::Command::List#execute
- Defined in:
- lib/snip/command/list.rb
#execute ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/snip/command/list.rb', line 11 def execute raise NotInitializedError unless Snip::initialized? Dir.foreach(Snip::INSTALL_DIR) do |file| next if file == '.' or file == '..' next unless @args.empty? || file.match(@args.first) first_line = "" File.open(File.join(Snip::INSTALL_DIR, file)) {|f| first_line = f.readline} printf("%-35s # %s", file.color(:blue), first_line); end end |