Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch expand_path on file to expand_path on dir #959

Merged
merged 1 commit into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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