Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1567 from chef/lcg/bump-deps-and-chefstyle
Browse files Browse the repository at this point in the history
bump deps and chefstyle
  • Loading branch information
lamont-granquist authored May 7, 2018
2 parents bb4b7ca + ebe10d2 commit a7d5ec5
Show file tree
Hide file tree
Showing 19 changed files with 67 additions and 61 deletions.
13 changes: 13 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Style/StringLiterals:
Exclude:
- "spec/unit/fixtures/**/*"
- "lib/chef-dk/skeletons/**/*"
Layout/TrailingWhitespace:
Exclude:
- "spec/unit/fixtures/**/*"
Style/PercentLiteralDelimiters:
Exclude:
- "lib/chef-dk/skeletons/**/*"
Layout/TrailingBlankLines:
Exclude:
- "spec/unit/fixtures/**/*"
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ group(:omnibus_package) do
gem "cheffish", ">= 14.0.1"
gem "chefspec", ">= 7.2.0"
gem "fauxhai", ">= 5.4.0"
gem "inspec", "~> 2"
gem "inspec", ">= 2.1.68"
gem "kitchen-ec2", ">= 2.2.1"
gem "kitchen-digitalocean", ">= 0.9.8"
gem "kitchen-dokken", ">= 2.6.7"
Expand Down
47 changes: 23 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ GEM
mixlib-shellout (~> 2.0)
artifactory (2.8.2)
ast (2.4.0)
aws-sdk (2.11.42)
aws-sdk-resources (= 2.11.42)
aws-sdk-core (2.11.42)
aws-sdk (2.11.43)
aws-sdk-resources (= 2.11.43)
aws-sdk-core (2.11.43)
aws-sigv4 (~> 1.0)
jmespath (~> 1.0)
aws-sdk-resources (2.11.42)
aws-sdk-core (= 2.11.42)
aws-sdk-resources (2.11.43)
aws-sdk-core (= 2.11.43)
aws-sigv4 (1.0.2)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
Expand All @@ -45,7 +45,7 @@ GEM
azure_mgmt_resources (0.16.0)
ms_rest_azure (~> 0.10.0)
backports (3.11.3)
berkshelf (7.0.1)
berkshelf (7.0.2)
chef (>= 13.6.52)
chef-config
cleanroom (~> 1.0)
Expand All @@ -57,7 +57,7 @@ GEM
octokit (~> 4.0)
retryable (~> 2.0)
solve (~> 4.0)
thor (~> 0.19, < 0.19.2)
thor (>= 0.20)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
builder (3.2.3)
Expand Down Expand Up @@ -184,17 +184,17 @@ GEM
chef (>= 12.14.89)
fauxhai (>= 4)
rspec (~> 3.0)
chefstyle (0.6.0)
rubocop (= 0.49.1)
chefstyle (0.10.0)
rubocop (= 0.55.0)
cleanroom (1.0.0)
coderay (1.1.2)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
concurrent-ruby (1.0.5)
cookbook-omnifetch (0.8.0)
mixlib-archive (~> 0.4)
cookstyle (2.1.0)
rubocop (= 0.49.1)
cookstyle (3.0.0)
rubocop (= 0.55.0)
cucumber (3.1.0)
builder (>= 2.1.2)
cucumber-core (~> 3.1.0)
Expand Down Expand Up @@ -242,7 +242,7 @@ GEM
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
fauxhai (6.1.0)
fauxhai (6.2.0)
net-ssh
ffi (1.9.21)
ffi (1.9.21-x64-mingw32)
Expand Down Expand Up @@ -355,7 +355,7 @@ GEM
ice_nine (0.11.2)
inifile (3.0.0)
iniparse (1.4.4)
inspec (2.1.0)
inspec (2.1.68)
addressable (~> 2.4)
faraday (>= 0.9.0)
hashie (~> 3.4)
Expand All @@ -371,9 +371,9 @@ GEM
rubyzip (~> 1.1)
semverse
sslshake (~> 1.2)
thor (~> 0.19)
thor (~> 0.20)
tomlrb (~> 1.2)
train (~> 1.2)
train (~> 1.4)
ipaddress (0.8.3)
iso8601 (0.9.1)
jmespath (1.4.0)
Expand Down Expand Up @@ -550,8 +550,7 @@ GEM
pry (>= 0.9.11)
public_suffix (3.0.2)
rack (2.0.5)
rainbow (2.2.2)
rake
rainbow (3.0.0)
rake (12.3.1)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
Expand Down Expand Up @@ -589,11 +588,11 @@ GEM
rspec_junit_formatter (0.2.3)
builder (< 4)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (0.49.1)
rubocop (0.55.0)
parallel (~> 1.10)
parser (>= 2.3.3.1, < 3.0)
parser (>= 2.5)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-prof (0.17.0)
Expand Down Expand Up @@ -634,17 +633,17 @@ GEM
logify (~> 0.2)
syslog-logger (1.6.8)
systemu (2.6.5)
test-kitchen (1.21.1)
test-kitchen (1.21.2)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (>= 2.9, < 5.0)
net-ssh-gateway (~> 1.2)
thor (~> 0.19, < 0.19.2)
thor (~> 0.19)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.19.1)
thor (0.20.0)
thread_safe (0.3.6)
timeliness (0.3.8)
tomlrb (1.2.6)
Expand Down Expand Up @@ -752,7 +751,7 @@ DEPENDENCIES
ffi-rzmq-core
foodcritic (>= 12.1)
guard
inspec (~> 2)
inspec (>= 2.1.68)
kitchen-digitalocean (>= 0.9.8)
kitchen-dokken (>= 2.6.7)
kitchen-ec2 (>= 2.2.1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
chef_version = ENV["KITCHEN_CHEF_VERSION"].split("+")[0]
describe command("chef -v") do
its("exit_status") { should eq 0 }
its(:stdout) { should match /Chef Development Kit Version: #{chef_version}/ } if chef_version != "latest"
its(:stdout) { should match(/Chef Development Kit Version: #{chef_version}/) } if chef_version != "latest"
end
4 changes: 2 additions & 2 deletions lib/chef-dk/command/generate.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
# Copyright:: Copyright (c) 2014-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -85,7 +85,7 @@ def initialize(*args)
end

def run(params)
if generator_spec = generator_for(params[0])
if ( generator_spec = generator_for(params[0]) )
params.shift
generator = GeneratorCommands.build(generator_spec.class_name, params)
generator.run
Expand Down
4 changes: 1 addition & 3 deletions lib/chef-dk/command/generator_commands/policyfile.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
# Copyright:: Copyright (c) 2014-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -70,7 +70,6 @@ def run
def read_and_validate_params
arguments = parse_options(params)

new_file_path = nil
case arguments.size
when 0
if chef_repo_mode?
Expand All @@ -81,7 +80,6 @@ def read_and_validate_params
use_default_policy_settings
end
when 1
new_file_path = arguments[0]
derive_policy_settings_from_args(arguments[0])
else
@params_valid = false
Expand Down
2 changes: 1 addition & 1 deletion lib/chef-dk/component_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def tmpdir
end

def assert_present!
unless File.exists?( component_path )
unless File.exist?( component_path )
raise MissingComponentError.new(name, "Could not find #{component_path}")
end
rescue Gem::LoadError => e
Expand Down
4 changes: 2 additions & 2 deletions lib/chef-dk/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def omnibus_env
begin
user_bin_dir = File.expand_path(File.join(Gem.user_dir, "bin"))
path = [ omnibus_bin_dir, user_bin_dir, omnibus_embedded_bin_dir, ENV["PATH"] ]
path << git_bin_dir if Dir.exists?(git_bin_dir)
path << git_windows_bin_dir if Dir.exists?(git_windows_bin_dir)
path << git_bin_dir if Dir.exist?(git_bin_dir)
path << git_windows_bin_dir if Dir.exist?(git_windows_bin_dir)
{
"PATH" => path.join(File::PATH_SEPARATOR),
"GEM_ROOT" => Gem.default_dir,
Expand Down
3 changes: 1 addition & 2 deletions lib/chef-dk/pager.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2015 Chef Software Inc.
# Copyright:: Copyright (c) 2015-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -25,7 +25,6 @@ class Pager
def initialize(enable_pager: true)
@enable_pager = enable_pager
@pipe = nil
@pager_pid
end

def pager_enabled?
Expand Down
14 changes: 7 additions & 7 deletions lib/chef-dk/policyfile/dsl.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
# Copyright:: Copyright (c) 2014-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -34,8 +34,8 @@ class DSL
attr_writer :name

attr_reader :errors
attr_reader :run_list
attr_reader :default_source
attr_writer :run_list
attr_writer :default_source
attr_reader :cookbook_location_specs
attr_reader :included_policies

Expand Down Expand Up @@ -113,7 +113,7 @@ def cookbook(name, *version_and_source_opts)
constraint = version_and_source_opts.first || ">= 0.0.0"
spec = CookbookLocationSpecification.new(name, constraint, source_options, storage_config)

if existing_source = @cookbook_location_specs[name]
if ( existing_source = @cookbook_location_specs[name] )
err = "Cookbook '#{name}' assigned to conflicting sources\n\n"
err << "Previous source: #{existing_source.source_options.inspect}\n"
err << "Conflicts with: #{source_options.inspect}\n"
Expand All @@ -125,7 +125,7 @@ def cookbook(name, *version_and_source_opts)
end

def include_policy(name, source_options = {})
if existing = included_policies.find { |p| p.name == name }
if ( existing = included_policies.find { |p| p.name == name } )
err = "Included policy '#{name}' assigned conflicting locations or was already specified\n\n"
err << "Previous source: #{existing.source_options.inspect}\n"
err << "Conflicts with: #{source_options.inspect}\n"
Expand Down Expand Up @@ -262,7 +262,7 @@ def handle_preferred_cookbooks_conflicts
end

def error_context(policyfile_string, policyfile_filename, exception)
if line_number_to_show = culprit_line_number(policyfile_filename, exception)
if ( line_number_to_show = culprit_line_number(policyfile_filename, exception) )
code = policyfile_string.lines.to_a[line_number_to_show - 1].strip
"#{line_number_to_show}: #{code}"
else
Expand All @@ -271,7 +271,7 @@ def error_context(policyfile_string, policyfile_filename, exception)
end

def culprit_line_number(policyfile_filename, exception)
if most_proximate_backtrace_line = filtered_bt(policyfile_filename, exception).first
if ( most_proximate_backtrace_line = filtered_bt(policyfile_filename, exception).first )
most_proximate_backtrace_line[/^(?:.\:)?[^:]+:([\d]+)/, 1].to_i
else
nil
Expand Down
5 changes: 2 additions & 3 deletions lib/chef-dk/policyfile/solution_dependencies.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
# Copyright:: Copyright (c) 2014-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,7 +16,7 @@
#

require "semverse"

require "set"
require "chef-dk/exceptions"

module ChefDK
Expand Down Expand Up @@ -122,7 +122,6 @@ def cookbook_deps_for_lock
end

def transitive_deps(names)
require "set"
deps = Set.new
to_explore = names.dup
until to_explore.empty?
Expand Down
6 changes: 3 additions & 3 deletions lib/chef-dk/policyfile_compiler.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2014-2018 Chef Software Inc.
# Copyright:: Copyright (c) 2014-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -314,7 +314,7 @@ def version_constraint_for(cookbook_name)
end

def cookbook_version_fixed?(cookbook_name)
if cookbook_location_spec = cookbook_location_spec_for(cookbook_name)
if ( cookbook_location_spec = cookbook_location_spec_for(cookbook_name) )
cookbook_location_spec.version_fixed?
else
false
Expand All @@ -328,7 +328,7 @@ def cookbooks_in_run_list

def combined_run_lists
expanded_named_run_lists.values.inject(expanded_run_list.to_a) do |accum_run_lists, run_list|
accum_run_lists |= run_list.to_a
accum_run_lists | run_list.to_a
end
end

Expand Down
4 changes: 1 addition & 3 deletions lib/chef-dk/policyfile_services/show_policy.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright:: Copyright (c) 2015 Chef Software Inc.
# Copyright:: Copyright (c) 2015-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -58,8 +58,6 @@ def list(items)
end
end

attr_reader :policy_lister

attr_reader :ui

attr_reader :policy_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
#
# You can find this file in the repo at https://github.com/chef/omnibus-chef

if !ENV["HOME"] || !File.exists?(ENV["HOME"])
if !ENV["HOME"] || !File.exist?(ENV["HOME"])
old_home = ENV["HOME"]
found = false
alternate_homes = []
alternate_homes << "#{ENV['HOMEDRIVE']}#{ENV['HOMEPATH']}" if ENV["HOMEDRIVE"]
alternate_homes << "#{ENV['USERPROFILE']}" if ENV["USERPROFILE"]

alternate_homes.each do |path|
if File.exists?(path)
if File.exist?(path)
ENV["HOME"] = path
found = true
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def self.user_dir
ENV["CHEFDK_HOME"]
else
old_home = File.join(Gem.user_home, ".chefdk")
if File.exists?(old_home)
if File.exist?(old_home)
Gem.ui.alert_warning <<-EOF
ChefDK now defaults to using #{default_home} instead of #{old_home}.
Expand Down
Loading

0 comments on commit a7d5ec5

Please sign in to comment.