Skip to content

Commit

Permalink
Update RuboCop to version 0.47
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed Feb 18, 2017
1 parent 3f113c7 commit 8620412
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 12 deletions.
9 changes: 5 additions & 4 deletions chef-handler-sns.gemspec
@@ -1,8 +1,8 @@
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require 'chef/handler/sns/version'
chef_version =
ENV.key?('CHEF_VERSION') ? "#{ENV['CHEF_VERSION']}" : ['>= 0.9.0']
chef_version = ENV.key?('CHEF_VERSION') ? ENV['CHEF_VERSION'] : ['>= 0.9.0']

# rubocop:disable Metrics/BlockLength
Gem::Specification.new do |s|
s.name = 'chef-handler-sns'
s.version = ::Chef::Handler::Sns::VERSION
Expand Down Expand Up @@ -31,11 +31,12 @@ Gem::Specification.new do |s|
s.add_development_dependency 'mocha', '~> 1.1'
s.add_development_dependency 'coveralls', '~> 0.7'
s.add_development_dependency 'simplecov', '~> 0.9'
s.add_development_dependency 'rubocop', '~> 0.35.0'
s.add_development_dependency 'rubocop', '~> 0.47.0'
s.add_development_dependency 'should_not', '~> 1.1'
s.add_development_dependency 'yard', '~> 0.8'
if Gem::Requirement.new('< 2.2.2')
.satisfied_by?(Gem::Version.new(RUBY_VERSION))
.satisfied_by?(Gem::Version.new(RUBY_VERSION))
s.add_development_dependency 'rack', '~> 1.0'
end
end
# rubocop:enable Metrics/BlockLength
10 changes: 5 additions & 5 deletions lib/chef/handler/sns/config.rb
Expand Up @@ -42,7 +42,7 @@ module Config
#
# Required configuration options.
#
REQUIRED = %w(access_key secret_key topic_arn)
REQUIRED = %w(access_key secret_key topic_arn).freeze

#
# Reads some configuration options from Ohai information.
Expand Down Expand Up @@ -108,13 +108,13 @@ def config_check(node = nil)
config_from_ohai(node) if node
REQUIRED.each do |key|
next unless send(key).nil?
fail Exceptions::ValidationFailed,
"Required argument #{key} is missing!"
raise Exceptions::ValidationFailed,
"Required argument #{key} is missing!"
end

return unless body_template && !::File.exist?(body_template)
fail Exceptions::ValidationFailed,
"Template file not found: #{body_template}."
raise Exceptions::ValidationFailed,
"Template file not found: #{body_template}."
end

#
Expand Down
2 changes: 1 addition & 1 deletion lib/chef/handler/sns/version.rb
Expand Up @@ -30,7 +30,7 @@ class Sns < ::Chef::Handler
#
# chef-handler-sns Ruby Gem version.
#
VERSION = '2.1.0.dev'
VERSION = '2.1.0.dev'.freeze
end
end
end
2 changes: 2 additions & 0 deletions test/test_chef_handler_sns.rb
Expand Up @@ -40,6 +40,7 @@ def config
end
end

# rubocop:disable Metrics/BlockLength
describe Chef::Handler::Sns do
let(:data_dir) { ::File.join(::File.dirname(__FILE__), 'data') }
let(:node) do
Expand Down Expand Up @@ -301,3 +302,4 @@ def config
sns_handler.run_report_safely(run_status)
end
end
# rubocop:enable Metrics/BlockLength
5 changes: 3 additions & 2 deletions test/test_chef_handler_sns_config.rb
Expand Up @@ -25,10 +25,10 @@ class SnsConfig
end

class ChefFakeOhai < Chef::Handler::Sns::Config::Ohai
def intialize
end
def intialize; end
end

# rubocop:disable Metrics/BlockLength
describe Chef::Handler::Sns::Config do
let(:node) do
node = Chef::Node.new
Expand Down Expand Up @@ -166,3 +166,4 @@ def intialize
end
end
end
# rubocop:enable Metrics/BlockLength
2 changes: 2 additions & 0 deletions test/test_chef_handler_sns_config_ohai.rb
Expand Up @@ -19,6 +19,7 @@

require 'helper'

# rubocop:disable Metrics/BlockLength
describe Chef::Handler::Sns::Config::Ohai do
let(:node) do
Chef::Node.new.tap do |node|
Expand Down Expand Up @@ -85,3 +86,4 @@
end
end
end
# rubocop:enable Metrics/BlockLength

0 comments on commit 8620412

Please sign in to comment.