From cb635d865bd3a0c386d7d361ee2251aae99a33bf Mon Sep 17 00:00:00 2001 From: Tim Smith Date: Tue, 7 Jul 2020 15:28:50 -0700 Subject: Apply chefstyle fixes from Infra Client 16 This just makes it easier to diff the codebases by backporting some minor cleanup. Layout/EmptyLinesAroundAttributeAccessor Style/ExpandPathArguments Signed-off-by: Tim Smith --- chef-utils/chef-utils.gemspec | 2 +- chef-utils/lib/chef-utils/version.rb | 2 +- chef-utils/spec/unit/dsl/introspection_spec.rb | 1 + chef-utils/spec/unit/dsl/platform_spec.rb | 3 +++ 4 files changed, 6 insertions(+), 2 deletions(-) (limited to 'chef-utils') diff --git a/chef-utils/chef-utils.gemspec b/chef-utils/chef-utils.gemspec index 3f135de6ba..0fd6ad668d 100644 --- a/chef-utils/chef-utils.gemspec +++ b/chef-utils/chef-utils.gemspec @@ -1,4 +1,4 @@ -lib = File.expand_path("../lib", __FILE__) +lib = File.expand_path("lib", __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require "chef-utils/version" diff --git a/chef-utils/lib/chef-utils/version.rb b/chef-utils/lib/chef-utils/version.rb index a760c45a04..c422fe13b3 100644 --- a/chef-utils/lib/chef-utils/version.rb +++ b/chef-utils/lib/chef-utils/version.rb @@ -14,6 +14,6 @@ # limitations under the License. module ChefUtils - CHEFUTILS_ROOT = File.expand_path("../..", __FILE__) + CHEFUTILS_ROOT = File.expand_path("..", __dir__) VERSION = "15.13.2".freeze end diff --git a/chef-utils/spec/unit/dsl/introspection_spec.rb b/chef-utils/spec/unit/dsl/introspection_spec.rb index 44a228061d..9275a9fc79 100644 --- a/chef-utils/spec/unit/dsl/introspection_spec.rb +++ b/chef-utils/spec/unit/dsl/introspection_spec.rb @@ -21,6 +21,7 @@ RSpec.describe ChefUtils::DSL::Introspection do class IntrospectionTestClass include ChefUtils::DSL::Introspection attr_accessor :node + def initialize(node) @node = node end diff --git a/chef-utils/spec/unit/dsl/platform_spec.rb b/chef-utils/spec/unit/dsl/platform_spec.rb index 69efae877c..93b61f0532 100644 --- a/chef-utils/spec/unit/dsl/platform_spec.rb +++ b/chef-utils/spec/unit/dsl/platform_spec.rb @@ -58,6 +58,7 @@ RSpec.describe ChefUtils::DSL::Platform do class ThingWithANode include ChefUtils::DSL::Platform attr_accessor :node + def initialize(node) @node = node end @@ -69,6 +70,7 @@ RSpec.describe ChefUtils::DSL::Platform do attr_accessor :node end attr_accessor :run_context + def initialize(node) @run_context = RunContext.new run_context.node = node @@ -78,6 +80,7 @@ RSpec.describe ChefUtils::DSL::Platform do class ThingWithTheDSL include ChefUtils attr_accessor :node + def initialize(node) @node = node end -- cgit v1.2.1