(#2157) Fixup yaml typo in json spec test

The test for the external fact loading of json data was incorrectly
using a yaml file extension for the filename.  This was causing failures
because the YAML parser was being used instead of the JSON parser.

This patch uses the proper json file extension.

Paired-with: Hailee Kenney <hailee@puppetlabs.com>
Merge branch 'fix/2.x/2157_fix_spec_failures' into 2.x

* fix/2.x/2157_fix_spec_failures:
  (#2157) Fixup yaml typo in json spec test
Revert "(#2157) external facts command line - install.rb"

This reverts commit 45b8cf3500710082acb55c9f2b059988d052691a.

The external facts are not held in the libexec directory in order to be
compatible with the stdlib facts.d directories.

Reviewed-by: Jeff McCune
(Maint) Ensure that the right Facter is loaded during install

The install.rb script uses Facter to figure out some things during
install. However, it incorrectly adds itself to the load path and
instead will pick up an already installed facter instead of the facter
that is being installed.

Paired-with: Patrick Carlisle
Only use git describe in Rakefile if git is present

This commit modifies the get_version method of the
Rakefile to only use git describe if git is present,
and if not fall back to the old method of reading
the facter.rb file. Currently rake -T fails if git
is not present with 'command not found: git describe'.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
(#2157) Fix spec failures on Ruby 1.8.5

The external facts pull request contained a call to String#lines which
is not a valid method in Ruby 1.8.5.  Without this patch the specs fail
correctly.

This patch fixes the problem by changing String#lines to
String#each_line.  The tests pass on CentOS 5 with Ruby 1.8.5-25el5.

This patch also fixes a missing method error in the directory loader
where we were calling String#start_with? which does not exist in Ruby
1.8.5.  This patch replaces the method call with a regular expression.

Finally, the exception handler in the directory loader has been
tightened up to only catch Errno::ENOENT exceptions.

Paired-with: Hailee Kenney <hailee@puppetlabs.com>
Merge branch 'fix/2.x/2157_fix_ruby185_spec_failures' into 2.x

* fix/2.x/2157_fix_ruby185_spec_failures:
  (#2157) Fix spec failures on Ruby 1.8.5
Merge pull request #257 from MosesMendoza/bug/2.x/fix_get_version_to_only_use_git_if_present

Only use git describe in Rakefile if git is present
(Maint) Whitespace fixup
(#2157) Fixup remove executable facts on Windows

Without this patch applied the ScriptParser class is still being used to
try and resolve invalid facts on windows.  This causes the following
spec failure:

    2) Facter::Util::DirectoryLoader when loading facts from disk should ignore files with an extension of 'bak'
       Failure/Error: subject.load(collection)
       NoMethodError:
         undefined method `each_line' for nil:NilClass
       # ./spec/../lib/facter/util/parser.rb:118:in `results'
       # ./spec/../lib/facter/util/directory_loader.rb:61:in `load'
       # ./spec/../lib/facter/util/directory_loader.rb:55:in `each'
       # ./spec/../lib/facter/util/directory_loader.rb:55:in `load'
       # ./spec/unit/util/directory_loader_spec.rb:60

This failure is a result of `File.executable?` returning true on Windows when
the file itself is not actually executable, because it is not a PATHEXT file.

This patch also updates the parser specification examples to ensure the
expected results are returned on Windows.  In particular, script parsers should
be disabled on the windows platform.

Paired-with: Hailee Kenney <hailee@puppetlabs.com>
(#2157) Fix Mocha::StubbingError in loader_spec

Without this patch applied the spec tests for the loader_spec.rb file
are setting a stub on a nil object.  This is a problem because Mocha
0.11.3 will raise an exception catching this common error.

This exception is not raised in Mocha 0.10.4.  Mocha 0.11.3 has added a
feature to raise stubbing errors when trying to stub methods on nil
objects.

Paired-with: Hailee Kenney <hailee@puppetlabs.com>
Merge branch 'fix/2.x/2157_fix_windows_spec' into 2.x

* fix/2.x/2157_fix_windows_spec:
  (#2157) Fix Mocha::StubbingError in loader_spec
  (#2157) Fixup remove executable facts on Windows
  (Maint) Whitespace fixup

Paired-with: Hailee Kenney <hailee@puppetlabs.com>
Update version nos to match Facter development

Minor documentation fixup to clarify version numbering
as the original was Puppet centric rather than Factor.
Merge branch '2.x' of https://github.com/puppetlabs/facter into ssh
Attempt to reverse the order of facts so sshd -T happens last and
redo the tests under that understanding but it's all broken still.