alchemy_cms 6.0.11 → 6.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc9b537e2e01fab999228f1a8813bbd0c905d521639eeeb1413021c70e5add7e
4
- data.tar.gz: 6d93f0bb79d91d05a6cda0d9a1f6697fada5cd2de30bc11b7e5c879f98ebd1a4
3
+ metadata.gz: 706ea8d8bb121be924f467a6d367104dae78cf131a1a86bca33c08c75f377239
4
+ data.tar.gz: 8e8d3603be2b6b507c39a010b6231b2b3b753babb6556453741258699635a400
5
5
  SHA512:
6
- metadata.gz: 9640f98ba68fb3b85dcdf7edb966911eb148448838259981576f0f5da1e8a6511b2adf6c72753c5396b13ae7d3d42776ac160db9e5793b6b34f4cb5296e28910
7
- data.tar.gz: 59ab7f7c6097b79df1971212cae17cc587aadb93338b8e7a8131dfdea73756bb3e0ec0b5fd68726769b829e326b346bd0ce9832764bd613af131a4b21dfb8a76
6
+ metadata.gz: 00b2766205aba938284f4fef79e6d7e00c1271c243ab4b50faa63dff68e11cb47c2029bc4afd20f57c917966429083328a0ab9a3629ab9ede810793b60aa036a
7
+ data.tar.gz: ecfbc1794df353099fd1ec2454275c55d09c9521cb85591258f67707ed2cf6dc72f287ca99135373783710def1df11a3302066f51935772bcf84c56d94a8ba98
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 6.0.12 (2022-11-19)
2
+
3
+ - More installer options [#2385](https://github.com/AlchemyCMS/alchemy_cms/pull/2385) ([tvdeyen](https://github.com/tvdeyen))
4
+ - Fix custom module installer [#2384](https://github.com/AlchemyCMS/alchemy_cms/pull/2384) ([tvdeyen](https://github.com/tvdeyen))
5
+ - Always provide format with attachment URLs [#2383](https://github.com/AlchemyCMS/alchemy_cms/pull/2383) ([mamhoff](https://github.com/mamhoff))
6
+
1
7
  ## 6.0.11 (2022-09-22)
2
8
 
3
9
  - Do not touch pages when toggling element [#2377](https://github.com/AlchemyCMS/alchemy_cms/pull/2377) ([tvdeyen](https://github.com/tvdeyen))
@@ -23,6 +23,7 @@ module Alchemy
23
23
  # @return [String]
24
24
  #
25
25
  def call(options = {})
26
+ options[:format] ||= @attachment.suffix
26
27
  if options.delete(:download)
27
28
  routes.download_attachment_path(@attachment, options)
28
29
  else
@@ -18,12 +18,10 @@ module Alchemy
18
18
  inject_into_file "./config/routes.rb", "\n mount Alchemy::Engine => '#{mountpoint}'\n", { after: sentinel, verbose: true }
19
19
  end
20
20
 
21
- def set_primary_language(auto_accept = false)
22
- code = "en"
21
+ def set_primary_language(code: "en", name: "English", auto_accept: false)
23
22
  unless auto_accept
24
23
  code = ask("- What is the language code of your site's primary language?", default: code)
25
24
  end
26
- name = "English"
27
25
  unless auto_accept
28
26
  name = ask("- What is the name of your site's primary language?", default: name)
29
27
  end
@@ -32,13 +32,13 @@ module Alchemy
32
32
  defined_controllers = [definition_hash["navigation"]["controller"]]
33
33
 
34
34
  if definition_hash["navigation"]["sub_navigation"].is_a?(Array)
35
- defined_controllers.concat(definition_hash["navigation"]["sub_navigation"].map{ |x| x["controller"] })
35
+ defined_controllers.concat(definition_hash["navigation"]["sub_navigation"].map { |x| x["controller"] })
36
36
  end
37
37
 
38
38
  validate_controllers_existence(defined_controllers)
39
39
  end
40
40
 
41
- @@alchemy_modules << definition_hash
41
+ @@alchemy_modules |= [definition_hash]
42
42
  end
43
43
 
44
44
  private
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Alchemy
4
- VERSION = "6.0.11"
4
+ VERSION = "6.0.12"
5
5
 
6
6
  def self.version
7
7
  VERSION
@@ -26,7 +26,22 @@ module Alchemy
26
26
  class_option :skip_db_create,
27
27
  type: :boolean,
28
28
  default: false,
29
- desc: "Skip creting the database during install."
29
+ desc: "Skip creating the database during install."
30
+
31
+ class_option :skip_mount,
32
+ type: :boolean,
33
+ default: false,
34
+ desc: "Skip mounting into routes.rb during install."
35
+
36
+ class_option :default_language_code,
37
+ type: :string,
38
+ default: "en",
39
+ desc: "The default language code of your site."
40
+
41
+ class_option :default_language_name,
42
+ type: :string,
43
+ default: "English",
44
+ desc: "The default language name of your site."
30
45
 
31
46
  source_root File.expand_path("files", __dir__)
32
47
 
@@ -34,6 +49,11 @@ module Alchemy
34
49
  header
35
50
  say "Welcome to AlchemyCMS!"
36
51
  say "Let's begin with some questions.\n\n"
52
+ end
53
+
54
+ def mount
55
+ return if options[:skip_mount]
56
+
37
57
  install_tasks.inject_routes(options[:auto_accept])
38
58
  end
39
59
 
@@ -108,13 +128,17 @@ module Alchemy
108
128
 
109
129
  def set_primary_language
110
130
  header
111
- install_tasks.set_primary_language(options[:auto_accept])
131
+ install_tasks.set_primary_language(
132
+ code: options[:default_language_code],
133
+ name: options[:default_language_name],
134
+ auto_accept: options[:auto_accept]
135
+ )
112
136
  end
113
137
 
114
138
  def setup_database
115
139
  rake("db:create", abort_on_failure: true) unless options[:skip_db_create]
116
140
  # We can't invoke this rake task, because Rails will use wrong engine names otherwise
117
- rake("railties:install:migrations", abort_on_failure: true)
141
+ rake("alchemy:install:migrations", abort_on_failure: true)
118
142
  rake("db:migrate", abort_on_failure: true)
119
143
  install_tasks.inject_seeder
120
144
  rake("db:seed", abort_on_failure: true)
@@ -1,4 +1,4 @@
1
- class <%= @class_name %>Ability
1
+ class <%= @controller_class %>Ability
2
2
  include CanCan::Ability
3
3
 
4
4
  def initialize(user)
@@ -7,5 +7,4 @@ class <%= @class_name %>Ability
7
7
  can :manage, :admin_<%= @controller_name %>
8
8
  end
9
9
  end
10
-
11
- end
10
+ end
@@ -1,17 +1,19 @@
1
- Alchemy::Modules.register_module({
2
- name: '<%= @module_name %>',
3
- order: 1,
4
- navigation: {
5
- name: 'modules.<%= @module_name %>',
6
- controller: '/admin/<%= @module_name %>',
7
- action: 'index',
8
- image: 'alchemy/<%= @module_name %>_module.png',
9
- sub_navigation: [{
1
+ Rails.application.config.to_prepare do
2
+ Alchemy::Modules.register_module({
3
+ name: '<%= @module_name %>',
4
+ order: 1,
5
+ navigation: {
10
6
  name: 'modules.<%= @module_name %>',
11
7
  controller: '/admin/<%= @module_name %>',
12
- action: 'index'
13
- }]
14
- }
15
- })
8
+ action: 'index',
9
+ image: 'alchemy/<%= @module_name %>_module.png',
10
+ sub_navigation: [{
11
+ name: 'modules.<%= @module_name %>',
12
+ controller: '/admin/<%= @module_name %>',
13
+ action: 'index'
14
+ }]
15
+ }
16
+ })
16
17
 
17
- Alchemy.register_ability(<%= @class_name %>Ability)
18
+ Alchemy.register_ability(<%= @controller_class %>Ability)
19
+ end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy_cms/admin",
3
- "version": "6.0.11",
3
+ "version": "6.0.12",
4
4
  "description": "AlchemyCMS",
5
5
  "browser": "package/admin.js",
6
6
  "files": [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.11
4
+ version: 6.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas von Deyen
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2022-09-22 00:00:00.000000000 Z
16
+ date: 2022-11-19 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: actionmailer