archangel 0.0.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.jshintrc +1 -1
- data/.reek.yml +42 -0
- data/.rubocop.yml +1 -12
- data/.rubocop_exclude.yml +12 -0
- data/.rubocop_todo.yml +0 -4
- data/.travis.yml +5 -7
- data/Gemfile +12 -14
- data/MIT-LICENSE +1 -1
- data/README.md +1 -1
- data/app/controllers/archangel/application_controller.rb +0 -2
- data/app/controllers/archangel/auth/registrations_controller.rb +12 -0
- data/app/controllers/archangel/backend/assets_controller.rb +10 -259
- data/app/controllers/archangel/backend/collections_controller.rb +5 -214
- data/app/controllers/archangel/backend/entries_controller.rb +25 -239
- data/app/controllers/archangel/backend/pages_controller.rb +11 -261
- data/app/controllers/archangel/backend/profiles_controller.rb +19 -12
- data/app/controllers/archangel/backend/sites_controller.rb +17 -16
- data/app/controllers/archangel/backend/templates_controller.rb +5 -232
- data/app/controllers/archangel/backend/users_controller.rb +10 -260
- data/app/controllers/archangel/backend/widgets_controller.rb +5 -226
- data/app/controllers/archangel/frontend/pages_controller.rb +6 -7
- data/app/controllers/concerns/archangel/actionable_concern.rb +9 -0
- data/app/controllers/concerns/archangel/controllers/backend/resourceful_concern.rb +28 -0
- data/app/controllers/concerns/archangel/controllers/resourceful_concern.rb +258 -0
- data/app/controllers/concerns/archangel/paginatable_concern.rb +2 -0
- data/app/controllers/concerns/archangel/seoable_concern.rb +9 -8
- data/app/models/archangel/metatag.rb +12 -0
- data/app/models/archangel/page.rb +7 -1
- data/app/models/archangel/site.rb +6 -1
- data/app/models/archangel/user.rb +7 -0
- data/app/views/archangel/backend/pages/_form.html.erb +12 -2
- data/app/views/archangel/backend/pages/_metatag_fields.html.erb +6 -0
- data/app/views/archangel/backend/pages/show.html.erb +0 -10
- data/app/views/archangel/backend/profiles/_form.html.erb +2 -0
- data/app/views/archangel/backend/sites/_form.html.erb +11 -2
- data/app/views/archangel/backend/sites/_metatag_fields.html.erb +6 -0
- data/app/views/archangel/backend/sites/show.html.erb +0 -10
- data/app/views/archangel/frontend/pages/show.json.jbuilder +1 -2
- data/archangel.gemspec +18 -11
- data/bin/archangel +6 -4
- data/config/locales/active_record.en.yml +3 -4
- data/config/locales/en.yml +6 -0
- data/db/migrate/20190101220919_add_preferences_to_archangel_users.rb +5 -0
- data/db/migrate/20190113130750_create_archangel_metatags.rb +14 -0
- data/db/migrate/20190113130751_remove_meta_keywords_and_meta_description_from_archangel_pages.rb +6 -0
- data/db/migrate/20190113130752_remove_meta_keywords_and_meta_description_from_archangel_sites.rb +6 -0
- data/docs/Developers.md +2 -2
- data/docs/Extension/Developers.md +1 -1
- data/docs/Extension/Uploaders.md +53 -1
- data/docs/Theme/Developers.md +8 -2
- data/lib/archangel.rb +2 -2
- data/lib/archangel/commands/base_command.rb +35 -0
- data/lib/archangel/commands/extension_command.rb +128 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/.editorconfig +0 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/.gitignore +0 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/.rspec +0 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/.rubocop.yml +0 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/MIT-LICENSE +0 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/spec/rails_helper.rb.tt +0 -3
- data/lib/archangel/{command/templates/extension → commands/templates/common}/spec/spec_helper.rb +0 -0
- data/lib/archangel/{command/templates/extension → commands/templates/common}/spec/support/.keep +0 -0
- data/lib/archangel/{command → commands}/templates/extension/Gemfile +9 -10
- data/lib/archangel/{command → commands}/templates/extension/README.md +0 -0
- data/lib/archangel/{command → commands}/templates/extension/Rakefile +0 -0
- data/lib/archangel/{command → commands}/templates/extension/app/assets/javascripts/archangel/auth/%extension_name%.js.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/app/assets/javascripts/archangel/backend/%extension_name%.js.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/app/assets/javascripts/archangel/frontend/%extension_name%.js.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/app/assets/stylesheets/archangel/auth/%extension_name%.css.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/app/assets/stylesheets/archangel/backend/%extension_name%.css.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/app/assets/stylesheets/archangel/frontend/%extension_name%.css.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/bin/rails.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/config/locales/en.yml.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/config/routes.rb +0 -0
- data/lib/archangel/{command/templates/extension/extension.gemspec → commands/templates/extension/extension.gemspec.tt} +0 -0
- data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%.rb.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%/engine.rb.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%/factories.rb.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/lib/%extension_name%/version.rb.tt +0 -0
- data/lib/archangel/{command → commands}/templates/extension/lib/generators/%extension_name%/install/install_generator.rb.tt +0 -0
- data/lib/archangel/commands/templates/theme/Gemfile +27 -0
- data/lib/archangel/commands/templates/theme/README.md +44 -0
- data/lib/archangel/commands/templates/theme/Rakefile +29 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/javascripts/%theme_base_name%/auth.js +2 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/javascripts/%theme_base_name%/backend.js +2 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/javascripts/%theme_base_name%/frontend.js +2 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/stylesheets/%theme_base_name%/auth.css +4 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/stylesheets/%theme_base_name%/backend.css +4 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/assets/stylesheets/%theme_base_name%/frontend.css +4 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/config/locales/en.yml.tt +4 -0
- data/lib/archangel/commands/templates/theme/app/themes/%theme_base_name%/views/layouts/frontend.liquid +18 -0
- data/lib/archangel/commands/templates/theme/bin/rails.tt +11 -0
- data/lib/archangel/commands/templates/theme/lib/%theme_name%.rb.tt +9 -0
- data/lib/archangel/commands/templates/theme/lib/%theme_name%/engine.rb.tt +29 -0
- data/lib/archangel/commands/templates/theme/lib/%theme_name%/version.rb.tt +5 -0
- data/lib/archangel/commands/templates/theme/theme.gemspec.tt +25 -0
- data/lib/archangel/commands/theme_command.rb +129 -0
- data/lib/archangel/config.rb +11 -2
- data/lib/archangel/liquid/drop.rb +26 -0
- data/lib/archangel/liquid/drops/page_drop.rb +1 -1
- data/lib/archangel/liquid/drops/site_drop.rb +1 -1
- data/lib/archangel/liquid/filters/link_to_filter.rb +1 -0
- data/lib/archangel/liquid/tags/application_tag.rb +18 -5
- data/lib/archangel/liquid/tags/collection_tag.rb +1 -1
- data/lib/archangel/liquid/tags/csrf_meta_tags_tag.rb +1 -0
- data/lib/archangel/liquid/tags/locale_tag.rb +1 -0
- data/lib/archangel/liquid/tags/meta_tags_tag.rb +1 -0
- data/lib/archangel/liquid/tags/noembed_tag.rb +140 -0
- data/lib/archangel/liquid/tags/text_direction_tag.rb +1 -0
- data/lib/archangel/liquid/tags/theme_javascript_tag.rb +1 -0
- data/lib/archangel/liquid/tags/theme_stylesheet_tag.rb +1 -0
- data/lib/archangel/testing_support/factories/archangel_assets.rb +2 -2
- data/lib/archangel/testing_support/factories/archangel_collections.rb +1 -1
- data/lib/archangel/testing_support/factories/archangel_entries.rb +1 -1
- data/lib/archangel/testing_support/factories/archangel_fields.rb +4 -4
- data/lib/archangel/testing_support/factories/archangel_metatags.rb +21 -0
- data/lib/archangel/testing_support/factories/archangel_pages.rb +5 -7
- data/lib/archangel/testing_support/factories/archangel_sites.rb +1 -3
- data/lib/archangel/testing_support/factories/archangel_templates.rb +7 -7
- data/lib/archangel/testing_support/factories/archangel_users.rb +10 -10
- data/lib/archangel/testing_support/factories/archangel_widgets.rb +2 -2
- data/lib/archangel/testing_support/matchers/have_meta.rb +18 -0
- data/lib/archangel/testing_support/matchers/have_title.rb +18 -0
- data/lib/archangel/testing_support/rake/dummy_rake.rb +0 -2
- data/lib/archangel/version.rb +1 -1
- data/lib/generators/archangel/install/templates/config/archangel.yml +52 -37
- data/spec/controllers/archangel/backend/entries_controller_spec.rb +3 -3
- data/spec/controllers/archangel/backend/pages_controller_spec.rb +17 -1
- data/spec/controllers/archangel/backend/profiles_controller_spec.rb +1 -1
- data/spec/controllers/archangel/backend/sites_controller_spec.rb +6 -6
- data/spec/controllers/archangel/backend/users_controller_spec.rb +2 -2
- data/spec/controllers/archangel/frontend/pages_controller_spec.rb +2 -6
- data/spec/controllers/concerns/archangel/controllers/backend/resourceful_concern_spec.rb +90 -0
- data/spec/features/auth/registration_spec.rb +18 -0
- data/spec/features/frontend/liquid_drop_variables_spec.rb +51 -57
- data/spec/features/frontend/pages/homepage_redirect_spec.rb +2 -2
- data/spec/features/frontend/pages/metatags_spec.rb +73 -0
- data/spec/helpers/archangel/flash_helper_spec.rb +14 -0
- data/spec/lib/archangel/{command/extension_spec.rb → commands/extension_command_spec.rb} +3 -3
- data/spec/lib/archangel/commands/theme_command_spec.rb +100 -0
- data/spec/lib/archangel/liquid/drops/page_drop_spec.rb +1 -9
- data/spec/lib/archangel/liquid/drops/site_drop_spec.rb +2 -12
- data/spec/lib/archangel/liquid/tags/noembed_tag_spec.rb +76 -0
- data/spec/mailers/archangel/{application_job_spec.rb → application_mailer_spec.rb} +0 -0
- data/spec/models/archangel/metatag_spec.rb +22 -0
- data/spec/models/archangel/page_spec.rb +5 -2
- data/spec/models/archangel/site_spec.rb +2 -0
- data/spec/rails_helper.rb +1 -0
- data/spec/uploaders/archangel/application_uploader_spec.rb +1 -1
- data/spec/uploaders/archangel/asset_uploader_spec.rb +1 -1
- metadata +108 -93
- data/.reek +0 -44
- 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
|