Skip to content

Commit

Permalink
Switch expand_path on file to expand_path on dir
Browse files Browse the repository at this point in the history
Remove a .. here

Signed-off-by: Tim Smith <tsmith@chef.io>
  • Loading branch information
tas50 committed Aug 24, 2020
1 parent 3eae1cd commit 48d99b4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/omnibus
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# https://twitter.com/mitchellh/status/283014103189053442
Signal.trap("INT") { exit 1 }

$:.push File.expand_path("../../lib", __FILE__)
$:.push File.expand_path("../lib", __dir__)
$stdout.sync = true

require "omnibus/cli"
Expand Down
2 changes: 1 addition & 1 deletion lib/omnibus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def project(name)
# @return [Pathname]
#
def source_root
@source_root ||= Pathname.new(File.expand_path("../..", __FILE__))
@source_root ||= Pathname.new(File.expand_path("..", __dir__))
end

#
Expand Down
2 changes: 1 addition & 1 deletion lib/omnibus/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class Generator < Thor::Group
class << self
# Set the source root for Thor
def source_root
File.expand_path("../generator_files", __FILE__)
File.expand_path("generator_files", __dir__)
end
end

Expand Down
2 changes: 1 addition & 1 deletion omnibus.gemspec
Original file line number Diff line number Diff line change
@@ -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 "omnibus/version"

Expand Down
4 changes: 2 additions & 2 deletions spec/support/path_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ def fixture_path(*pieces)
end

def tmp_path
File.expand_path("../../tmp", __FILE__)
File.expand_path("../tmp", __dir__)
end

private

def fixtures_path
File.expand_path("../../fixtures", __FILE__)
File.expand_path("../fixtures", __dir__)
end
end
end
Expand Down

0 comments on commit 48d99b4

Please sign in to comment.