From c0afe7fe5ba3029d2e02058af5b181192df3f14c Mon Sep 17 00:00:00 2001 From: Frank Taillandier Date: Fri, 25 Aug 2017 17:36:00 +0200 Subject: [PATCH] define path with __dir__ --- jekyll-gist.gemspec | 2 +- spec/spec_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jekyll-gist.gemspec b/jekyll-gist.gemspec index 8b62a2a..4cb71bc 100644 --- a/jekyll-gist.gemspec +++ b/jekyll-gist.gemspec @@ -1,5 +1,5 @@ # coding: utf-8 -lib = File.expand_path('../lib', __FILE__) +lib = File.expand_path('lib', __dir__) $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'jekyll-gist/version' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 95b55d7..8c53c4a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,4 @@ -TEST_DIR = File.dirname(__FILE__) +TEST_DIR = __dir__ TMP_DIR = File.expand_path("../tmp", TEST_DIR) require 'webmock/rspec' @@ -43,7 +43,7 @@ def site(opts = {}) end def fixture(name) - path = File.expand_path "./fixtures/#{name}.json", File.dirname(__FILE__) + path = File.expand_path "fixtures/#{name}.json", __dir__ File.open(path).read end end