lib/chef-dk/cli.rb in chef-dk-1.2.22 vs lib/chef-dk/cli.rb in chef-dk-1.3.40

- old
+ new

@@ -13,19 +13,19 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -require 'mixlib/cli' -require 'chef-dk/version' -require 'chef-dk/commands_map' -require 'chef-dk/builtin_commands' -require 'chef-dk/helpers' -require 'chef-dk/ui' -require 'chef/util/path_helper' -require 'chef/mixin/shell_out' -require 'bundler' +require "mixlib/cli" +require "chef-dk/version" +require "chef-dk/commands_map" +require "chef-dk/builtin_commands" +require "chef-dk/helpers" +require "chef-dk/ui" +require "chef/util/path_helper" +require "chef/mixin/shell_out" +require "bundler" module ChefDK class CLI include Mixlib::CLI include ChefDK::Helpers @@ -147,11 +147,11 @@ end private def normalized_exit_code(maybe_integer) - if maybe_integer.kind_of?(Integer) and (0..255).include?(maybe_integer) + if maybe_integer.kind_of?(Integer) && (0..255).cover?(maybe_integer) maybe_integer else 0 end end @@ -161,10 +161,10 @@ env.keys.grep(/\Apath\Z/i).first end # upcase drive letters for comparison since ruby has a String#capitalize function def drive_upcase(path) - if Chef::Platform.windows? && path[0] =~ /^[A-Za-z]$/ && path[1,2] == ":\\" + if Chef::Platform.windows? && path[0] =~ /^[A-Za-z]$/ && path[1, 2] == ":\\" path.capitalize else path end end