public
Description: Rails plugin that adds a script/find command for searching your project
Homepage:
Clone URL: git://github.com/37signals/project_search.git
tobias (author)
Wed Mar 11 10:28:07 -0700 2009
commit  6fddcef566ad79d36e7870a51ffbda787857a1be
tree    ba964f33b45c1dbb1b0f957d360d3921f60e178e
parent  216ea1bfc9dfe63a675b0fe4ead607d86237cf08
name age message
file .gitignore Mon Mar 09 07:56:00 -0700 2009 initial commit [jamis]
file MIT-LICENSE Mon Mar 09 08:06:24 -0700 2009 get ready for initial release [jamis]
file README.rdoc Mon Mar 09 11:27:24 -0700 2009 Added haml, sass to searched file list in README. [tobias]
file install.rb Mon Mar 09 10:05:47 -0700 2009 chmod script/find to 0755 on installation [Adam Bachman]
directory lib/ Mon Mar 09 11:21:40 -0700 2009 Added support for searching haml and sass files. [tobias]
directory script/ Wed Mar 11 10:28:07 -0700 2009 Using File.join() for portability. [tobias]
file uninstall.rb Mon Mar 09 07:56:00 -0700 2009 initial commit [jamis]
README.rdoc

ProjectSearch

=======

The project searcher is like a Rails-aware grep that can be used to quickly search specific areas of your project. Even if you’re already proficient with the Unix find and grep commands, this finder tool can save you precious key-strokes.

Installing the plugin adds a ‘find’ script under your project’s ‘script’ directory.

You invoke the command with an optional "scope", and a "term" (a regular expression pattern) to search for. If the scope is omitted, it defaults to "all". The supported scopes and their meanings are:

  • "all": search app, config, lib, test, and public directories.
  • "code": search app (except for app/views), config, lib, and test.
  • "css": search just the public/stylesheets directory.
  • "js": search just the public/javascripts directory.

You can also specify "helper", "model", "presenter", "service", "view" "controller", or "concern", which will search in the pluralized version of that directory under "app".

Any other scope argument is interpreted to mean the directory name itself that you want to search.

Note that only files with the following extensions are searched:

  • rb
  • rjs
  • rhtml
  • rxml
  • erb
  • builder
  • haml
  • css
  • sass
  • js
  • html

Examples:

  # searches all significant project directories for files that
  # contain the string "FIXME".
  script/find FIXME

  # searches all javascript and view files for Ajax.Request.
  script/find js Ajax.Request

  # searches the project's helpers for all method definitions
  # starting with "emit_":
  script/find helper "def emit_"

Copyright © 2009 Jamis Buck, released under the MIT license