archangel 0.0.8 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/.jshintrc +1 -1
  3. data/.reek.yml +42 -0
  4. data/.rubocop.yml +1 -12
  5. data/.rubocop_exclude.yml +12 -0
  6. data/.rubocop_todo.yml +0 -4
  7. data/.travis.yml +5 -7
  8. data/Gemfile +12 -14
  9. data/MIT-LICENSE +1 -1
  10. data/README.md +1 -1
  11. data/app/controllers/archangel/application_controller.rb +0 -2
  12. data/app/controllers/archangel/auth/registrations_controller.rb +12 -0
  13. data/app/controllers/archangel/backend/assets_controller.rb +10 -259
  14. data/app/controllers/archangel/backend/collections_controller.rb +5 -214
  15. data/app/controllers/archangel/backend/entries_controller.rb +25 -239
  16. data/app/controllers/archangel/backend/pages_controller.rb +11 -261
  17. data/app/controllers/archangel/backend/profiles_controller.rb +19 -12
  18. data/app/controllers/archangel/backend/sites_controller.rb +17 -16
  19. data/app/controllers/archangel/backend/templates_controller.rb +5 -232
  20. data/app/controllers/archangel/backend/users_controller.rb +10 -260
  21. data/app/controllers/archangel/backend/widgets_controller.rb +5 -226
  22. data/app/controllers/archangel/frontend/pages_controller.rb +6 -7
  23. data/app/controllers/concerns/archangel/actionable_concern.rb +9 -0
  24. data/app/controllers/concerns/archangel/controllers/backend/resourceful_concern.rb +28 -0
  25. data/app/controllers/concerns/archangel/controllers/resourceful_concern.rb +258 -0
  26. data/app/controllers/concerns/archangel/paginatable_concern.rb +2 -0
  27. data/app/controllers/concerns/archangel/seoable_concern.rb +9 -8
  28. data/app/models/archangel/metatag.rb +12 -0
  29. data/app/models/archangel/page.rb +7 -1
  30. data/app/models/archangel/site.rb +6 -1
  31. data/app/models/archangel/user.rb +7 -0
  32. data/app/views/archangel/backend/pages/_form.html.erb +12 -2
  33. data/app/views/archangel/backend/pages/_metatag_fields.html.erb +6 -0
  34. data/app/views/archangel/backend/pages/show.html.erb +0 -10
  35. data/app/views/archangel/backend/profiles/_form.html.erb +2 -0
  36. data/app/views/archangel/backend/sites/_form.html.erb +11 -2
  37. data/app/views/archangel/backend/sites/_metatag_fields.html.erb +6 -0
  38. data/app/views/archangel/backend/sites/show.html.erb +0 -10
  39. data/app/views/archangel/frontend/pages/show.json.jbuilder +1 -2
  40. data/archangel.gemspec +18 -11
  41. data/bin/archangel +6 -4
  42. data/config/locales/active_record.en.yml +3 -4
  43. data/config/locales/en.yml +6 -0
  44. data/db/migrate/20190101220919_add_preferences_to_archangel_users.rb +5 -0
  45. data/db/migrate/20190113130750_create_archangel_metatags.rb +14 -0
  46. data/db/migrate/20190113130751_remove_meta_keywords_and_meta_description_from_archangel_pages.rb +6 -0
  47. data/db/migrate/20190113130752_remove_meta_keywords_and_meta_description_from_archangel_sites.rb +6 -0
  48. data/docs/Developers.md +2 -2
  49. data/docs/Extension/Developers.md +1 -1
  50. data/docs/Extension/Uploaders.md +53 -1
  51. data/docs/Theme/Developers.md +8 -2
  52. data/lib/archangel.rb +2 -2
  53. data/lib/archangel/commands/base_command.rb +35 -0
  54. data/lib/archangel/commands/extension_command.rb +128 -0
  55. data/lib/archangel/{command/templates/extension → commands/templates/common}/.editorconfig +0 -0
  56. data/lib/archangel/{command/templates/extension → commands/templates/common}/.gitignore +0 -0
  57. data/lib/archangel/{command/templates/extension → commands/templates/common}/.rspec +0 -0
  58. data/lib/archangel/{command/templates/extension → commands/templates/common}/.rubocop.yml +0 -0
  59. data/lib/archangel/{command/templates/extension → commands/templates/common}/MIT-LICENSE +0 -0
  60. data/lib/archangel/{command/templates/extension → commands/templates/common}/spec/rails_helper.rb.tt +0 -3
  61. data/lib/archangel/{command/templates/extension → commands/templates/common}/spec/spec_helper.rb +0 -0
  62. data/lib/archangel/{command/templates/extension → commands/templates/common}/spec/support/.keep +0 -0
  63. data/lib/archangel/{command → commands}/templates/extension/Gemfile +9 -10
  64. data/lib/archangel/{command → commands}/templates/extension/README.md +0 -0
  65. data/lib/archangel/{command → commands}/templates/extension/Rakefile +0 -0
  66. data/lib/archangel/{command → commands}/templates/extension/app/assets/javascripts/archangel/auth/%extension_name%.js.tt +0 -0
  67. data/lib/archangel/{command → commands}/templates/extension/app/assets/javascripts/archangel/backend/%extension_name%.js.tt +0 -0
  68. data/lib/archangel/{command → commands}/templates/extension/app/assets/javascripts/archangel/frontend/%extension_name%.js.tt +0 -0
  69. data/lib/archangel/{command → commands}/templates/extension/app/assets/stylesheets/archangel/auth/%extension_name%.css.tt +0 -0
  70. data/lib/archangel/{command → commands}/templates/extension/app/assets/stylesheets/archangel/backend/%extension_name%.css.tt +0 -0
  71. data/lib/archangel/{command → commands}/templates/extension/app/assets/stylesheets/archangel/frontend/%extension_name%.css.tt +0 -0
  72. data/lib/archangel/{command → commands}/templates/extension/bin/rails.tt +0 -0
  73. data/lib/archangel/{command → commands}/templates/extension/config/locales/en.yml.tt +0 -0
  74. data/lib/archangel/{command → commands}/templates/extension/config/routes.rb +0 -0
  75. data/lib/archangel/{command/templates/extension/extension.gemspec → commands/templates/extension/extension.gemspec.tt} +0 -0
  76. data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%.rb.tt +0 -0
  77. data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%/engine.rb.tt +0 -0
  78. data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%/factories.rb.tt +0 -0
  79. data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%/version.rb.tt +0 -0
  80. data/lib/archangel/{command → commands}/templates/extension/lib/generators/%extension_name%/install/install_generator.rb.tt +0 -0
  81. data/lib/archangel/commands/templates/theme/Gemfile +27 -0
  82. data/lib/archangel/commands/templates/theme/README.md +44 -0
  83. data/lib/archangel/commands/templates/theme/Rakefile +29 -0
  84. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/javascripts/%theme_base_name%/auth.js +2 -0
  85. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/javascripts/%theme_base_name%/backend.js +2 -0
  86. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/javascripts/%theme_base_name%/frontend.js +2 -0
  87. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/stylesheets/%theme_base_name%/auth.css +4 -0
  88. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/stylesheets/%theme_base_name%/backend.css +4 -0
  89. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/stylesheets/%theme_base_name%/frontend.css +4 -0
  90. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/config/locales/en.yml.tt +4 -0
  91. data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/views/layouts/frontend.liquid +18 -0
  92. data/lib/archangel/commands/templates/theme/bin/rails.tt +11 -0
  93. data/lib/archangel/commands/templates/theme/lib/%theme_name%.rb.tt +9 -0
  94. data/lib/archangel/commands/templates/theme/lib/%theme_name%/engine.rb.tt +29 -0
  95. data/lib/archangel/commands/templates/theme/lib/%theme_name%/version.rb.tt +5 -0
  96. data/lib/archangel/commands/templates/theme/theme.gemspec.tt +25 -0
  97. data/lib/archangel/commands/theme_command.rb +129 -0
  98. data/lib/archangel/config.rb +11 -2
  99. data/lib/archangel/liquid/drop.rb +26 -0
  100. data/lib/archangel/liquid/drops/page_drop.rb +1 -1
  101. data/lib/archangel/liquid/drops/site_drop.rb +1 -1
  102. data/lib/archangel/liquid/filters/link_to_filter.rb +1 -0
  103. data/lib/archangel/liquid/tags/application_tag.rb +18 -5
  104. data/lib/archangel/liquid/tags/collection_tag.rb +1 -1
  105. data/lib/archangel/liquid/tags/csrf_meta_tags_tag.rb +1 -0
  106. data/lib/archangel/liquid/tags/locale_tag.rb +1 -0
  107. data/lib/archangel/liquid/tags/meta_tags_tag.rb +1 -0
  108. data/lib/archangel/liquid/tags/noembed_tag.rb +140 -0
  109. data/lib/archangel/liquid/tags/text_direction_tag.rb +1 -0
  110. data/lib/archangel/liquid/tags/theme_javascript_tag.rb +1 -0
  111. data/lib/archangel/liquid/tags/theme_stylesheet_tag.rb +1 -0
  112. data/lib/archangel/testing_support/factories/archangel_assets.rb +2 -2
  113. data/lib/archangel/testing_support/factories/archangel_collections.rb +1 -1
  114. data/lib/archangel/testing_support/factories/archangel_entries.rb +1 -1
  115. data/lib/archangel/testing_support/factories/archangel_fields.rb +4 -4
  116. data/lib/archangel/testing_support/factories/archangel_metatags.rb +21 -0
  117. data/lib/archangel/testing_support/factories/archangel_pages.rb +5 -7
  118. data/lib/archangel/testing_support/factories/archangel_sites.rb +1 -3
  119. data/lib/archangel/testing_support/factories/archangel_templates.rb +7 -7
  120. data/lib/archangel/testing_support/factories/archangel_users.rb +10 -10
  121. data/lib/archangel/testing_support/factories/archangel_widgets.rb +2 -2
  122. data/lib/archangel/testing_support/matchers/have_meta.rb +18 -0
  123. data/lib/archangel/testing_support/matchers/have_title.rb +18 -0
  124. data/lib/archangel/testing_support/rake/dummy_rake.rb +0 -2
  125. data/lib/archangel/version.rb +1 -1
  126. data/lib/generators/archangel/install/templates/config/archangel.yml +52 -37
  127. data/spec/controllers/archangel/backend/entries_controller_spec.rb +3 -3
  128. data/spec/controllers/archangel/backend/pages_controller_spec.rb +17 -1
  129. data/spec/controllers/archangel/backend/profiles_controller_spec.rb +1 -1
  130. data/spec/controllers/archangel/backend/sites_controller_spec.rb +6 -6
  131. data/spec/controllers/archangel/backend/users_controller_spec.rb +2 -2
  132. data/spec/controllers/archangel/frontend/pages_controller_spec.rb +2 -6
  133. data/spec/controllers/concerns/archangel/controllers/backend/resourceful_concern_spec.rb +90 -0
  134. data/spec/features/auth/registration_spec.rb +18 -0
  135. data/spec/features/frontend/liquid_drop_variables_spec.rb +51 -57
  136. data/spec/features/frontend/pages/homepage_redirect_spec.rb +2 -2
  137. data/spec/features/frontend/pages/metatags_spec.rb +73 -0
  138. data/spec/helpers/archangel/flash_helper_spec.rb +14 -0
  139. data/spec/lib/archangel/{command/extension_spec.rb → commands/extension_command_spec.rb} +3 -3
  140. data/spec/lib/archangel/commands/theme_command_spec.rb +100 -0
  141. data/spec/lib/archangel/liquid/drops/page_drop_spec.rb +1 -9
  142. data/spec/lib/archangel/liquid/drops/site_drop_spec.rb +2 -12
  143. data/spec/lib/archangel/liquid/tags/noembed_tag_spec.rb +76 -0
  144. data/spec/mailers/archangel/{application_job_spec.rb → application_mailer_spec.rb} +0 -0
  145. data/spec/models/archangel/metatag_spec.rb +22 -0
  146. data/spec/models/archangel/page_spec.rb +5 -2
  147. data/spec/models/archangel/site_spec.rb +2 -0
  148. data/spec/rails_helper.rb +1 -0
  149. data/spec/uploaders/archangel/application_uploader_spec.rb +1 -1
  150. data/spec/uploaders/archangel/asset_uploader_spec.rb +1 -1
  151. metadata +108 -93
  152. data/.reek +0 -44
  153. data/lib/archangel/command/extension.rb +0 -97
@@ -0,0 +1,4 @@
1
+ en:
2
+ archangel:
3
+ hello: "Hello world"
4
+ <%= theme_name %>: <%= class_name %>
@@ -0,0 +1,18 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head dir="{% text_direction %}" lang="{% locale %}">
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
6
+
7
+ {% meta_tags %}
8
+
9
+ {% csrf_meta_tags %}
10
+
11
+ {% theme_stylesheet %}
12
+ </head>
13
+ <body>
14
+ {{ content_for_layout }}
15
+
16
+ {% theme_javascript %}
17
+ </body>
18
+ </html>
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ENGINE_ROOT = File.expand_path("../..", __FILE__)
4
+ ENGINE_PATH = File.expand_path("../../lib/<%= theme_name %>/engine", __FILE__)
5
+
6
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
7
+
8
+ require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
9
+
10
+ require "rails/all"
11
+ require "rails/engine/commands"
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "archangel"
4
+
5
+ require "<%= theme_name %>/engine"
6
+ require "<%= theme_name %>/version"
7
+
8
+ module <%= class_name %>
9
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module <%= class_name %>
4
+ class Engine < ::Rails::Engine
5
+ require "archangel"
6
+
7
+ isolate_namespace Archangel
8
+ engine_name "<%= theme_name %>"
9
+
10
+ config.generators do |gen|
11
+ gen.test_framework :rspec,
12
+ fixtures: false,
13
+ view_specs: false,
14
+ helper_specs: true,
15
+ routing_specs: false,
16
+ controller_specs: true,
17
+ request_specs: true
18
+ gen.fixture_replacement :factory_bot, dir: "spec/factories"
19
+ end
20
+
21
+ def self.activate
22
+ Dir[File.join(__dir__, "../../app/**/*_decorator*.rb")].each do |klass|
23
+ Rails.application.config.cache_classes ? require(klass) : load(klass)
24
+ end
25
+ end
26
+
27
+ config.to_prepare(&method(:activate).to_proc)
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module <%= class_name %>
4
+ VERSION = "0.0.1".freeze
5
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.push File.expand_path("lib", __dir__)
4
+
5
+ require "<%= theme_name %>/version"
6
+
7
+ Gem::Specification.new do |s|
8
+ s.platform = Gem::Platform::RUBY
9
+ s.name = "<%= theme_name %>"
10
+ s.version = <%= class_name %>::VERSION
11
+ s.authors = ["Your Name"]
12
+ s.homepage = "https://github.com/USERNAME/<%= theme_name %>"
13
+ s.summary = "TODO: Summary of <%= class_name %>."
14
+ s.description = "TODO: Description of <%= class_name %>."
15
+ s.license = "MIT"
16
+
17
+ s.files = Dir[
18
+ "{app,config,db,lib}/**/*",
19
+ "MIT-LICENSE",
20
+ "Rakefile",
21
+ "README.md"
22
+ ]
23
+
24
+ s.add_dependency "archangel", "< 1.0"
25
+ end
@@ -0,0 +1,129 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+
5
+ require "archangel/commands/base_command"
6
+
7
+ module Archangel
8
+ ##
9
+ # Command line
10
+ #
11
+ module Commands
12
+ ##
13
+ # Generate Archangel theme
14
+ #
15
+ class ThemeCommand < BaseCommand
16
+ source_root File.expand_path("templates/theme", __dir__)
17
+
18
+ desc "Build an Archangel theme"
19
+ argument :theme_name, type: :string, desc: "Theme name", default: "sample"
20
+
21
+ ##
22
+ # Generate theme
23
+ #
24
+ # Usage
25
+ # archangel theme [THEME_NAME]
26
+ # bundle exec bin/archangel theme [THEME_NAME]
27
+ #
28
+ def generate
29
+ name_plugin
30
+ end
31
+
32
+ ##
33
+ # Create theme directory
34
+ #
35
+ def create_plugin_directory
36
+ empty_directory(theme_name)
37
+ end
38
+
39
+ ##
40
+ # Create theme .gemspec file
41
+ #
42
+ def create_plugin_gemspec
43
+ template("theme.gemspec", "#{theme_name}/#{theme_name}.gemspec")
44
+ end
45
+
46
+ ##
47
+ # Copy common directories that are shared with extension generator
48
+ #
49
+ def copy_common_directories
50
+ %w[spec].each do |dir|
51
+ directory("../common/#{dir}", "#{theme_name}/#{dir}")
52
+ end
53
+ end
54
+
55
+ ##
56
+ # Copy theme directories and chmod bin scripts
57
+ #
58
+ def copy_plugin_directories
59
+ %w[
60
+ app bin lib
61
+ ].each { |dir| directory(dir, "#{theme_name}/#{dir}") }
62
+
63
+ chmod("#{theme_name}/bin/rails", 0o755)
64
+ end
65
+
66
+ ##
67
+ # Copy common templates that are shared with extension generator
68
+ #
69
+ def copy_common_templates
70
+ %w[
71
+ .editorconfig .gitignore .rspec .rubocop.yml MIT-LICENSE
72
+ ].each do |tpl|
73
+ template("../common/#{tpl}", "#{theme_name}/#{tpl}")
74
+ end
75
+ end
76
+
77
+ ##
78
+ # Copy theme templates
79
+ #
80
+ def copy_plugin_templates
81
+ %w[
82
+ Gemfile Rakefile README.md
83
+ ].each { |tpl| template(tpl, "#{theme_name}/#{tpl}") }
84
+ end
85
+
86
+ ##
87
+ # Banner
88
+ #
89
+ # Say something nice
90
+ #
91
+ def banner
92
+ puts %(
93
+
94
+ ******************************************************************
95
+
96
+ Your theme has been generated with a gemspec dependency on
97
+ Archangel v#{archangel_version}
98
+
99
+ #{random_compliment}
100
+
101
+ ******************************************************************
102
+
103
+ )
104
+ end
105
+
106
+ no_tasks do
107
+ def class_name
108
+ plugin_class_name(theme_name)
109
+ end
110
+
111
+ def name_plugin
112
+ @theme_name = corrected_plugin_name
113
+ end
114
+
115
+ def theme_base_name
116
+ theme_name.sub(/^archangel_/, "").sub(/_theme$/, "")
117
+ end
118
+
119
+ def corrected_plugin_name
120
+ ext_name = theme_name.downcase
121
+ ext_name = "archangel_#{ext_name}" unless ext_name =~ /^archangel_/
122
+ ext_name = "#{ext_name}_theme" unless ext_name =~ /_theme$/
123
+
124
+ Thor::Util.snake_case(ext_name)
125
+ end
126
+ end
127
+ end
128
+ end
129
+ end
@@ -9,13 +9,22 @@ module Archangel
9
9
 
10
10
  attr_config allow_registration: false,
11
11
  asset_maximum_file_size: 2.megabytes,
12
- asset_extension_whitelist: %i[gif jpeg jpg png],
12
+ asset_extension_whitelist: %w[gif jpeg jpg png],
13
13
  auth_path: "account",
14
14
  backend_path: "backend",
15
15
  frontend_path: "",
16
- image_extension_whitelist: %i[gif jpeg jpg png],
16
+ image_extension_whitelist: %w[gif jpeg jpg png],
17
17
  image_maximum_file_size: 2.megabytes
18
18
 
19
+ ##
20
+ # Return a blog of key/values as a hash
21
+ #
22
+ # Example
23
+ # Archangel.config.keys_in([:foo, :bat]) => { foo: "bar", bat: "baz" }
24
+ #
25
+ # @param keys [Array] array of keys to find key/values for
26
+ # @return [Hash] key/value hash
27
+ #
19
28
  def keys_in(keys)
20
29
  to_h.select { |key| keys.include?(key) }
21
30
  end
@@ -19,6 +19,9 @@ module Archangel
19
19
  base._associations = {}
20
20
  end
21
21
 
22
+ ##
23
+ # Build attributes
24
+ #
22
25
  def self.attributes(*attrs)
23
26
  @_attributes.concat attrs
24
27
 
@@ -31,10 +34,18 @@ module Archangel
31
34
  end
32
35
  end
33
36
 
37
+ ##
38
+ # Initialize
39
+ #
34
40
  def initialize(object, _options = {})
35
41
  @object = object
36
42
  end
37
43
 
44
+ ##
45
+ # Hash of attributes
46
+ #
47
+ # @return [Hash] the attributes
48
+ #
38
49
  def attributes
39
50
  @attributes ||=
40
51
  self.class._attributes.dup.each_with_object({}) do |name, hash|
@@ -42,14 +53,29 @@ module Archangel
42
53
  end
43
54
  end
44
55
 
56
+ ##
57
+ # Object as JSON
58
+ #
59
+ # @return [Object] the JSON object
60
+ #
45
61
  def as_json(options = {})
46
62
  attributes.as_json(options)
47
63
  end
48
64
 
65
+ ##
66
+ # Object to JSON
67
+ #
68
+ # @return [Object] the JSON object
69
+ #
49
70
  def to_json(options = {})
50
71
  as_json.to_json(options)
51
72
  end
52
73
 
74
+ ##
75
+ # Object inspect
76
+ #
77
+ # @return [String] object inspect
78
+ #
53
79
  def inspect
54
80
  "#<#{self.class.name} " \
55
81
  "@object: #{object.inspect} @attributes: #{attributes.inspect}>"
@@ -10,7 +10,7 @@ module Archangel
10
10
  # Liquid drop for a Page
11
11
  #
12
12
  class PageDrop < Archangel::Liquid::Drop
13
- attributes :meta_description, :meta_keywords, :published_at, :title
13
+ attributes :published_at, :title
14
14
 
15
15
  # Page id as a string
16
16
  #
@@ -7,7 +7,7 @@ module Archangel
7
7
  # Liquid drop for a Site
8
8
  #
9
9
  class SiteDrop < Archangel::Liquid::Drop
10
- attributes :locale, :meta_description, :meta_keywords, :name
10
+ attributes :locale, :name
11
11
 
12
12
  # Original size Site logo URL
13
13
  #
@@ -20,6 +20,7 @@ module Archangel
20
20
  # @param link_text [String] string to link
21
21
  # @return [String] the link
22
22
  #
23
+ # :reek:UtilityFunction
23
24
  def link_to(link_text, *args)
24
25
  link = args.first
25
26
 
@@ -23,7 +23,7 @@ module Archangel
23
23
  |
24
24
  #{::Liquid::QuotedString}
25
25
  )
26
- /ox
26
+ /ox.freeze
27
27
 
28
28
  ##
29
29
  # Regex for tag syntax
@@ -33,7 +33,7 @@ module Archangel
33
33
  \s*
34
34
  (?<attributes>.*)
35
35
  \s*
36
- /omx
36
+ /omx.freeze
37
37
 
38
38
  ##
39
39
  # Regex for "key: value" attributes
@@ -47,7 +47,7 @@ module Archangel
47
47
  \:
48
48
  \s*
49
49
  (?<value>#{::Liquid::QuotedFragment})
50
- /ox
50
+ /ox.freeze
51
51
 
52
52
  ##
53
53
  # Slug and attributes syntax
@@ -60,7 +60,7 @@ module Archangel
60
60
  \s*
61
61
  (?<attributes>.*)
62
62
  \s*
63
- /omx
63
+ /omx.freeze
64
64
 
65
65
  ##
66
66
  # Slug syntax
@@ -68,7 +68,20 @@ module Archangel
68
68
  # Example
69
69
  # {% tag_name "[slug]" %}
70
70
  #
71
- SLUG_SYNTAX = /(?<slug>#{::Liquid::QuotedFragment}+)\s*/o
71
+ SLUG_SYNTAX = /(?<slug>#{::Liquid::QuotedFragment}+)\s*/o.freeze
72
+
73
+ ##
74
+ # URL and attributes syntax
75
+ #
76
+ # Example
77
+ # {% tag_name "[url]" [attributes] %}
78
+ #
79
+ URL_ATTRIBUTES_SYNTAX = /
80
+ (?<url>#{::Liquid::QuotedFragment}+)
81
+ \s*
82
+ (?<attributes>.*)
83
+ \s*
84
+ /omx.freeze
72
85
  end
73
86
  end
74
87
  end
@@ -30,7 +30,7 @@ module Archangel
30
30
  \s*
31
31
  (?<attributes>.*)
32
32
  \s*
33
- /omx
33
+ /omx.freeze
34
34
 
35
35
  ##
36
36
  # Collection for Liquid