lib/stasis.rb in stasis-0.1.2 vs lib/stasis.rb in stasis-0.1.3

- old
+ new

@@ -94,10 +94,21 @@ # Create plugin instances. @plugins = find_plugins.collect { |klass| klass.new(self) } # Create a controller instance. @controller = Controller.new(self) + + # Reject paths that are controllers. + @paths.reject! do |path| + if File.basename(path) == 'controller.rb' + # Add controller to `Controller` instance. + @controller._add(path) + true + else + false + end + end end def render(*only) collect = {} render_options = {} @@ -122,20 +133,9 @@ end if only.empty? # Remove old generated files. FileUtils.rm_rf(destination) - end - - # Reject paths that are controllers. - @paths.reject! do |path| - if File.basename(path) == 'controller.rb' - # Add controller to `Controller` instance. - @controller._add(path) - true - else - false - end end # Trigger all plugin `before_all` events. trigger(:before_all) \ No newline at end of file