(PUP-2882) Verify available versions

Prior to this commit we didn't check up front to make sure there is a version
matching what is requested by the --version flag. This changed the error given,
which made acceptance tests fail.

This commit adds a check before even attempting to build a graph to ensure that
there is a compatible version.
(PUP-2948) enable rubocop for travisCI

Before this commit, rubocop was executed for each ruby platform in travisCI.
This commit enables rubocop only for the latest ruby platform (2.1.1). In a
nutshell, the changes included are

- Add rubocop step in travis CI
- Ensure rubocop is present in test group
- Ensure rubocop is not added for ruby 1.8
Merge pull request #2889 from vrthra/rubocop/puppet-4/enable-travisci

(PUP-2948) enable rubocop for travisCI
Merge pull request #2913 from highb/fix/master/pup-2882_check_available_versions

(PUP-2882) Verify available versions
Merge remote-tracking branch 'upstream/master' into puppet-4

* upstream/master:
  (PUP-2882) Verify available versions
(PUP-2950) Enable rubocop Style/AndOr in lib/ (enable)

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

This commit enables the `AndOr` cop
(PUP-2950) Enable rubocop Style/AndOr in lib/ (autocorrect)

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

Rubocop: autocorrect
(PUP-2950) Enable rubocop Style/AndOr in lib/ (fix spacing)

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:
    Replacing only the simplest pattern

    s#^( *)if +([^ ]+) +and +([^ ]+)$#$1if $2 && $3#g
    s#^( *)if +([^ ]+) +or +([^ ]+)$#$1if $2 || $3#g
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

Replacing only the simplest patterns

's#^(.*) if +([^ ]+) +or +([^ ]+)$#$1 if $2 || $3#g'
's#^(.*) if +([^ ]+) +and +([^ ]+)$#$1 if $2 && $3#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

Replacing only the pattern
's#^(.*) if +([^ ]+) +([!=~+-<>]+) +([^ ]+) and ([^ ]+) ([!=~+-><]+) +([^ \n]+)$#$1 if ($2 $3 $4) && ($5 $6 $7)#g'
's#^(.*) if +([^ ]+) +([!=~+-<>]+) +([^ ]+) or ([^ ]+) ([!=~+-><]+) +([^ \n]+)$#$1 if ($2 $3 $4) || ($5 $6 $7)#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

's#^(.*) if +([^ ]+) +([!=~+-<>]+) +([^ ]+) or ([^ \n]+)$#$1 if ($2 $3 $4) || $5#g'
's#^(.*) if +([^ ]+) or ([^ ]+) ([!=~+-><]+) +([^ \n]+)$#$1 if $2 || ($3 $4 $5)#g'
's#^(.*) if +([^ ]+) +([!=~+-<>]+) +([^ ]+) and ([^ \n]+)$#$1 if ($2 $3 $4) && $5#g'
's#^(.*) if +([^ ]+) and ([^ ]+) ([!=~+-><]+) +([^ \n]+)$#$1 if $2 && ($3 $4 $5)#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

Only patterns
's#(.*) +unless +([^ ]+) +or +([^ ]+)$#$1 unless $2 || $3#g'
's#(.*) +unless +([^ ]+) +and +([^ ]+)$#$1 unless $2 && $3#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

'%s#if ([^ ]+) and ([^ ]+) then#if $1 && $2 then#g'
'%s#if ([^ ]+) or ([^ ]+) then#if $1 || $2 then#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

replacing only patterns

's#([ ]*)if +([^ ]+) +and +([^ ]+)$#${1}if $2 && $3#g'
's#([ ]*)if +([^ ]+) +or +([^ ]+)$#${1}if $2 || $3#g'
's#([ ]*)if +([^ ]+) +and not +([^ ]+)$#${1}if $2 && !$3#g'
's#([ ]*)if not +([^ ]+) +and not +([^ ]+)$#${1}if !$2 && !$3#g'
's#([ ]*)if not +([^ ]+) +and +([^ ]+)$#${1}if !$2 && $3#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

Replacing only patterns

's#^([^ ]+) +and +([^ ]+)$#$1 && $2#g'
's#^([^ ]+) +or +([^ ]+)$#$1 || $2#g'
's#^( *[^ ]+) +and +([^ ]+)$#$1 && $2#g'
's#^( *[^ ]+) +or +([^ ]+)$#$1 || $2#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

'%s#if ([^ ]+) and ([^ ]+)#if $1 and $2#g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

'%s#(.*) if ([^ ]+) and ([^ ]+) #$1 if $2 and $3 #g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

'%s#(.*) if ([^ ]+) ([=!~]+) and ([^ ]+) #$1 if ($2) && $3 #g'
(PUP-2950) Enable rubocop Style/AndOr in lib/

This is part of a series of commits that follows the same pattern. These
checkins remove use of `and` and `or` keywords, and enable the Style/AndOr cop
so that future use of `and` and `or` is banned (and instead `&&` and `||` is
encouraged)

For the ease of modification, and to ensure that the possible errors remain a
minimum, we have attempted to make the changes as consistent to each other as
possible, and have also given preference to explicit parenthesis where doing so
helped.

Our approach has been to
- Let rubocopop autocorrect where possible
- Look for regular expression patterns that could catch the maximum number of
  violations without ambiguity, and apply these to the code, and then manually
  verify that the changes have indeed been correct (and correct where
  necessary).
- Once such patterns were exhausted, the remaining changes were done by hand.

REGEX USED:

's#^( *)([^ ]+) +or raise (.*)$#$1$2 || (raise $3)#g'