Mordernize code base with __dir__ and require_relative

This commit is contained in:
Jean Boussier
2015-05-13 15:33:00 -04:00
parent 9e815ec594
commit b31df0fb3d
11 changed files with 24 additions and 26 deletions
+1 -1
View File
@@ -73,4 +73,4 @@ require 'liquid/token'
# Load all the tags of the standard library
#
Dir[File.dirname(__FILE__) + '/liquid/tags/*.rb'].each { |f| require f }
Dir["#{__dir__}/liquid/tags/*.rb"].each { |f| require f }
+1 -1
View File
@@ -2,7 +2,7 @@ require 'yaml'
module Liquid
class I18n
DEFAULT_LOCALE = File.join(File.expand_path(File.dirname(__FILE__)), "locales", "en.yml")
DEFAULT_LOCALE = File.join(File.expand_path(__dir__), "locales", "en.yml")
TranslationError = Class.new(StandardError)
+1 -1
View File
@@ -1,4 +1,4 @@
require File.dirname(__FILE__) + '/if'
require_relative 'if'
module Liquid
# Unless is a conditional just like 'if' but works on the inverse logic.