Skip to content

Commit

Permalink
Remove .rubocop.yml cleaning some offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
zuazo committed Feb 18, 2017
1 parent 8620412 commit f037951
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 51 deletions.
4 changes: 0 additions & 4 deletions .rubocop.yml

This file was deleted.

56 changes: 10 additions & 46 deletions lib/chef/handler/sns/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ module Config
def config_from_ohai(node)
config_ohai = Config::Ohai.new(node)
[
:access_key,
:secret_key,
:token
:access_key, :secret_key, :token
].each do |attr|
send(attr, config_ohai.send(attr)) if send(attr).nil?
end
Expand Down Expand Up @@ -127,11 +125,7 @@ def config_check(node = nil)
# @api public
#
def access_key(arg = nil)
set_or_return(
:access_key,
arg,
kind_of: String
)
set_or_return(:access_key, arg, kind_of: String)
end

#
Expand All @@ -144,11 +138,7 @@ def access_key(arg = nil)
# @api public
#
def secret_key(arg = nil)
set_or_return(
:secret_key,
arg,
kind_of: String
)
set_or_return(:secret_key, arg, kind_of: String)
end

#
Expand All @@ -161,11 +151,7 @@ def secret_key(arg = nil)
# @api public
#
def region(arg = nil)
set_or_return(
:region,
arg,
kind_of: String
)
set_or_return(:region, arg, kind_of: String)
end

#
Expand All @@ -178,11 +164,7 @@ def region(arg = nil)
# @api public
#
def token(arg = nil)
set_or_return(
:token,
arg,
kind_of: [String, FalseClass]
)
set_or_return(:token, arg, kind_of: [String, FalseClass])
end

#
Expand All @@ -198,9 +180,7 @@ def token(arg = nil)
#
def topic_arn(arg = nil)
set_or_return(
:topic_arn,
arg,
kind_of: String
:topic_arn, arg, kind_of: String
).tap do |arn|
# Get the region from the ARN:
next if arn.nil? || !region.nil?
Expand All @@ -218,11 +198,7 @@ def topic_arn(arg = nil)
# @api public
#
def message_structure(arg = nil)
set_or_return(
:message_structure,
arg,
kind_of: String
)
set_or_return(:message_structure, arg, kind_of: String)
end

#
Expand All @@ -235,11 +211,7 @@ def message_structure(arg = nil)
# @api public
#
def subject(arg = nil)
set_or_return(
:subject,
arg,
kind_of: String
)
set_or_return(:subject, arg, kind_of: String)
end

#
Expand All @@ -252,11 +224,7 @@ def subject(arg = nil)
# @api public
#
def body_template(arg = nil)
set_or_return(
:body_template,
arg,
kind_of: String
)
set_or_return(:body_template, arg, kind_of: String)
end

#
Expand All @@ -273,11 +241,7 @@ def body_template(arg = nil)
#
def filter_opsworks_activity(arg = nil)
arg = Array(arg) if arg.is_a? String
set_or_return(
:filter_opsworks_activity,
arg,
kind_of: Array
)
set_or_return(:filter_opsworks_activity, arg, kind_of: Array)
end
end
end
Expand Down
4 changes: 3 additions & 1 deletion test/test_chef_handler_sns_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ def intialize; end
end
end

[:access_key, :secret_key, :region, :token, :topic_arn, :message_structure].each do |option|
[
:access_key, :secret_key, :region, :token, :topic_arn, :message_structure
].each do |option|
it "accepts string values in '#{option}' option" do
sns_config.send(option, 'test')
end
Expand Down

0 comments on commit f037951

Please sign in to comment.