-
Notifications
You must be signed in to change notification settings - Fork 27
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
Define path with __dir__ #69
Conversation
lib/jekyll/webmention_io.rb
Outdated
@@ -200,8 +200,8 @@ def self.get_template_contents(template) | |||
template_file = Jekyll::WebmentionIO.config["templates"][template] | |||
else | |||
# Jekyll::WebmentionIO::log 'info', "Using default #{template} template" | |||
template_file = File.join(File.dirname(File.expand_path(__FILE__)), "templates/#{template}.html") | |||
end | |||
template_file = File.join(File.expand_path(__dir__), "templates/#{template}.html") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template_file = File.expand_path("templates/#{template}.html", __dir__)
lib/jekyll/generators/compile_js.rb
Outdated
@@ -39,7 +39,7 @@ def generate(site) | |||
|
|||
config = config.merge(site_config) | |||
|
|||
source = File.join(File.dirname(File.expand_path(__FILE__)), "../assets/") | |||
source = File.join(File.expand_path(__dir__), "assets/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source = File.expand_path("../assets/", __dir__)
spec/spec_helper.rb
Outdated
require "jekyll" | ||
require "jekyll-webmention_io" | ||
require "html-proofer" | ||
|
||
ENV["JEKYLL_LOG_LEVEL"] = "error" | ||
|
||
def dest_dir | ||
File.expand_path("../tmp/dest", File.dirname(__FILE__)) | ||
File.expand_path("tmp/dest", __dir__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File.expand_path("../tmp/dest", __dir__)
@bogdanvlviv addressed your feedback 👍 |
Looks good. |
Inspired by https://bogdanvlviv.github.io/posts/ruby/with-__dir__-we-can-restore-order-in-the-universe.html
/cc @bogdanvlviv