alchemy_cms 5.0.0.beta2 → 5.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of alchemy_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +1 -1
- data/README.md +2 -2
- data/Rakefile +11 -10
- data/lib/alchemy/config.rb +5 -3
- data/lib/alchemy/deprecation.rb +1 -1
- data/lib/alchemy/install/tasks.rb +41 -0
- data/lib/alchemy/version.rb +1 -1
- data/lib/generators/alchemy/install/install_generator.rb +60 -1
- data/lib/tasks/alchemy/install.rake +5 -49
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b719983afdc90cf645552079d8de65a7632372c37b3c3acc98e81c726fe3ddd
|
4
|
+
data.tar.gz: 45f07d11d8cce7598ba56a9e6801eb93e3ef31873d24a5e894d8e5208628f99c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de9831e1555fa6ecff7dfe9e28d762ae6bfb9507566aae096ca6ade3087e976a0ec840b1e5a87167fe198154d34cca498fed9d693775f4ba0960d8a062847e24
|
7
|
+
data.tar.gz: 179690bed4cb7feadeb9bff852a8de948c397c8c65d06643bc8dc8863538f951499307a42c883a188454c916d945abe3788ee0eba3f97839e70a881eba2ae21b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## 5.0.0 (unreleased)
|
2
2
|
|
3
|
+
- Deprecate redirect_to_public_child ([tvdeyen](https://github.com/tvdeyen))
|
4
|
+
- Add --auto-accept option to installer ([tvdeyen](https://github.com/tvdeyen))
|
5
|
+
- Move all installer code into install generator ([tvdeyen](https://github.com/tvdeyen))
|
3
6
|
- Language Factory: Create default language in host app's locale [#1884](https://github.com/AlchemyCMS/alchemy_cms/pull/1884) ([mamhoff](https://github.com/mamhoff))
|
4
7
|
- Respect filter and tagging params in picture archive size buttons [#1880](https://github.com/AlchemyCMS/alchemy_cms/pull/1880) ([tvdeyen](https://github.com/tvdeyen))
|
5
8
|
- Extract picture thumbnail sizes in a constant [#1879](https://github.com/AlchemyCMS/alchemy_cms/pull/1879) ([tvdeyen](https://github.com/tvdeyen))
|
data/Gemfile
CHANGED
@@ -22,7 +22,7 @@ group :development, :test do
|
|
22
22
|
gem "yard"
|
23
23
|
gem "redcarpet"
|
24
24
|
gem "pry-byebug"
|
25
|
-
gem "rubocop", "~> 0.
|
25
|
+
gem "rubocop", "~> 0.87.1", require: false
|
26
26
|
gem "listen"
|
27
27
|
gem "localeapp", "~> 3.0", require: false
|
28
28
|
gem "dotenv", "~> 2.2"
|
data/README.md
CHANGED
@@ -125,7 +125,7 @@ $ bundle add alchemy-devise
|
|
125
125
|
Then run the `alchemy-devise` installer:
|
126
126
|
|
127
127
|
```bash
|
128
|
-
$ bin/rails g
|
128
|
+
$ bin/rails g alchemy:devise:install
|
129
129
|
```
|
130
130
|
|
131
131
|
##### Use your User model
|
@@ -167,7 +167,7 @@ Please follow [this guide](http://guides.alchemy-cms.com/stable/custom_authentic
|
|
167
167
|
**After** you set the user model you need to run the Alchemy install task:
|
168
168
|
|
169
169
|
```bash
|
170
|
-
$ bin/
|
170
|
+
$ bin/rails alchemy:install
|
171
171
|
```
|
172
172
|
|
173
173
|
Now everything should be set up and you should be able to visit the Alchemy Dashboard at:
|
data/Rakefile
CHANGED
@@ -39,16 +39,17 @@ namespace :alchemy do
|
|
39
39
|
namespace :spec do
|
40
40
|
desc "Prepares database for testing Alchemy"
|
41
41
|
task :prepare do
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
42
|
+
system(
|
43
|
+
<<~BASH
|
44
|
+
cd spec/dummy && \
|
45
|
+
export RAILS_ENV=test && \
|
46
|
+
bin/rake db:create && \
|
47
|
+
bin/rake db:environment:set && \
|
48
|
+
bin/rake db:migrate:reset && \
|
49
|
+
bin/rails g alchemy:install --skip --skip-demo-files --auto-accept && \
|
50
|
+
cd -
|
51
|
+
BASH
|
52
|
+
) || fail
|
52
53
|
end
|
53
54
|
end
|
54
55
|
|
data/lib/alchemy/config.rb
CHANGED
@@ -31,7 +31,9 @@ module Alchemy
|
|
31
31
|
# a value of nil means there is no new default
|
32
32
|
# any not nil value is the new default
|
33
33
|
def deprecated_configs
|
34
|
-
{
|
34
|
+
{
|
35
|
+
redirect_to_public_child: nil,
|
36
|
+
}
|
35
37
|
end
|
36
38
|
|
37
39
|
private
|
@@ -74,11 +76,11 @@ module Alchemy
|
|
74
76
|
if deprecated_configs.key?(name.to_sym)
|
75
77
|
config = deprecated_configs[name.to_sym]
|
76
78
|
if config.nil?
|
77
|
-
Alchemy::Deprecation.warn("#{name} configuration is deprecated and will be removed from Alchemy 5.
|
79
|
+
Alchemy::Deprecation.warn("#{name} configuration is deprecated and will be removed from Alchemy 5.1")
|
78
80
|
else
|
79
81
|
value = show[name.to_s]
|
80
82
|
if value != config
|
81
|
-
Alchemy::Deprecation.warn("Setting #{name} configuration to #{value} is deprecated and will be always #{config} in Alchemy 5.
|
83
|
+
Alchemy::Deprecation.warn("Setting #{name} configuration to #{value} is deprecated and will be always #{config} in Alchemy 5.1")
|
82
84
|
end
|
83
85
|
end
|
84
86
|
end
|
data/lib/alchemy/deprecation.rb
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
require "thor"
|
3
|
+
|
4
|
+
module Alchemy
|
5
|
+
module Install
|
6
|
+
class Tasks < Thor
|
7
|
+
include Thor::Actions
|
8
|
+
|
9
|
+
no_tasks do
|
10
|
+
def inject_routes(auto_accept = false)
|
11
|
+
return if File.read("./config/routes.rb").match?("mount Alchemy::Engine")
|
12
|
+
|
13
|
+
mountpoint = "/"
|
14
|
+
unless auto_accept
|
15
|
+
mountpoint = ask("- At which path do you want to mount Alchemy CMS at?", default: mountpoint)
|
16
|
+
end
|
17
|
+
sentinel = /\.routes\.draw do(?:\s*\|map\|)?\s*$/
|
18
|
+
inject_into_file "./config/routes.rb", "\n mount Alchemy::Engine => '#{mountpoint}'\n", { after: sentinel, verbose: true }
|
19
|
+
end
|
20
|
+
|
21
|
+
def set_primary_language(auto_accept = false)
|
22
|
+
code = "en"
|
23
|
+
unless auto_accept
|
24
|
+
code = ask("- What is the language code of your site's primary language?", default: code)
|
25
|
+
end
|
26
|
+
name = "English"
|
27
|
+
unless auto_accept
|
28
|
+
name = ask("- What is the name of your site's primary language?", default: name)
|
29
|
+
end
|
30
|
+
gsub_file "./config/alchemy/config.yml", /default_language:\n\s\scode:\sen\n\s\sname:\sEnglish/m do
|
31
|
+
"default_language:\n code: #{code}\n name: #{name}"
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def inject_seeder
|
36
|
+
append_file "./db/seeds.rb", "Alchemy::Seeder.seed!\n"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/alchemy/version.rb
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require "rails/generators"
|
3
|
+
require "alchemy/install/tasks"
|
3
4
|
|
4
5
|
module Alchemy
|
5
6
|
module Generators
|
6
7
|
class InstallGenerator < ::Rails::Generators::Base
|
7
8
|
desc "Installs Alchemy into your App."
|
8
9
|
|
10
|
+
class_option :auto_accept,
|
11
|
+
type: :boolean,
|
12
|
+
default: false,
|
13
|
+
desc: "Automatically accept defaults."
|
14
|
+
|
9
15
|
class_option :skip_demo_files,
|
10
16
|
type: :boolean,
|
11
17
|
default: false,
|
@@ -18,6 +24,13 @@ module Alchemy
|
|
18
24
|
|
19
25
|
source_root File.expand_path("files", __dir__)
|
20
26
|
|
27
|
+
def setup
|
28
|
+
header
|
29
|
+
say "Welcome to AlchemyCMS!"
|
30
|
+
say "Let's begin with some questions.\n\n"
|
31
|
+
install_tasks.inject_routes(options[:auto_accept])
|
32
|
+
end
|
33
|
+
|
21
34
|
def copy_config
|
22
35
|
copy_file "#{gem_config_path}/config.yml", app_config_path.join("alchemy", "config.yml")
|
23
36
|
end
|
@@ -53,7 +66,11 @@ module Alchemy
|
|
53
66
|
end
|
54
67
|
|
55
68
|
def copy_dragonfly_config
|
56
|
-
template
|
69
|
+
template(
|
70
|
+
"#{__dir__}/templates/dragonfly.rb.tt",
|
71
|
+
app_config_path.join("initializers", "dragonfly.rb"),
|
72
|
+
skip: options[:auto_accept]
|
73
|
+
)
|
57
74
|
end
|
58
75
|
|
59
76
|
def install_gutentag_migrations
|
@@ -80,8 +97,46 @@ module Alchemy
|
|
80
97
|
app_root.join(webpack_config["source_path"], webpack_config["source_entry_path"], "alchemy/admin.js")
|
81
98
|
end
|
82
99
|
|
100
|
+
def set_primary_language
|
101
|
+
header
|
102
|
+
install_tasks.set_primary_language(options[:auto_accept])
|
103
|
+
end
|
104
|
+
|
105
|
+
def setup_database
|
106
|
+
rake("db:create", abort_on_failure: true)
|
107
|
+
# We can't invoke this rake task, because Rails will use wrong engine names otherwise
|
108
|
+
rake("railties:install:migrations", abort_on_failure: true)
|
109
|
+
rake("db:migrate", abort_on_failure: true)
|
110
|
+
install_tasks.inject_seeder
|
111
|
+
rake("db:seed", abort_on_failure: true)
|
112
|
+
end
|
113
|
+
|
114
|
+
def finalize
|
115
|
+
header
|
116
|
+
say "Alchemy successfully installed!"
|
117
|
+
say "Now start the server with:\n\n"
|
118
|
+
say " bin/rails server\n\n"
|
119
|
+
say "and point your browser to\n\n"
|
120
|
+
say " http://localhost:3000/admin\n\n"
|
121
|
+
say "and follow the onscreen instructions to finalize the installation.\n\n"
|
122
|
+
end
|
123
|
+
|
83
124
|
private
|
84
125
|
|
126
|
+
def header
|
127
|
+
return if options[:auto_accept]
|
128
|
+
|
129
|
+
puts "─────────────────────"
|
130
|
+
puts "* Alchemy Installer *"
|
131
|
+
puts "─────────────────────"
|
132
|
+
end
|
133
|
+
|
134
|
+
def say(something)
|
135
|
+
return if options[:auto_accept]
|
136
|
+
|
137
|
+
puts " #{something}"
|
138
|
+
end
|
139
|
+
|
85
140
|
def gem_config_path
|
86
141
|
@_config_path ||= File.expand_path("../../../../config/alchemy", __dir__)
|
87
142
|
end
|
@@ -105,6 +160,10 @@ module Alchemy
|
|
105
160
|
def app_root
|
106
161
|
@_app_root ||= Rails.root
|
107
162
|
end
|
163
|
+
|
164
|
+
def install_tasks
|
165
|
+
@_install_tasks ||= Alchemy::Install::Tasks.new
|
166
|
+
end
|
108
167
|
end
|
109
168
|
end
|
110
169
|
end
|
@@ -1,59 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "thor"
|
3
|
-
|
4
|
-
class Alchemy::InstallTask < Thor
|
5
|
-
include Thor::Actions
|
6
|
-
|
7
|
-
no_tasks do
|
8
|
-
def inject_routes
|
9
|
-
mountpoint = ask "\nAt which path do you want to mount Alchemy CMS at? (DEFAULT: At root path '/')"
|
10
|
-
mountpoint = "/" if mountpoint.empty?
|
11
|
-
sentinel = /\.routes\.draw do(?:\s*\|map\|)?\s*$/
|
12
|
-
inject_into_file "./config/routes.rb", "\n mount Alchemy::Engine => '#{mountpoint}'\n", { after: sentinel, verbose: true }
|
13
|
-
end
|
14
|
-
|
15
|
-
def set_primary_language
|
16
|
-
code = ask "\nWhat's the language code of your site's primary language? (DEFAULT: en)"
|
17
|
-
code = "en" if code.empty?
|
18
|
-
name = ask "What's the name of your site's primary language? (DEFAULT: English)"
|
19
|
-
name = "English" if name.empty?
|
20
|
-
gsub_file "./config/alchemy/config.yml", /default_language:\n\s\scode:\sen\n\s\sname:\sEnglish/m do
|
21
|
-
"default_language:\n code: #{code}\n name: #{name}"
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
def inject_seeder
|
26
|
-
append_file "./db/seeds.rb", "Alchemy::Seeder.seed!\n"
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
2
|
|
31
3
|
namespace :alchemy do
|
32
4
|
desc "Installs Alchemy CMS into your app."
|
33
|
-
task
|
34
|
-
|
35
|
-
|
36
|
-
puts "\nAlchemy Installer"
|
37
|
-
puts "-----------------"
|
38
|
-
|
39
|
-
Rake::Task["alchemy:mount"].invoke
|
40
|
-
system("rails g alchemy:install") || exit!(1)
|
41
|
-
install_helper.set_primary_language
|
42
|
-
Rake::Task["db:create"].invoke
|
43
|
-
# We can't invoke this rake task, because Rails will use wrong engine names otherwise
|
44
|
-
`bundle exec rake railties:install:migrations`
|
45
|
-
Rake::Task["db:migrate"].invoke
|
46
|
-
install_helper.inject_seeder
|
47
|
-
Rake::Task["db:seed"].invoke
|
48
|
-
|
49
|
-
puts "\nAlchemy successfully installed."
|
50
|
-
puts "\nNow start the server with:"
|
51
|
-
puts "\n$ bin/rails server"
|
52
|
-
puts "\nand point your browser to http://localhost:3000/admin and follow the onscreen instructions to finalize the installation."
|
5
|
+
task :install do
|
6
|
+
require "generators/alchemy/install/install_generator"
|
7
|
+
Alchemy::Generators::InstallGenerator.start
|
53
8
|
end
|
54
9
|
|
55
10
|
desc "Mounts Alchemy into your routes."
|
56
11
|
task :mount do
|
57
|
-
|
12
|
+
require "alchemy/install/tasks"
|
13
|
+
Alchemy::InstallTasks.new.inject_routes
|
58
14
|
end
|
59
15
|
end
|
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: 5.0.0.
|
4
|
+
version: 5.0.0.rc1
|
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: 2020-
|
16
|
+
date: 2020-07-14 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: active_model_serializers
|
@@ -1087,6 +1087,7 @@ files:
|
|
1087
1087
|
- lib/alchemy/forms/builder.rb
|
1088
1088
|
- lib/alchemy/hints.rb
|
1089
1089
|
- lib/alchemy/i18n.rb
|
1090
|
+
- lib/alchemy/install/tasks.rb
|
1090
1091
|
- lib/alchemy/logger.rb
|
1091
1092
|
- lib/alchemy/modules.rb
|
1092
1093
|
- lib/alchemy/name_conversions.rb
|