Skip to content

Commit

Permalink
Update rubocop config to 0.38 and resolve warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tas50 committed Mar 14, 2016
1 parent 2d7d5a4 commit 59654d7
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
10 changes: 6 additions & 4 deletions .rubocop.yml
Expand Up @@ -15,17 +15,19 @@ Encoding:
Enabled: false
Style/FileName:
Enabled: false
Style/Alias:
Enabled: false
Style/SpaceBeforeFirstArg:
Enabled: false
LineLength:
Enabled: false
MethodLength:
Enabled: false
Metrics/AbcSize:
Enabled: false
PerceivedComplexity:
Metrics/ModuleLength:
Enabled: false
SingleSpaceBeforeFirstArg:
PerceivedComplexity:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/FileName:
Enabled: false
2 changes: 1 addition & 1 deletion libraries/helpers.rb
Expand Up @@ -392,7 +392,7 @@ def package_name_for(platform, platform_family, platform_version, version, type)
Chef::Log.error("Unsupported Version: You requested to install a Mysql #{type_label} version that is not supported by your platform")
Chef::Log.error("Platform: #{platform_family} #{platform_version} - Request Mysql #{type_label} version: #{version}")
Chef::Log.error("Availabe versions for your platform are: #{info.map { |k, _v| k }.join(' - ')}")
fail "Unsupported Mysql #{type_label} Version"
raise "Unsupported Mysql #{type_label} Version"
end
info[version][type]
end
Expand Down
2 changes: 1 addition & 1 deletion libraries/provider_priority_linux.rb
@@ -1,7 +1,7 @@

begin
require 'chef/platform/provider_priority_map'
rescue LoadError
rescue LoadError # rubocop: disable Lint/HandleExceptions
end

require_relative 'provider_mysql_service_smf'
Expand Down
4 changes: 2 additions & 2 deletions tasks/maintainers.rb
Expand Up @@ -34,9 +34,9 @@
out << project_lieutenant
out << all_maintainers

File.open(TARGET, 'w') { |fn|
File.open(TARGET, 'w') do |fn|
fn.write out
}
end
end
end

Expand Down
Expand Up @@ -5,7 +5,7 @@
puts "os: #{os}"

def mysql_cmd
return "scl enable mysql51 \"mysql --version\"" if os[:family] == 'redhat' && os[:release] =~ /^5\./
return 'scl enable mysql51 "mysql --version"' if os[:family] == 'redhat' && os[:release] =~ /^5\./
'/usr/bin/mysql --version'
end

Expand Down
Expand Up @@ -5,7 +5,7 @@
puts "os: #{os}"

def mysql_cmd
return "scl enable mysql55 \"mysql --version\"" if os[:family] == 'redhat' && os[:release] =~ /^5\./
return 'scl enable mysql55 "mysql --version"' if os[:family] == 'redhat' && os[:release] =~ /^5\./
return '/opt/local/bin/mysql --version' if os[:family] == 'smartos'
return '/opt/omni/bin/mysql --version' if os[:family] == 'solaris'
'/usr/bin/mysql --version'
Expand Down
2 changes: 1 addition & 1 deletion test/integration/config51/serverspec/linux_spec.rb
Expand Up @@ -4,7 +4,7 @@

puts "os: #{os}"

os[:family] == 'redhat' ? prefix_dir = '/opt/rh/mysql51/root' : prefix_dir = nil
prefix_dir = os[:family] == 'redhat' ? '/opt/rh/mysql51/root' : nil

if %w(debian ubuntu redhat suse fedora).include? os[:family]
describe file("#{prefix_dir}/etc/mysql-default") do
Expand Down
2 changes: 1 addition & 1 deletion test/integration/config55/serverspec/linux_spec.rb
Expand Up @@ -4,7 +4,7 @@

puts "os: #{os}"

os[:family] == 'redhat' && os[:release] =~ /^5\./ ? prefix_dir = '/opt/rh/mysql55/root' : prefix_dir = nil
prefix_dir = os[:family] == 'redhat' && os[:release] =~ /^5\./ ? '/opt/rh/mysql55/root' : nil

if %w(debian ubuntu redhat suse fedora).include? os[:family]
describe file("#{prefix_dir}/etc/mysql-default") do
Expand Down

0 comments on commit 59654d7

Please sign in to comment.