Be explicit when requiring formatters.

I think I prefer this explicitness over the prior
automatic importing code. It feels safer (it won't
load files that are placed into the formatters
folder that shouldn't be there) and it avoids the
issue we had in #145 where formatters can load in
arbitrary order.
This commit is contained in:
Sebastian Celis 2016-04-01 15:58:57 -04:00
parent ae31911a62
commit 035afe3df3
2 changed files with 8 additions and 5 deletions

View file

@ -28,6 +28,14 @@ module Twine
require 'twine/output_processor'
require 'twine/placeholders'
require 'twine/formatters'
require 'twine/formatters/abstract'
require 'twine/formatters/android'
require 'twine/formatters/apple'
require 'twine/formatters/django'
require 'twine/formatters/flash'
require 'twine/formatters/gettext'
require 'twine/formatters/jquery'
require 'twine/formatters/tizen'
require 'twine/runner'
require 'twine/version'
end

View file

@ -18,8 +18,3 @@ module Twine
end
end
end
require File.join(File.dirname(__FILE__), 'formatters', 'abstract.rb')
Dir[File.join(File.dirname(__FILE__), 'formatters', '*.rb')].each do |file|
require file
end