Initial import

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Move matching functionality into "Matcher" class

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Make CommandT a module rather than a class

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Move Matcher into subdirectory

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Move Matcher spec into subdirectory also

Signed-off-by: Wincent Colaiuta <win@wincent.com>
matches_for: complain if passed nil

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add fixtures for testing purposes

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add spec.opts file for color output

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add Scanner class

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Optionally override Scanner base path

This is principally for testing purposes, because in actual use the
intended purpose of the add-on is to always operate in the current
working directory.

In testing, however, it is useful to provide a helper method (in the
spec_helper.rb file) to generate a new Scanner object configured to
search the "fixtures" directory, without having to explicitly change
directories within the specs themselves.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add specs for flush method

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add Base class

At the moment this is just a simple aggregator class which puts together
a Matcher with a Scanner and exposes a "matches_for" method.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Additional spec for Base class

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add Match class for encapsulating and scoring matched strings

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Refactor match specs

Add a helper method which makes these tests more concise and will enable
other future tests.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add spec for case-insensitive matching

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Flesh out scoring algorithm

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Refactor scanners

In preparation for the addition of other scanner backends, move existing
find-based scanner into a subdirectory.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add pure Ruby scanner

This may not be as fast as shelling out to "find" but it does allow some
nice advantages:

  - ability to define a file limit and return as soon as the limit is
    reached
  - similarly the ability to define a recursion depth limit and return
    as soon as it is reached
  - ability to define an exclusion pattern (such as ".git") and ignore
    matching files or directories

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Add max_depth option to Find class

This matches some but not all functionality in the Ruby scanner.

Signed-off-by: Wincent Colaiuta <win@wincent.com>