Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add TagCommon to a subdir for proper file loading

  • Loading branch information...
commit 39f433f265de6b042de4dc5cd19141a20ac2ad0c 1 parent add895c
@akaspick akaspick authored
Showing with 29 additions and 31 deletions.
  1. +29 −0 app/liquid/tags/cms/tag_common.rb
  2. +0 −31 app/liquid/tags/tag_common.rb
View
29 app/liquid/tags/cms/tag_common.rb
@@ -0,0 +1,29 @@
+module Cms::TagCommon
+ extend ActiveSupport::Memoizable
+
+ HyphenatedTagAttributes = /([\w-]+)\s*\:\s*(#{Liquid::QuotedFragment})/
+
+ def parse_options(context, markup)
+ begin
+ options = HashWithIndifferentAccess.new
+ return options if markup.blank?
+
+ markup.scan(HyphenatedTagAttributes) do |key, value|
+ options[key.to_sym] = context[value]
+ end
+
+ options
+ rescue ArgumentError => e
+ raise SyntaxError.new("Syntax Error in 'tag options' - Valid syntax: name:value")
+ end
+ end
+
+ def context_object(context)
+ context.registers[:context].object
+ end
+ memoize :context_object
+
+ def params(context)
+ context.registers[:controller].params.except(:controller, :action)
+ end
+end
View
31 app/liquid/tags/tag_common.rb
@@ -1,31 +0,0 @@
-module Cms
- module TagCommon
- extend ActiveSupport::Memoizable
-
- HyphenatedTagAttributes = /([\w-]+)\s*\:\s*(#{Liquid::QuotedFragment})/
-
- def parse_options(context, markup)
- begin
- options = HashWithIndifferentAccess.new
- return options if markup.blank?
-
- markup.scan(HyphenatedTagAttributes) do |key, value|
- options[key.to_sym] = context[value]
- end
-
- options
- rescue ArgumentError => e
- raise SyntaxError.new("Syntax Error in 'tag options' - Valid syntax: name:value")
- end
- end
-
- def context_object(context)
- context.registers[:context].object
- end
- memoize :context_object
-
- def params(context)
- context.registers[:controller].params.except(:controller, :action)
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.