Add "path with an exceptional situatuion" test

Implement a unit test which tests the situation, when a user's input is
a complex path that raises an execption. For example, the following
input raises NameError: `cd :toplevel`, `cd 1/2/hi`. We should ensure
that after the second expression our current binding is still
`:toplevel`.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Refactor and improve Command.group method

Make `help` command be able to display groups, that are taken from gem
names correctly.

In this commit:

  a) Refactor group method by means of an if statement (remove
     repetition of assignment process);

  b) Remove unwanted square brackets from the Regexp (they do nothing);

  c) Add supplementary Regexp part to the existing one. This clause
     needs an explication:

       The old Regexp didn't capture the following strings properly:
         - "pry-pluginname-0.1.0.pre";
         - "pry-pluginname-0.1.0.rc1";
         - "pry-pluginname-0.1.0.BETA";
         - and so on.

      Instead of this, the old Regexp did capture the strings mentioned
      above as `pry-pluginname-0.1.0.` (in all cases).

      By making the Regexp a bit looser, the `help` command, when
      invoked without arguments, can display extra suffixes in
      group names.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Extend further the Regexp of Command.group

Make it match the strings like:

  - "pry-pluginname-0.1.0.pre.3";
  - "pry-pluginname-0.1.0.pre.3.rc25";
  - "pry-pluginname-0.1.0.donno.maybe.rc_25";
  - and so on.

Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
Merge pull request #625 from kyrylo/extend-command-group-regexp

Refactor and improve Command.group method
Workaround JRUBY-6753
Fix space handling for `edit` command

Fix issue #623 (edit command can't handle paths with spaces in the
name).

------------------------------------------------------------------------
Description by banister:

  >> .cd /Users/john/Library/Application Support/
  >> edit hello.rb

  The editor freaks out, opening two files, one called
  `/Users/john/Library/Application` and the other called
  `Support/hello.rb`
------------------------------------------------------------------------

Use Shellwords, because it's is a jewel.

Reported-by: John Mair <jrmair@gmail.com>
Signed-off-by: Kyrylo Silin <kyrylosilin@gmail.com>
show-source should display source of first valid candidate
Ensure show-source/show-doc skip broken modules

This ensures that if the top-ranked module candidate is broken (i.e we can't extract its source)
that the module candidate with the next highest ranking is shown, and so on.

This commit also makes the speedy show-source more robust
Color line numbers according to the pry theme, do not hardcode blue.
try to fix tests
Merge pull request #627 from kyrylo/bugfix-623-edit-command-cannot-handle-paths-with-spaces-in-the-name

Fix space handling for `edit` command
Merge pull request #624 from kyrylo/add-a-cd-unit-test

Add "path with an exceptional situatuion" test
Fix warnings
fixed typo in error message, Prblem -> Problem
improve the 'cat' command

* Ensure that `cat --ex N` sets bt_index to N so that successive --ex progress from that point.
* Prevent cat from breaking on unrecognized file types, and add .prytheme as a YAML file type