Skip to content

Commit

Permalink
Prefer $w[..] string style lists (style).
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Aug 5, 2014
1 parent af20674 commit 8b2146b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/emeril/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Emeril
#
module Logging

%w{debug info warn error fatal}.map(&:to_sym).each do |meth|
%w[debug info warn error fatal].map(&:to_sym).each do |meth|
define_method(meth) do |*args|
logger && logger.public_send(meth, *args)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/emeril/metadata_chopper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class MetadataChopper < Hash
#
def initialize(metadata_file)
instance_eval(IO.read(metadata_file), metadata_file)
%w{name version}.map(&:to_sym).each do |attr|
%w[name version].map(&:to_sym).each do |attr|
next unless self[attr].nil?

raise MetadataParseError,
Expand Down
6 changes: 3 additions & 3 deletions lib/emeril/publisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def run
attr_reader :logger, :source_path, :name, :category, :knife_class

def validate_chef_config!
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
raise "Chef::Config[:#{attr}] must be set" if ::Chef::Config[attr].nil?
end
end
Expand All @@ -75,10 +75,10 @@ def sandbox_cookbook
end

def cookbook_files
entries = %w{
entries = %w[
README.* CHANGELOG.* metadata.{json,rb} attributes definitions
files libraries providers recipes resources templates
}
]

Dir.glob("#{source_path}/{#{entries.join(',')}}")
end
Expand Down
4 changes: 2 additions & 2 deletions spec/integration/new_release_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

before do
@saved = Hash.new
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
@saved[attr] = Chef::Config[attr]
end

Expand All @@ -36,7 +36,7 @@
end

after do
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
Chef::Config[attr] = @saved.delete(attr)
end

Expand Down
4 changes: 2 additions & 2 deletions spec/unit/emeril/publisher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def run; end

before do
@saved = Hash.new
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
@saved[attr] = Chef::Config[attr]
end

Expand All @@ -44,7 +44,7 @@ def run; end
end

after do
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
Chef::Config[attr] = @saved.delete(attr)
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/emeril/releaser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

before do
@saved = Hash.new
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
@saved[attr] = Chef::Config[attr]
end

Expand All @@ -25,7 +25,7 @@
end

after do
%w{node_name client_key}.map(&:to_sym).each do |attr|
%w[node_name client_key].map(&:to_sym).each do |attr|
Chef::Config[attr] = @saved.delete(attr)
end
end
Expand Down

0 comments on commit 8b2146b

Please sign in to comment.