Change submodule urls (git -> https)

To work around too strict firewalls that block git's smart protocol port
9418.

Originally submitted at:

  https://github.com/wincent/Command-T/pull/103

Signed-off-by: Aleksandrs Ļedovskis <aleksandrs@ledovskis.lv>
Signed-off-by: Greg Hurrell <greg@hurrell.net>
doc: Add Aleksandrs Ļedovskis to AUTHORS section
Merge branch 'gh/aledovsky/https-gitmodules' into next

Originally submitted as:

  https://github.com/wincent/Command-T/pull/103

As I noted in my comments on the PR, there are a few things to bear in
mind about these submodule URLs:

- if some people can't access port 9418, there are others whose Git
  wasn't built with support for HTTPS, so there is no one default which
  will work for everyone
- HTTPS is considered a "dumb" transport among the protocols used by Git
- these submodules are development dependencies only, and not necessary
  for the functioning of the plug-in
- you can easily override entries in .gitmodules for your environment
  (eg. with git config submodule.vendor/vimball.url
  https://github.com/tomtom/vimball.rb.git or similar`)

Among those, the first reason is the real kicker, which is why I
previously closed a similar pull request (#54). I would do the same for
this one, although the fact that the protocols are currently mixed and
nobody has complained suggests that perhaps nobody is relying on git
transport, so what the hey...

* gh/aledovsky/https-gitmodules:
  doc: Add Aleksandrs Ļedovskis to AUTHORS section
  Change submodule urls (git -> https)
Improve compatibility with Ruby 1.8.6

Replacing the 'chars' method with this
split is equivalent and Unicode-safe while
functioning on the version of Ruby included
on CentOS 4.

Originally submitted at:

  https://github.com/wincent/Command-T/pull/48

Signed-off-by: Greg Hurrell <greg@hurrell.net>
Remove unnecessary `#to_a` call

I believe `#scan` will always return an array, so this isn't needed.
doc: Add Emily Strickland to AUTHORS section
Merge branch 'gh/pull/48' into next

* gh/pull/48:
  doc: Add Emily Strickland to AUTHORS section
  Remove unnecessary `#to_a` call
  Improve compatibility with Ruby 1.8.6
Don't assume RUBY_PATCHLEVEL exists

Apparently, on very old Ruby (1.8.5), this doesn't exist; see:

  https://github.com/wincent/Command-T/issues/104

I can't test this as I don't currently have access to a machine with
1.8.5 on it, but it seems a reasonable change to make.
Attempt fix for build breakage on old Ruby

Reported here:

  https://github.com/wincent/Command-T/issues/104

`ruby extconf.rb` was blowing up with:

  extconf.rb:24: undefined method `+' for nil:NilClass (NoMethodError)

Alas, I can't test this, but I'll push this out to the "next" branch
anyway.
doc: mention Ruby 1.8.5 compatibility fixes in the HISTORY section
Fix ignoring of 'wildignore'

Since 0b8c6b44142fbb we've been ignoring Vim's built-in `'wildignore'`
setting and only filtering if `g:CommandTWildIgnore` is set.

We need to distinguish between these cases:

- user leaves `g:CommandTWildIgnore` unset; we fall through to
  `'wildignore'`, which defaults to "", and if it is empty, we do no
  filtering; otherwise we do filtering
- user sets `g:CommandTWildIgnore`; this overrides `'wildignore'` and we
  do filtering whenever it is non-empty

I have a sense that the handling might be able to be simplified, but for
now I just want to get the fix in.

Fixes:

  https://github.com/wincent/Command-T/issues/106
Simplify inheritance in FileScanner subclasses

The design of the FileScanner hierarchy has bugged me for a long time.
This commit cleans it up substantially, although there is still more
that could be done.

The re-use wasn't flowing in the right direction here, which showed up
as un-DRY-ness. Specifically, the superclass implemented caching in the
`#paths` method and the subclasses tried to leverage that by calling
`super`, but in some places the logic was duplicated (eg. wildignore
handling, cache updating and other management via explicit hash key
manipulation and calls to `#prepare_paths`).

This refactoring centralizes those concerns in the superclass, where
they belong. We delegate to the subclasses only for the cache-miss edge
case (edge case because it generally happen once only). This brings a
few benefits:

- no more cache logic (explicit key use) in subclasses
- no more cache management via `#prepare_paths` in subclasses
- no more wildignore management in subclasses
- less explicit exception-handling in subclasses
- less nesting in subclasses

The major thing that still smells is a mix of explicit param passing
and implicit communication via instance variables. This can be cleaned
up in a separate commit.
doc: update HISTORY with wildignore fix
Consistently use parens around method param lists

There was a mix of styles scattered throughout the codebase:

  def bar boom, bang
    # ...
  end

  def foo(bar, baz, bing)
    # ...
  end

Generally the older methods use the former style and the newer ones use
the latter. The early tendency to eschew params was driven by a desire
to embrace the "Zen of Ruby", which seemed to want to minimize use of
punctuation.

Since then, however, I've come around. The real "Zen" is actually to
minimize the use of punctuation but never to the extent that it reduces
readability. This is why Ruby has postfix conditionals and doesn't
require semi-colons to terminate statements (reduce clutter, improve
flow) but it has plenty of syntax involving punctuation.

In practice, the parens in function parameter lists serve as a useful
and instantly recognizable visual cue. They help readability more than
they introduce clutter.

Having worked on teams now with many non-Ruby programmers coming to
Ruby, I saw the confusion that paren-less method declarations brought.
And a quick survey of some high-profile Ruby projects shows that they
almost universally use parens in their param lists.
Remove spec/vim_formatter.rb

I stopped wanting to run specs inside of Vim a long time ago; Vim wants
to be single-threaded and modal (ha!) so it was never going to be a fun
workflow, and better alternatives exist (tmux, and vim-dispatch, if you
will).

So, remove the outdated formatter class, which doesn't work with the
version of RSpec in our Gemfile.lock anyway:

  $ bundle exec rspec -r ./spec/vim_formatter.rb -f Spec::Runner::Formatter::VimFormatter
  vim_formatter.rb:1:in `require': cannot load such file -- spec/runner/formatter/base_text_formatter (LoadError)
Remove repetitive `self.` in class method declarations

We have three classes/modules that contain no instance methods, only
class methods (and the fact that one of these is a class for which
instantiation is meaningless suggests that it should be a module; I'll
deal with that in a separate commit).

As they are just containers for class methods, get rid of the noise of
the repetitive `self.` in the method declarations by declaring the
methods in the module's metaclasses.
Make CommandT::VIM::Window a module

As noted in the previous commit, this class had no instance methods and
it was meaningless to instantiate an instance of it.

If it's just serving as a namespaced container for methods, it should be
a module. This commit makes it so.
Marginally simplify prefix_len handling

Instead of adding 1 to the prefix handling in multiple places, do it
once only, when initially setting it.

This uncovered a bug in the prefix handling in the `GitFileScanner`,
where we are passing in 0 as a `prefix_len` to the `#path_excluded?`
method, and it was getting bumped to 1, trimming off the first character
in the path and making it pretty much useless.

In testing this I noticed that the `'wildignore'` behavior is
fundamentally different between the `RubyFileScanner` and the other two
scanners that potentially consult `'wildignore'` (the `GitFileScanner`
and the `FindFileScanner`).

The Ruby scanner uses DFS and immediately terminates the recursion on
seeing an ignored path. As a result, if I ignore "node_modules" then I
won't see any files under that directory.

With the other scanners, however, such an ignore would only prevent me
from seeing a file called "node_modules", but not any file rooted
underneath a directory with that name (eg. "node_modules/project/foo").

I hadn't noticed this before because I only ever really use the
`RubyFileScanner` (for small projects) and the `WatchmanFileScanner`
(for large projects).
doc: Document file scanner 'wildignore' differences

Perhaps I knew about these differences once and forgot about it; I just
noticed in preparing the last commit that the "ruby" scanner is not like
"git" or "find".

Document the differences, and update the examples that were using ".git"
and ".hg" (which work as you'd want only with the "ruby" scanner) to
instead use "**/.git/*" and "**/.hg/*" (which will work for all the
scanners except the "watchman" scanner, which doesn't use 'wildignore'
at all).
Make exception messages consistent

Make the message in the `FileScanner` class identical to the one in the
`Finder` class.