lib/teamster.rb in teamster-0.2.2 vs lib/teamster.rb in teamster-0.3.0

- old
+ new

@@ -11,12 +11,12 @@ @@modules = [] @@views = [] @@title = 'TEAMSTER' CORE_CONFIG = 'conf/teamster.conf' - # NOTE: Methods used in configure block needs be declared before - # the configure block. + # NOTE: Class methods used in configure block needs be declared + # before the configure block. def self.set_default_options_from(core_opts) @@title = core_opts[:title] end def self.current_working_folder @@ -38,12 +38,14 @@ get '/' do erb :index end def summary_div_class_for(index) - size = available_modules.size - if size%2 == 0 + size = all_modules.size + if size == 1 + "col-lg-12" + elsif size%2 == 0 "col-lg-6" else last = size - 1 index == last ? "col-lg-12" : "col-lg-6" end @@ -56,11 +58,10 @@ else erb :no_summary end end - # NOTE: Class methods here are for module processing. def self.modules @@modules end def self.views @@ -78,10 +79,10 @@ @@modules << teamster_module @@views << teamster_module.views end teamster_module.helpers GeneralHelper if teamster_module.has_helper? - teamster_module.helper_module.each do |mod| + teamster_module.helper_module.flatten.each do |mod| helpers mod end end use teamster_module end