lib/madvertise/boot.rb in madvertise-ext-0.8.0 vs lib/madvertise/boot.rb in madvertise-ext-0.9.0

- old
+ new

@@ -1,51 +1,13 @@ # encoding: utf-8 $:.unshift(ROOT) if defined?(ROOT) -if RUBY_PLATFORM == 'java' - begin - require 'jbundler' - rescue LoadError - # do nothing - end - - # some java libraries cannot be found on maven central, so we load all bundled - # jar files here for convenience - if defined?(ROOT) - Dir[File.join(ROOT, 'jars', '*.jar')].each do |f| - require f - end - end -end - -# load a bunch of common classes here, so we don't have to track and repeat it -# everywhere -require 'active_support/all' -require 'cgi' -require 'date' -require 'json' -require 'socket' +# load default configuration require 'madvertise-logging' +require 'madvertise/configuration' -# load all madvertise extensions -Dir[File.join(File.dirname(__FILE__), 'ext', '*.rb')].each do |f| - require f -end - -blacklist = [ - 'tasks.rb', - 'gc_stats.rb', - 'sysconf.rb', - 'proc_stat.rb', -] - -Dir[File.join(File.dirname(__FILE__), '*.rb')].each do |f| - require f unless blacklist.include?(File.basename(f)) -end - -# load default configuration $conf = Configuration.new # configuration-reloading callbacks reload_logger = ->(conf) do ImprovedLogger::Formatter.format = conf.log_format @@ -76,5 +38,41 @@ # reload configuration, trigger callbacks $conf.callback(&reload_mixins) $conf.callback(&reload_logger) $conf.reload! + +# load java dependencies +if RUBY_PLATFORM == 'java' + begin + require 'jbundler' + rescue LoadError + # do nothing + end + + # some java libraries cannot be found on maven central, so we load all bundled + # jar files here for convenience + if defined?(ROOT) + Dir[File.join(ROOT, 'jars', '*.jar')].each do |f| + require f + end + end +end + +# load a bunch of common classes here, so we don't have to track and repeat it +# everywhere +require 'active_support/all' +require 'cgi' +require 'date' +require 'json' +require 'socket' + +# load all madvertise extensions +Dir[File.join(File.dirname(__FILE__), 'ext', '*.rb')].each do |f| + require f +end + +require 'madvertise/cli' +require 'madvertise/environment' +require 'madvertise/from_file' +require 'madvertise/hash_helper' +require 'madvertise/transaction_id'