diff options
author | Tim Smith <tsmith@chef.io> | 2019-12-29 18:06:37 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-29 18:06:37 -0800 |
commit | c8bf6efa66ff005ab87ff81c9a857ea0c6c1090e (patch) | |
tree | 3a25409c03ff3ac83f94e6e740145353d3e2c095 /spec/run_oc_pedant.rb | |
parent | 435755ee68c14fd6d6f858e451e7afeee1610e6f (diff) | |
parent | ecad8fee4a946b337e60a4274de2b2c872c9e81b (diff) | |
download | chef-zero-c8bf6efa66ff005ab87ff81c9a857ea0c6c1090e.tar.gz |
Merge pull request #298 from chef/chefstyle
Apply Chefstyle
Diffstat (limited to 'spec/run_oc_pedant.rb')
-rw-r--r-- | spec/run_oc_pedant.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/run_oc_pedant.rb b/spec/run_oc_pedant.rb index 068cb4d..b1760b6 100644 --- a/spec/run_oc_pedant.rb +++ b/spec/run_oc_pedant.rb @@ -32,6 +32,7 @@ DEFAULT_LOG_LEVEL = :warn def log_level return ENV["LOG_LEVEL"].downcase.to_sym if ENV["LOG_LEVEL"] return :debug if ENV["DEBUG"] + DEFAULT_LOG_LEVEL end @@ -39,7 +40,7 @@ def start_chef_server(opts = {}) opts = DEFAULT_SERVER_OPTIONS.merge(opts) opts[:log_level] = log_level - ChefZero::Server.new(opts).tap { |server| server.start_background } + ChefZero::Server.new(opts).tap(&:start_background) end def start_cheffs_server(chef_repo_path) @@ -49,12 +50,12 @@ def start_cheffs_server(chef_repo_path) require "chef/chef_fs/chef_fs_data_store" require "chef_zero/server" - Dir.mkdir(chef_repo_path) if !File.exist?(chef_repo_path) + Dir.mkdir(chef_repo_path) unless File.exist?(chef_repo_path) # 11.6 and below had a bug where it couldn't create the repo children automatically if Chef::VERSION.to_f < 11.8 %w{clients cookbooks data_bags environments nodes roles users}.each do |child| - Dir.mkdir("#{chef_repo_path}/#{child}") if !File.exist?("#{chef_repo_path}/#{child}") + Dir.mkdir("#{chef_repo_path}/#{child}") unless File.exist?("#{chef_repo_path}/#{child}") end end @@ -84,6 +85,7 @@ end def args_from_env(key) return [] unless ENV[key] + ENV[key].split end |