Migrate check_host util to Pkg::Util::Net

One by one, we're going to remove *all* utils from 00_utils.rake and move them
into classes. This continues that work with 'check_host'.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Migrate 'remote_ssh_cmd' to Pkg::Util::Net

One by one I want to migrate these utilities over to the libraries while I have
a quiet moment or two. Here's another one.
(RE-2222) Push gems to internal server on release

This commit adjusts the ship_gem utility to include a try for pushing
the completed gem to the stickler host, currently rubygems.delivery.puppetlabs.net.
The host name can be overwritten using the environment variable INTERNAL_GEM_HOST.
If it fails it puts an error for user to check if they can access the server and have stickler installed.
Merge pull request #308 from clantant/RE-2222/master/gemrelease

(RE-2222) Push gems to internal server on release
(maint) Move socket require to top of net_spec
(maint) Change expect to should in net_spec
(maint) Remove unnecessary stubs in net_spec
(RE-2467) Move shared code into Pkg::Util::File

Both the tar and gem workflows copy files from the project into the
workdir using very similar means. This commit abstracts that logic into
a utility method called install_files_into_dir. The utility copies all
files in the project root that match a given pattern into the workdir.
(RE-2467) Add tests for the install_files_into_dir method

This adds a simple and convoluted test for the install_files_into_dir
method that ensures that the correct behavior is seen for files,
symlinks, directories, and empty directories.
Merge pull request #9 from haus/maint/master/migrate_utils

Update specs based on comments I left
Whitespace fixin
(maint) Finish incomplete config test

The updated test here was never finished. It set expectations without
invoking any methods. This commit fixes a bug about which namespace
would receive the git_sha_or_tag method and adds a method call to test
the behavior.
(maint) Use around to simplify teardown and setup

Using rspec's around syntax vastly simplifies teardown and setup in
tests that require setting and later resetting variables. This commit
updates several examples in the config spec to use this syntax.
Remove hostname method no longer used

The hostname method was migrated to Pkg::Util::Net. This commit removes it from
00_utils.rake.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #310 from haus/ticket/master/re-2467-move-common-behavior-into-file-utility

(RE-2467) Move shared code into Pkg::Util::File
Merge pull request #270 from MosesMendoza/maint/master/migrate_utils

Migrate check_host and remote_ssh_cmd to library
Merge pull request #311 from haus/maint/master/spec_improvements

(maint) Spec improvements
(maint) Use Kernel.system for remote_ssh_cmd instead of ex

Because ex saves all output to a variable, commands that depend on user
input, such as pinentry/gpg-agent will not work as the screen will never
be rendered because the command hasn't completed yet. This commit
updates that call to use Kernel.system instead, which only returns true
or false and doesn't capture the output of the call. The current
implementation caused ships/signs to hang indefinitely during the
keychain passphrase section.
Merge pull request #314 from haus/maint/master/use_kernel.system_in_remote_ssh_cmd

(maint) Use Kernel.system for remote_ssh_cmd instead of ex
(maint) Migrate ex to Pkg::Util::Execution

This commit migrates ex from 00_utils to a new module called
Pkg::Util::Execution. It also adds another method called success?, which
wraps the behavior of $?.success?, with the bonus of being more easily
stubbed/mocked in other tests. Some basic tests are included for ex. The
implementation of ex is moved from %x to `` to enable testability of the
method.