From ba686e3c0af863b59882bc2d3181c05a740b366b Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 4 Apr 2017 17:08:56 -0700 Subject: [PATCH] (maint) Update VMPooler files with fixes for Rubocop violations This commit updates vmpooler.rb, api.rb and providers.rb with style changes as per rubocop style violations. This commit also updates the rubocop configuration to always use LF line endings even on Windows as rubocop was expecting CRLF even though git is configured for LF. --- .rubocop.yml | 6 ++++++ lib/vmpooler.rb | 2 +- lib/vmpooler/api.rb | 2 +- lib/vmpooler/providers.rb | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index c5cf24d..ee900f8 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,6 +9,8 @@ AllCops: - 'scripts/**/*' - 'spec/**/*' - 'vendor/**/*' + - Gemfile + - Rakefile Style/Documentation: Enabled: false @@ -58,3 +60,7 @@ Style/ConditionalAssignment: Next: Enabled: false +# Enforce LF line endings, even when on Windows +Style/EndOfLine: + EnforcedStyle: lf + diff --git a/lib/vmpooler.rb b/lib/vmpooler.rb index 953dac1..98949fb 100644 --- a/lib/vmpooler.rb +++ b/lib/vmpooler.rb @@ -12,7 +12,7 @@ module Vmpooler require 'yaml' require 'set' - %w(api graphite logger pool_manager vsphere_helper statsd dummy_statsd providers).each do |lib| + %w[api graphite logger pool_manager vsphere_helper statsd dummy_statsd providers].each do |lib| begin require "vmpooler/#{lib}" rescue LoadError diff --git a/lib/vmpooler/api.rb b/lib/vmpooler/api.rb index 0821d9d..25fa7f6 100644 --- a/lib/vmpooler/api.rb +++ b/lib/vmpooler/api.rb @@ -30,7 +30,7 @@ module Vmpooler use Vmpooler::Dashboard # Load API components - %w(helpers dashboard reroute v1).each do |lib| + %w[helpers dashboard reroute v1].each do |lib| begin require "api/#{lib}" rescue LoadError diff --git a/lib/vmpooler/providers.rb b/lib/vmpooler/providers.rb index c1c2071..9d2f0ae 100644 --- a/lib/vmpooler/providers.rb +++ b/lib/vmpooler/providers.rb @@ -1,4 +1,4 @@ -%w(base dummy vsphere).each do |lib| +%w[base dummy vsphere].each do |lib| begin require "vmpooler/providers/#{lib}" rescue LoadError