Skip to content

Commit

Permalink
Merge pull request #363 from chef/chefstyle_fixes
Browse files Browse the repository at this point in the history
Resolve chefstyle warnings
  • Loading branch information
tas50 authored Nov 13, 2020
2 parents 6ae7a16 + 3e46bf2 commit 4c32962
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/chef-vault
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ options_config.each do |option, config|
end

options_config.each do |option, config|
options[option] = options[option] ? options[option] : config[:default]
options[option] = options[option] || config[:default]
end

require "rubygems" unless defined?(Gem)
Expand Down
2 changes: 1 addition & 1 deletion chef-vault.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

$:.push File.expand_path("../lib", __FILE__)
$:.push File.expand_path("lib", __dir__)
require "chef-vault/version"

Gem::Specification.new do |s|
Expand Down
4 changes: 2 additions & 2 deletions lib/chef/knife/mixin/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def values_from_json(json)
# Raises `InvalidValue` if any of the json's values contain non-printable characters.
def validate_json(json)
begin
evaled_json = eval(json)
rescue SyntaxError => e
evaled_json = eval(json) # rubocop: disable Security/Eval
rescue SyntaxError
raise ChefVault::Exceptions::InvalidValue, "#{json} is not valid JSON!"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/vault_admins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def admins
vault_admins = Chef::Config[:knife][:vault_admins]
admin_array = [Chef::Config[:node_name]]

if !vault_admins.kind_of?(Array)
unless vault_admins.is_a?(Array)
ui.warn("Vault admin must be an array")
end

Expand Down
2 changes: 1 addition & 1 deletion lib/chef/knife/vault_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def self.included(includer)
includer.class_eval do
deps do
require "chef/search/query"
require File.expand_path("../mixin/helper", __FILE__)
require File.expand_path("mixin/helper", __dir__)
include ChefVault::Mixin::Helper
end

Expand Down

0 comments on commit 4c32962

Please sign in to comment.