summaryrefslogtreecommitdiff
path: root/tasks
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-09-08 23:57:36 -0700
committerTim Smith <tsmith84@gmail.com>2020-09-09 15:01:13 -0700
commitbd6f49e04f56729853f54f2d2d94356edc2c6e8c (patch)
treeb5dafed28e255c193c3b2996ccd7f52b88054801 /tasks
parentb6c2173bf578a8f1b44aeea2bc5eef9288e48964 (diff)
downloadchef-bd6f49e04f56729853f54f2d2d94356edc2c6e8c.tar.gz
Use __dir__ instead of getting the dir of __FILE__
This is a bit easier to read Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'tasks')
-rwxr-xr-xtasks/bin/run_external_test2
-rwxr-xr-xtasks/docs.rb2
-rw-r--r--tasks/rspec.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/tasks/bin/run_external_test b/tasks/bin/run_external_test
index 16f21d8e37..e4d984e9ee 100755
--- a/tasks/bin/run_external_test
+++ b/tasks/bin/run_external_test
@@ -6,7 +6,7 @@
# of the chef / ohai repos. It let's us know if we need to update downstream
# gems or fix regressions in chef *before* we release.
-$:.unshift(File.expand_path("../../lib", File.dirname(__FILE__)))
+$:.unshift(File.expand_path("../../lib", __dir__))
require "tmpdir"
require "bundler"
diff --git a/tasks/docs.rb b/tasks/docs.rb
index 2327a928c7..586115f2f9 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -5,7 +5,7 @@ namespace :docs_site do
task :resources do
Encoding.default_external = Encoding::UTF_8
- $:.unshift(File.expand_path(File.join(File.dirname(__FILE__), "lib")))
+ $:.unshift(File.expand_path(File.join(__dir__, "lib")))
require "chef/resource_inspector"
require "fileutils"
diff --git a/tasks/rspec.rb b/tasks/rspec.rb
index 647efd647a..a10479f3ed 100644
--- a/tasks/rspec.rb
+++ b/tasks/rspec.rb
@@ -20,7 +20,7 @@
require "rubygems"
require "rake"
-CHEF_ROOT = File.join(File.dirname(__FILE__), "..")
+CHEF_ROOT = File.join(__dir__, "..")
begin
require "rspec/core/rake_task"