Sha256: f14ea5af48622d2618a584ded91ddfd4330e998ac5fd5d140242a37f0f8d80b2

Contents?: true

Size: 627 Bytes

Versions: 16

Compression:

Stored size: 627 Bytes

Contents

class ZergXcode::Plugins::Ls
  def help
    {:short => 'shows the files in a project',
     :long => <<"END" }
Usage: ls [path]

Lists all the files in the project at the given path. If no path is given, looks
for a project in the current directory.
END
  end
  
  def run(args)
    list = list_for(args.shift || '.')
    output = ""
    list.each do |entry|
      output << "%-20s %s\n" % [entry.last, entry.first]
    end
    print output
    output
  end
  
  def list_for(project_name)    
    ZergXcode.load(project_name).all_files.map do |file|
      [file[:path], file[:object]['lastKnownFileType']]
    end
  end  
end

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
costan-zerg_xcode-0.1 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.2.1 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.2 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.3.1 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.3.2 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.3.3 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.3.4 lib/zerg_xcode/plugins/ls.rb
costan-zerg_xcode-0.3 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.3.4 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.3.3 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.3.1 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.3.2 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.2.1 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.2 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.1 lib/zerg_xcode/plugins/ls.rb
zerg_xcode-0.3 lib/zerg_xcode/plugins/ls.rb