Skip to content
Browse files

Use actions and sources arrays defined in Deface::Override.

  • Loading branch information...
1 parent ebc9164 commit da4bf93a4ef013dbf67b70a26be7b8169c5ca6ed @mscottford committed Mar 24, 2012
Showing with 2 additions and 7 deletions.
  1. +2 −7 lib/deface/dsl/context.rb
View
9 lib/deface/dsl/context.rb
@@ -19,11 +19,7 @@ def virtual_path(name)
@virtual_path = name
end
- # actions
- [
- :remove, :replace, :replace_contents, :surround, :surround_contents,
- :insert_after, :insert_before, :insert_top, :insert_bottom, :set_attributes
- ].each do |action_name|
+ Deface::Override.actions.each do |action_name|
define_method(action_name) do |selector|
if @action.present?
Rails.logger.error "\e[1;32mDeface: [WARNING]\e[0m Multiple action methods have been called. The last one will be used."
@@ -33,8 +29,7 @@ def virtual_path(name)
end
end
- # sources
- [:text, :partial, :template].each do |source_name|
+ Deface::Override.sources.each do |source_name|
define_method(source_name) do |value|
if @source.present?
Rails.logger.error "\e[1;32mDeface: [WARNING]\e[0m Multiple source methods have been called. The last one will be used."

0 comments on commit da4bf93

Please sign in to comment.
Something went wrong with that request. Please try again.