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
+3 -3
View File
@@ -6,8 +6,8 @@
# Shopify which is likely the biggest user of liquid in the world which something to the tune of several
# million Template#render calls a day.
require File.dirname(__FILE__) + '/shopify/liquid'
require File.dirname(__FILE__) + '/shopify/database.rb'
require_relative 'shopify/liquid'
require_relative 'shopify/database'
class ThemeRunner
class FileSystem
@@ -25,7 +25,7 @@ class ThemeRunner
# Load all templates into memory, do this now so that
# we don't profile IO.
def initialize
@tests = Dir[File.dirname(__FILE__) + '/tests/**/*.liquid'].collect do |test|
@tests = Dir[__dir__ + '/tests/**/*.liquid'].collect do |test|
next if File.basename(test) == 'theme.liquid'
theme_path = File.dirname(test) + '/theme.liquid'