Change all constants to screaming case

This commit is contained in:
Mike Angell
2019-09-18 15:01:00 +10:00
parent adb40c41b7
commit a4ec6a08cb
21 changed files with 185 additions and 123 deletions

View File

@@ -1,12 +1,12 @@
# frozen_string_literal: true
class CommentForm < Liquid::Block
Syntax = /(#{Liquid::VariableSignature}+)/
SYNTAX = /(#{Liquid::VariableSignature}+)/
def initialize(tag_name, markup, options)
super
if markup =~ Syntax
if markup =~ SYNTAX
@variable_name = Regexp.last_match(1)
@attributes = {}
else

View File

@@ -1,12 +1,12 @@
# frozen_string_literal: true
class Paginate < Liquid::Block
Syntax = /(#{Liquid::QuotedFragment})\s*(by\s*(\d+))?/
SYNTAX = /(#{Liquid::QUOTED_FRAGMENT})\s*(by\s*(\d+))?/
def initialize(tag_name, markup, options)
super
if markup =~ Syntax
if markup =~ SYNTAX
@collection_name = Regexp.last_match(1)
@page_size = if Regexp.last_match(2)
Regexp.last_match(3).to_i
@@ -15,7 +15,7 @@ class Paginate < Liquid::Block
end
@attributes = { 'window_size' => 3 }
markup.scan(Liquid::TagAttributes) do |key, value|
markup.scan(Liquid::TAG_ATTRIBUTES) do |key, value|
@attributes[key] = value
end
else