lib/peek_a_view/configuration.rb in peek-a-view-0.0.2 vs lib/peek_a_view/configuration.rb in peek-a-view-0.0.3

- old
+ new

@@ -3,26 +3,26 @@ module PeekAView class Configuration < ActiveSupport::OrderedOptions def initialize(*) super - clear_stubs! + clear_views! end - def stubs_file - Array(stubs_path).map { |p| File.join(Rails.root, p) }.find { |p| File.file?(p) } + def views_file + Array(views_path).map { |p| File.join(Rails.root, p) }.find { |p| File.file?(p) } end - def load_stubs - clear_stubs! - if (file = stubs_file) + def load_views + clear_views! + if (file = views_file) load file else raise "No peek-a-view definitions found." # TODO proper exception class end end - def clear_stubs! + def clear_views! @views = { } @common = [] end def view(*names, &block) # :yields: a view object