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
data/.reek DELETED
@@ -1,44 +0,0 @@
1
- # https://github.com/troessner/reek/blob/master/defaults.reek
2
- ---
3
- exclude_paths:
4
- - db/migrate
5
- - spec/dummy
6
-
7
- BooleanParameter:
8
- enabled: false
9
-
10
- IrresponsibleModule:
11
- enabled: false
12
-
13
- UnusedPrivateMethod:
14
- enabled: true
15
-
16
- UtilityFunction:
17
- public_methods_only: true
18
-
19
- "app/controllers":
20
- IrresponsibleModule:
21
- enabled: false
22
- NestedIterators:
23
- max_allowed_nesting: 2
24
- UnusedPrivateMethod:
25
- enabled: false
26
- InstanceVariableAssumption:
27
- enabled: false
28
- "app/helpers":
29
- IrresponsibleModule:
30
- enabled: false
31
- UtilityFunction:
32
- enabled: false
33
- "app/inputs":
34
- InstanceVariableAssumption:
35
- enabled: false
36
- "app/mailers":
37
- InstanceVariableAssumption:
38
- enabled: false
39
- "app/policies":
40
- InstanceVariableAssumption:
41
- enabled: false
42
- "app/uploaders":
43
- UtilityFunction:
44
- enabled: false
@@ -1,97 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "thor"
4
-
5
- module Archangel
6
- ##
7
- # Command line
8
- #
9
- module Command
10
- ##
11
- # Generate Archangel extension
12
- #
13
- class Extension < Thor::Group
14
- include Thor::Actions
15
-
16
- source_root File.expand_path("templates/extension", __dir__)
17
-
18
- desc "Build an Archangel extension"
19
- argument :extension_name, type: :string,
20
- desc: "Extension name",
21
- default: "sample"
22
-
23
- ##
24
- # Generate extension
25
- #
26
- # Usage
27
- # archangel extension [EXTENSION_NAME]
28
- # bundle exec bin/archangel extension [EXTENSION_NAME]
29
- #
30
- def generate
31
- prefix_name
32
-
33
- empty_directory extension_name
34
-
35
- copy_directories
36
- copy_files
37
- end
38
-
39
- ##
40
- # Banner
41
- #
42
- # Say something nice
43
- #
44
- def banner
45
- puts %(
46
-
47
- ******************************************************************
48
-
49
- Your extension has been generated with a gemspec dependency on
50
- Archangel v#{archangel_version}
51
-
52
- You look lovely today by the way.
53
-
54
- ******************************************************************
55
-
56
- )
57
- end
58
-
59
- no_tasks do
60
- def class_name
61
- Thor::Util.camel_case extension_name
62
- end
63
-
64
- def archangel_version
65
- Archangel.version[/(.*)\./, 1]
66
- end
67
- end
68
-
69
- no_tasks do
70
- def prefix_name
71
- ext_name = extension_name.downcase
72
- ext_name = "archangel_#{ext_name}" unless ext_name =~ /^archangel_/
73
-
74
- @extension_name = Thor::Util.snake_case(ext_name)
75
- end
76
-
77
- def copy_directories
78
- %w[
79
- app bin config lib spec
80
- ].each { |dir| directory(dir, "#{extension_name}/#{dir}") }
81
-
82
- chmod("#{extension_name}/bin/rails", 0o755)
83
- end
84
-
85
- def copy_files
86
- %w[
87
- .editorconfig .gitignore .rspec .rubocop.yml Gemfile MIT-LICENSE
88
- Rakefile README.md
89
- ].each { |tpl| template(tpl, "#{extension_name}/#{tpl}") }
90
-
91
- template("extension.gemspec",
92
- "#{extension_name}/#{extension_name}.gemspec")
93
- end
94
- end
95
- end
96
- end
97
- end