summaryrefslogtreecommitdiff
path: root/chef-utils
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-07-07 15:28:50 -0700
committerTim Smith <tsmith84@gmail.com>2020-07-15 12:31:42 -0700
commitcb635d865bd3a0c386d7d361ee2251aae99a33bf (patch)
treee77ec61d1126102710da264832b2a6f935acfa5d /chef-utils
parentf681ac8e2a96c9f4ba38905054623315f625403b (diff)
downloadchef-cb635d865bd3a0c386d7d361ee2251aae99a33bf.tar.gz
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 <tsmith@chef.io>
Diffstat (limited to 'chef-utils')
-rw-r--r--chef-utils/chef-utils.gemspec2
-rw-r--r--chef-utils/lib/chef-utils/version.rb2
-rw-r--r--chef-utils/spec/unit/dsl/introspection_spec.rb1
-rw-r--r--chef-utils/spec/unit/dsl/platform_spec.rb3
4 files changed, 6 insertions, 2 deletions
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