Define path with __dir__
Inspired by https://bogdanvlviv.github.io/posts/ruby/with-__dir__-we-can-restore-order-in-the-universe.html
This commit is contained in:
parent
e94055d116
commit
6d4f937f1a
@ -1,4 +1,4 @@
|
||||
require File.join(File.dirname(__FILE__), 'lib/jekyll/algolia/version.rb')
|
||||
require File.join(__dir__, 'lib/jekyll/algolia/version.rb')
|
||||
|
||||
Gem::Specification.new do |gem|
|
||||
# Required attributes
|
||||
|
||||
@ -40,7 +40,7 @@ module Jekyll
|
||||
def self.known_message(message_id, metadata = {})
|
||||
file = File.expand_path(
|
||||
File.join(
|
||||
File.dirname(__FILE__), '../../..', 'errors', "#{message_id}.txt"
|
||||
__dir__, '../..', 'errors', "#{message_id}.txt"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user