rails_app_generator 0.2.9 → 0.2.12
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/after_templates/addons/administrate/_.rb +45 -0
- data/after_templates/addons/administrate/app/controllers/home_controller.rb +4 -0
- data/after_templates/addons/administrate/app/dashboards/author_dashboard.rb +74 -0
- data/after_templates/addons/administrate/app/dashboards/post_dashboard.rb +74 -0
- data/after_templates/addons/administrate/app/dashboards/product_dashboard.rb +71 -0
- data/after_templates/addons/administrate/app/models/author.rb +6 -0
- data/after_templates/addons/administrate/app/models/post.rb +5 -0
- data/after_templates/addons/administrate/app/views/home/index.html.erb +3 -0
- data/after_templates/addons/administrate/app/views/layouts/_footer.html.erb +3 -0
- data/after_templates/addons/administrate/app/views/layouts/_navbar.html.erb +8 -0
- data/after_templates/addons/administrate/app/views/layouts/application.html.erb +23 -0
- data/after_templates/addons/administrate/db/seeds.rb +116 -0
- data/docs/last_run/app_generator_class.json +8 -0
- data/docs/last_run/app_generator_data.json +6 -5
- data/docs/last_run/rails_options_class.json +8 -0
- data/docs/last_run/rails_options_data.json +6 -5
- data/lib/rails_app_generator/addons/administrate.rb +30 -0
- data/lib/rails_app_generator/addons/motor_admin.rb +26 -0
- data/lib/rails_app_generator/rag_initializer.rb +1 -0
- data/lib/rails_app_generator/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/profiles/addons/administrate.json +15 -0
- data/templates/thor_task/addon/addon.tt +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4367df5c4bec588d5eeb5e258faddae0f23482404cac1618476b875473c61b92
|
|
4
|
+
data.tar.gz: 821bcdb5b63810752c2e2d2ba8aa2beba4754d4b8638961ec92c0a151f8edf87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45bf74cce66d90ff2d207c752750097d6fd1d4b25fd73df8e03900519aef359237a938af1046a3164ab8f6fb629a6e27bdb6b160f52ef33cadc81192cdbe2396
|
|
7
|
+
data.tar.gz: 777249f552b9da53bc2e6b75246a7cd20490074280f484e8b7359d25848b92c72d9580a2ef02311af19d5e8ec9776cce530019c7cbb5c96a7ee9de3d288f505b
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
1
|
+
## [0.2.11](https://github.com/klueless-io/rails_app_generator/compare/v0.2.10...v0.2.11) (2022-08-12)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add administrate profile ([4049add](https://github.com/klueless-io/rails_app_generator/commit/4049add2e8b4ccf840daa22a817a454cb8bf2ab0))
|
|
7
|
+
|
|
8
|
+
## [0.2.10](https://github.com/klueless-io/rails_app_generator/compare/v0.2.9...v0.2.10) (2022-08-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* add administrate addon ([330ce3c](https://github.com/klueless-io/rails_app_generator/commit/330ce3c0db2148ccb34585eb7fb45dae8b267884))
|
|
14
|
+
|
|
15
|
+
## [0.2.9](https://github.com/klueless-io/rails_app_generator/compare/v0.2.8...v0.2.9) (2022-08-11)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add redcarpet addon ([fb8acf0](https://github.com/klueless-io/rails_app_generator/commit/fb8acf09d3d1be3d4eb9b82e5fc1d9af1fea0e0c))
|
|
21
|
+
|
|
1
22
|
## [0.2.8](https://github.com/klueless-io/rails_app_generator/compare/v0.2.7...v0.2.8) (2022-08-11)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Administrate is inspired by Rails Admin and ActiveAdmin, but aims to provide a better developer/user experience.
|
|
4
|
+
#
|
|
5
|
+
# exe/rag addons/administrate
|
|
6
|
+
|
|
7
|
+
self.local_template_path = File.dirname(__FILE__)
|
|
8
|
+
|
|
9
|
+
gac 'base rails 7 image created'
|
|
10
|
+
|
|
11
|
+
bundle_install
|
|
12
|
+
|
|
13
|
+
add_controller('home', 'index')
|
|
14
|
+
|
|
15
|
+
route("root 'home#index'")
|
|
16
|
+
|
|
17
|
+
force_copy
|
|
18
|
+
|
|
19
|
+
directory "app/controllers"
|
|
20
|
+
directory "app/views/home"
|
|
21
|
+
directory "app/views/layouts"
|
|
22
|
+
template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
|
|
23
|
+
|
|
24
|
+
template 'db/seeds.rb' , 'db/seeds.rb'
|
|
25
|
+
|
|
26
|
+
after_bundle do
|
|
27
|
+
setup_db
|
|
28
|
+
|
|
29
|
+
generate('administrate:install')
|
|
30
|
+
|
|
31
|
+
directory "app/dashboards"
|
|
32
|
+
|
|
33
|
+
rubocop
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def setup_db
|
|
37
|
+
add_scaffold('author', 'name:string email:string bio:text')
|
|
38
|
+
add_scaffold('post', 'title:string content:text published:boolean author:references')
|
|
39
|
+
add_scaffold('product', 'name', 'quantity:integer', 'price:decimal')
|
|
40
|
+
|
|
41
|
+
directory "app/models"
|
|
42
|
+
|
|
43
|
+
db_migrate
|
|
44
|
+
db_seed
|
|
45
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'administrate/base_dashboard'
|
|
4
|
+
|
|
5
|
+
class AuthorDashboard < Administrate::BaseDashboard
|
|
6
|
+
# ATTRIBUTE_TYPES
|
|
7
|
+
# a hash that describes the type of each of the model's fields.
|
|
8
|
+
#
|
|
9
|
+
# Each different type represents an Administrate::Field object,
|
|
10
|
+
# which determines how the attribute is displayed
|
|
11
|
+
# on pages throughout the dashboard.
|
|
12
|
+
ATTRIBUTE_TYPES = {
|
|
13
|
+
id: Field::Number,
|
|
14
|
+
name: Field::String,
|
|
15
|
+
email: Field::String,
|
|
16
|
+
bio: Field::Text,
|
|
17
|
+
posts: Field::HasMany,
|
|
18
|
+
created_at: Field::DateTime,
|
|
19
|
+
updated_at: Field::DateTime
|
|
20
|
+
}.freeze
|
|
21
|
+
|
|
22
|
+
# COLLECTION_ATTRIBUTES
|
|
23
|
+
# an array of attributes that will be displayed on the model's index page.
|
|
24
|
+
#
|
|
25
|
+
# By default, it's limited to four items to reduce clutter on index pages.
|
|
26
|
+
# Feel free to add, remove, or rearrange items.
|
|
27
|
+
COLLECTION_ATTRIBUTES = %i[
|
|
28
|
+
id
|
|
29
|
+
name
|
|
30
|
+
email
|
|
31
|
+
posts
|
|
32
|
+
].freeze
|
|
33
|
+
|
|
34
|
+
# SHOW_PAGE_ATTRIBUTES
|
|
35
|
+
# an array of attributes that will be displayed on the model's show page.
|
|
36
|
+
SHOW_PAGE_ATTRIBUTES = %i[
|
|
37
|
+
id
|
|
38
|
+
name
|
|
39
|
+
email
|
|
40
|
+
bio
|
|
41
|
+
posts
|
|
42
|
+
created_at
|
|
43
|
+
updated_at
|
|
44
|
+
].freeze
|
|
45
|
+
|
|
46
|
+
# FORM_ATTRIBUTES
|
|
47
|
+
# an array of attributes that will be displayed
|
|
48
|
+
# on the model's form (`new` and `edit`) pages.
|
|
49
|
+
FORM_ATTRIBUTES = %i[
|
|
50
|
+
name
|
|
51
|
+
email
|
|
52
|
+
bio
|
|
53
|
+
posts
|
|
54
|
+
].freeze
|
|
55
|
+
|
|
56
|
+
# COLLECTION_FILTERS
|
|
57
|
+
# a hash that defines filters that can be used while searching via the search
|
|
58
|
+
# field of the dashboard.
|
|
59
|
+
#
|
|
60
|
+
# For example to add an option to search for open resources by typing "open:"
|
|
61
|
+
# in the search field:
|
|
62
|
+
#
|
|
63
|
+
# COLLECTION_FILTERS = {
|
|
64
|
+
# open: ->(resources) { resources.where(open: true) }
|
|
65
|
+
# }.freeze
|
|
66
|
+
COLLECTION_FILTERS = {}.freeze
|
|
67
|
+
|
|
68
|
+
# Overwrite this method to customize how authors are displayed
|
|
69
|
+
# across all pages of the admin dashboard.
|
|
70
|
+
#
|
|
71
|
+
# def display_resource(author)
|
|
72
|
+
# "Author ##{author.id}"
|
|
73
|
+
# end
|
|
74
|
+
end
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'administrate/base_dashboard'
|
|
4
|
+
|
|
5
|
+
class PostDashboard < Administrate::BaseDashboard
|
|
6
|
+
# ATTRIBUTE_TYPES
|
|
7
|
+
# a hash that describes the type of each of the model's fields.
|
|
8
|
+
#
|
|
9
|
+
# Each different type represents an Administrate::Field object,
|
|
10
|
+
# which determines how the attribute is displayed
|
|
11
|
+
# on pages throughout the dashboard.
|
|
12
|
+
ATTRIBUTE_TYPES = {
|
|
13
|
+
author: Field::BelongsTo,
|
|
14
|
+
id: Field::Number,
|
|
15
|
+
title: Field::String,
|
|
16
|
+
content: Field::Text,
|
|
17
|
+
published: Field::Boolean,
|
|
18
|
+
created_at: Field::DateTime,
|
|
19
|
+
updated_at: Field::DateTime
|
|
20
|
+
}.freeze
|
|
21
|
+
|
|
22
|
+
# COLLECTION_ATTRIBUTES
|
|
23
|
+
# an array of attributes that will be displayed on the model's index page.
|
|
24
|
+
#
|
|
25
|
+
# By default, it's limited to four items to reduce clutter on index pages.
|
|
26
|
+
# Feel free to add, remove, or rearrange items.
|
|
27
|
+
COLLECTION_ATTRIBUTES = %i[
|
|
28
|
+
author
|
|
29
|
+
id
|
|
30
|
+
title
|
|
31
|
+
content
|
|
32
|
+
].freeze
|
|
33
|
+
|
|
34
|
+
# SHOW_PAGE_ATTRIBUTES
|
|
35
|
+
# an array of attributes that will be displayed on the model's show page.
|
|
36
|
+
SHOW_PAGE_ATTRIBUTES = %i[
|
|
37
|
+
author
|
|
38
|
+
id
|
|
39
|
+
title
|
|
40
|
+
content
|
|
41
|
+
published
|
|
42
|
+
created_at
|
|
43
|
+
updated_at
|
|
44
|
+
].freeze
|
|
45
|
+
|
|
46
|
+
# FORM_ATTRIBUTES
|
|
47
|
+
# an array of attributes that will be displayed
|
|
48
|
+
# on the model's form (`new` and `edit`) pages.
|
|
49
|
+
FORM_ATTRIBUTES = %i[
|
|
50
|
+
author
|
|
51
|
+
title
|
|
52
|
+
content
|
|
53
|
+
published
|
|
54
|
+
].freeze
|
|
55
|
+
|
|
56
|
+
# COLLECTION_FILTERS
|
|
57
|
+
# a hash that defines filters that can be used while searching via the search
|
|
58
|
+
# field of the dashboard.
|
|
59
|
+
#
|
|
60
|
+
# For example to add an option to search for open resources by typing "open:"
|
|
61
|
+
# in the search field:
|
|
62
|
+
#
|
|
63
|
+
# COLLECTION_FILTERS = {
|
|
64
|
+
# open: ->(resources) { resources.where(open: true) }
|
|
65
|
+
# }.freeze
|
|
66
|
+
COLLECTION_FILTERS = {}.freeze
|
|
67
|
+
|
|
68
|
+
# Overwrite this method to customize how posts are displayed
|
|
69
|
+
# across all pages of the admin dashboard.
|
|
70
|
+
#
|
|
71
|
+
# def display_resource(post)
|
|
72
|
+
# "Post ##{post.id}"
|
|
73
|
+
# end
|
|
74
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'administrate/base_dashboard'
|
|
4
|
+
|
|
5
|
+
class ProductDashboard < Administrate::BaseDashboard
|
|
6
|
+
# ATTRIBUTE_TYPES
|
|
7
|
+
# a hash that describes the type of each of the model's fields.
|
|
8
|
+
#
|
|
9
|
+
# Each different type represents an Administrate::Field object,
|
|
10
|
+
# which determines how the attribute is displayed
|
|
11
|
+
# on pages throughout the dashboard.
|
|
12
|
+
ATTRIBUTE_TYPES = {
|
|
13
|
+
id: Field::Number,
|
|
14
|
+
name: Field::String,
|
|
15
|
+
quantity: Field::Number,
|
|
16
|
+
price: Field::String.with_options(searchable: false),
|
|
17
|
+
created_at: Field::DateTime,
|
|
18
|
+
updated_at: Field::DateTime
|
|
19
|
+
}.freeze
|
|
20
|
+
|
|
21
|
+
# COLLECTION_ATTRIBUTES
|
|
22
|
+
# an array of attributes that will be displayed on the model's index page.
|
|
23
|
+
#
|
|
24
|
+
# By default, it's limited to four items to reduce clutter on index pages.
|
|
25
|
+
# Feel free to add, remove, or rearrange items.
|
|
26
|
+
COLLECTION_ATTRIBUTES = %i[
|
|
27
|
+
id
|
|
28
|
+
name
|
|
29
|
+
quantity
|
|
30
|
+
price
|
|
31
|
+
].freeze
|
|
32
|
+
|
|
33
|
+
# SHOW_PAGE_ATTRIBUTES
|
|
34
|
+
# an array of attributes that will be displayed on the model's show page.
|
|
35
|
+
SHOW_PAGE_ATTRIBUTES = %i[
|
|
36
|
+
id
|
|
37
|
+
name
|
|
38
|
+
quantity
|
|
39
|
+
price
|
|
40
|
+
created_at
|
|
41
|
+
updated_at
|
|
42
|
+
].freeze
|
|
43
|
+
|
|
44
|
+
# FORM_ATTRIBUTES
|
|
45
|
+
# an array of attributes that will be displayed
|
|
46
|
+
# on the model's form (`new` and `edit`) pages.
|
|
47
|
+
FORM_ATTRIBUTES = %i[
|
|
48
|
+
name
|
|
49
|
+
quantity
|
|
50
|
+
price
|
|
51
|
+
].freeze
|
|
52
|
+
|
|
53
|
+
# COLLECTION_FILTERS
|
|
54
|
+
# a hash that defines filters that can be used while searching via the search
|
|
55
|
+
# field of the dashboard.
|
|
56
|
+
#
|
|
57
|
+
# For example to add an option to search for open resources by typing "open:"
|
|
58
|
+
# in the search field:
|
|
59
|
+
#
|
|
60
|
+
# COLLECTION_FILTERS = {
|
|
61
|
+
# open: ->(resources) { resources.where(open: true) }
|
|
62
|
+
# }.freeze
|
|
63
|
+
COLLECTION_FILTERS = {}.freeze
|
|
64
|
+
|
|
65
|
+
# Overwrite this method to customize how products are displayed
|
|
66
|
+
# across all pages of the admin dashboard.
|
|
67
|
+
#
|
|
68
|
+
# def display_resource(product)
|
|
69
|
+
# "Product ##{product.id}"
|
|
70
|
+
# end
|
|
71
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title><%= camelized %></title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<%%= csrf_meta_tags %>
|
|
7
|
+
<%%= csp_meta_tag %>
|
|
8
|
+
|
|
9
|
+
<%- if options[:skip_hotwire] || options[:skip_javascript] -%>
|
|
10
|
+
<%%= stylesheet_link_tag "application" %>
|
|
11
|
+
<%- else -%>
|
|
12
|
+
<%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
|
13
|
+
<%- end -%>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body>
|
|
17
|
+
<%%= render 'layouts/navbar' %>
|
|
18
|
+
<main>
|
|
19
|
+
<%%= yield %>
|
|
20
|
+
</main>
|
|
21
|
+
<%%= render 'layouts/footer' %>
|
|
22
|
+
</body>
|
|
23
|
+
</html>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
def fake_title
|
|
2
|
+
[
|
|
3
|
+
'Fundamentals of Wavelets',
|
|
4
|
+
'Data Smart',
|
|
5
|
+
'God Created the Integers',
|
|
6
|
+
'Superfreakonomics',
|
|
7
|
+
'Orientalism',
|
|
8
|
+
'Nature of Statistical Learning Theory',
|
|
9
|
+
'Integration of the Indian States',
|
|
10
|
+
'Image Processing & Mathematical Morphology',
|
|
11
|
+
'How to Think Like Sherlock Holmes',
|
|
12
|
+
'Data Scientists at Work',
|
|
13
|
+
'Slaughterhouse Five',
|
|
14
|
+
'Birth of a Theorem',
|
|
15
|
+
'Structure & Interpretation of Computer Programs',
|
|
16
|
+
'Age of Wrath',
|
|
17
|
+
'Trial',
|
|
18
|
+
'Data Mining Handbook',
|
|
19
|
+
'New Machiavelli',
|
|
20
|
+
'Physics & Philosophy',
|
|
21
|
+
'Making Software',
|
|
22
|
+
'Analysis',
|
|
23
|
+
'Machine Learning for Hackers',
|
|
24
|
+
'Signal and the Noise',
|
|
25
|
+
'Python for Data Analysis',
|
|
26
|
+
'Introduction to Algorithms',
|
|
27
|
+
'Beautiful and the Damned',
|
|
28
|
+
'Outsider',
|
|
29
|
+
'Complete Sherlock Holmes',
|
|
30
|
+
'Complete Sherlock Holmes',
|
|
31
|
+
'Wealth of Nations',
|
|
32
|
+
'Pillars of the Earth',
|
|
33
|
+
'Mein Kampf',
|
|
34
|
+
'Tao of Physics',
|
|
35
|
+
'Farewell to Arms',
|
|
36
|
+
'Veteran',
|
|
37
|
+
'False Impressions',
|
|
38
|
+
'Last Lecture',
|
|
39
|
+
'Return of the Primitive',
|
|
40
|
+
'Jurassic Park',
|
|
41
|
+
'Russian Journal',
|
|
42
|
+
'Tales of Mystery and Imagination',
|
|
43
|
+
'Freakonomics',
|
|
44
|
+
'Hidden Connections',
|
|
45
|
+
'Story of Philosophy',
|
|
46
|
+
'Asami Asami',
|
|
47
|
+
'Journal of a Novel',
|
|
48
|
+
'Once There Was a War',
|
|
49
|
+
'Moon is Down',
|
|
50
|
+
'Brethren',
|
|
51
|
+
'In a Free State',
|
|
52
|
+
'Catch 22',
|
|
53
|
+
'Complete Mastermind',
|
|
54
|
+
'Dylan on Dylan',
|
|
55
|
+
'Soft Computing & Intelligent Systems',
|
|
56
|
+
'Textbook of Economic Theory',
|
|
57
|
+
'Econometric Analysis',
|
|
58
|
+
'Learning OpenCV',
|
|
59
|
+
'Data Structures Using C & C++',
|
|
60
|
+
'Computer Vision',
|
|
61
|
+
'Principles of Communication Systems',
|
|
62
|
+
'Let Us C',
|
|
63
|
+
'Amulet of Samarkand',
|
|
64
|
+
'Crime and Punishment',
|
|
65
|
+
'Angels & Demons',
|
|
66
|
+
'Argumentative Indian',
|
|
67
|
+
'Sea of Poppies',
|
|
68
|
+
'Idea of Justice',
|
|
69
|
+
'Raisin in the Sun',
|
|
70
|
+
'Prisoner of Birth',
|
|
71
|
+
'Scoop!',
|
|
72
|
+
'Ahe Manohar Tari',
|
|
73
|
+
'Last Mughal',
|
|
74
|
+
'Social Choice & Welfare',
|
|
75
|
+
'Radiowaril Bhashane & Shrutika',
|
|
76
|
+
'Gun Gayin Awadi',
|
|
77
|
+
'Aghal Paghal',
|
|
78
|
+
'Beyond Degrees',
|
|
79
|
+
'Manasa',
|
|
80
|
+
'India from Midnight to Milennium',
|
|
81
|
+
'Great Indian Novel',
|
|
82
|
+
'O Jerusalem!',
|
|
83
|
+
'City of Joy',
|
|
84
|
+
'Freedom at Midnight',
|
|
85
|
+
'Winter of Our Discontent',
|
|
86
|
+
'On Education',
|
|
87
|
+
'Free Will',
|
|
88
|
+
'Bookless in Baghdad',
|
|
89
|
+
'Case of the Lame Canary',
|
|
90
|
+
'Theory of Everything',
|
|
91
|
+
'New Markets & Other Essays',
|
|
92
|
+
'Electric Universe',
|
|
93
|
+
'Hunchback of Notre Dame',
|
|
94
|
+
'Burning Bright',
|
|
95
|
+
'Age of Discontuinity'
|
|
96
|
+
].sample
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
60.times do
|
|
100
|
+
Author.create!(name: Faker::Name.name, bio: Faker::Lorem.words(number: 5).join(' '), email: Faker::Internet.email)
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
100.times do |i|
|
|
104
|
+
Post.create!(title: fake_title,
|
|
105
|
+
content: "This is the body of post #{i}",
|
|
106
|
+
published: Faker::Boolean.boolean(true_ratio: 0.6),
|
|
107
|
+
author: Author.all.sample)
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
200.times do
|
|
111
|
+
Product.create!(
|
|
112
|
+
name: Faker::Name.name,
|
|
113
|
+
quantity: Faker::Number.number(digits: 2),
|
|
114
|
+
price: Faker::Number.decimal(l_digits: 4)
|
|
115
|
+
)
|
|
116
|
+
end
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"add_annotate",
|
|
47
47
|
"add_lograge",
|
|
48
48
|
"add_acts_as_list",
|
|
49
|
+
"add_administrate",
|
|
49
50
|
"add_browser",
|
|
50
51
|
"add_bcrypt_ruby",
|
|
51
52
|
"add_chartkick",
|
|
@@ -384,6 +385,13 @@
|
|
|
384
385
|
"default": false,
|
|
385
386
|
"required": false
|
|
386
387
|
},
|
|
388
|
+
{
|
|
389
|
+
"name": "add_administrate",
|
|
390
|
+
"description": "Indicates when to generate add administrate",
|
|
391
|
+
"type": "boolean",
|
|
392
|
+
"default": false,
|
|
393
|
+
"required": false
|
|
394
|
+
},
|
|
387
395
|
{
|
|
388
396
|
"name": "add_browser",
|
|
389
397
|
"description": "Indicates when to generate add browser",
|
|
@@ -32,14 +32,15 @@
|
|
|
32
32
|
"test": "rspec",
|
|
33
33
|
"add_devise": false,
|
|
34
34
|
"add_dotenv": false,
|
|
35
|
-
"add_rubocop":
|
|
36
|
-
"add_annotate":
|
|
35
|
+
"add_rubocop": true,
|
|
36
|
+
"add_annotate": true,
|
|
37
37
|
"add_lograge": false,
|
|
38
38
|
"add_acts_as_list": false,
|
|
39
|
+
"add_administrate": true,
|
|
39
40
|
"add_browser": false,
|
|
40
41
|
"add_bcrypt_ruby": false,
|
|
41
42
|
"add_chartkick": false,
|
|
42
|
-
"add_faker":
|
|
43
|
+
"add_faker": true,
|
|
43
44
|
"add_groupdate": false,
|
|
44
45
|
"add_hexapdf": false,
|
|
45
46
|
"add_httparty": false,
|
|
@@ -48,8 +49,8 @@
|
|
|
48
49
|
"add_phony_rails": false,
|
|
49
50
|
"add_public_suffix": false,
|
|
50
51
|
"add_rails_html_sanitizer": false,
|
|
51
|
-
"add_redcarpet":
|
|
52
|
+
"add_redcarpet": false,
|
|
52
53
|
"add_twilio_ruby": false,
|
|
53
|
-
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/
|
|
54
|
+
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/administrate/_.rb"
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"add_annotate",
|
|
47
47
|
"add_lograge",
|
|
48
48
|
"add_acts_as_list",
|
|
49
|
+
"add_administrate",
|
|
49
50
|
"add_browser",
|
|
50
51
|
"add_bcrypt_ruby",
|
|
51
52
|
"add_chartkick",
|
|
@@ -384,6 +385,13 @@
|
|
|
384
385
|
"default": false,
|
|
385
386
|
"required": false
|
|
386
387
|
},
|
|
388
|
+
{
|
|
389
|
+
"name": "add_administrate",
|
|
390
|
+
"description": "",
|
|
391
|
+
"type": "boolean",
|
|
392
|
+
"default": false,
|
|
393
|
+
"required": false
|
|
394
|
+
},
|
|
387
395
|
{
|
|
388
396
|
"name": "add_browser",
|
|
389
397
|
"description": "",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"quiet": false,
|
|
8
8
|
"skip": false,
|
|
9
9
|
"ruby": "/Users/davidcruwys/.asdf/installs/ruby/2.7.6/bin/ruby",
|
|
10
|
-
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/
|
|
10
|
+
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/administrate/_.rb",
|
|
11
11
|
"database": "sqlite3",
|
|
12
12
|
"skip_git": true,
|
|
13
13
|
"skip_keeps": false,
|
|
@@ -42,14 +42,15 @@
|
|
|
42
42
|
"test": "rspec",
|
|
43
43
|
"add_devise": false,
|
|
44
44
|
"add_dotenv": false,
|
|
45
|
-
"add_rubocop":
|
|
46
|
-
"add_annotate":
|
|
45
|
+
"add_rubocop": true,
|
|
46
|
+
"add_annotate": true,
|
|
47
47
|
"add_lograge": false,
|
|
48
48
|
"add_acts_as_list": false,
|
|
49
|
+
"add_administrate": true,
|
|
49
50
|
"add_browser": false,
|
|
50
51
|
"add_bcrypt_ruby": false,
|
|
51
52
|
"add_chartkick": false,
|
|
52
|
-
"add_faker":
|
|
53
|
+
"add_faker": true,
|
|
53
54
|
"add_groupdate": false,
|
|
54
55
|
"add_hexapdf": false,
|
|
55
56
|
"add_httparty": false,
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"add_phony_rails": false,
|
|
59
60
|
"add_public_suffix": false,
|
|
60
61
|
"add_rails_html_sanitizer": false,
|
|
61
|
-
"add_redcarpet":
|
|
62
|
+
"add_redcarpet": false,
|
|
62
63
|
"add_twilio_ruby": false
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module RailsAppGenerator
|
|
4
|
+
# Custom add-ons for RailsAppGenerator
|
|
5
|
+
module AddOns
|
|
6
|
+
# Add Administrate to rails application
|
|
7
|
+
class Administrate < RailsAppGenerator::Addon
|
|
8
|
+
required_gem gem.version('administrate', '0.17.0', 'Administrate is inspired by Rails Admin and ActiveAdmin, but aims to provide a better developer/user experience.')
|
|
9
|
+
|
|
10
|
+
def apply
|
|
11
|
+
say 'Setting up Administrate'
|
|
12
|
+
# template('administrate_template.rb', 'target/administrate.rb', force: true)
|
|
13
|
+
# template('app/javascript/stylesheets/components.scss')
|
|
14
|
+
# create_file('target/administrate.rb', 'put your content here')
|
|
15
|
+
# directory 'app/template', 'app/target', force: true
|
|
16
|
+
# empty_directory 'app/target'
|
|
17
|
+
# inject_into_file('app/application.js', "some content")
|
|
18
|
+
# rails_command('tailwindcss:install')
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def before_bundle
|
|
22
|
+
say 'Setting up Administrate - before bundle install'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def after_bundle
|
|
26
|
+
say 'Setting up Administrate - after bundle install'
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# lib/rails_app_generator/rag_initializer.rb
|
|
4
|
+
# rag.add_option :add_motor_admin , type: :boolean, default: false
|
|
5
|
+
|
|
6
|
+
module RailsAppGenerator
|
|
7
|
+
# Custom add-ons for RailsAppGenerator
|
|
8
|
+
module AddOns
|
|
9
|
+
# Add MotorAdmin to rails application
|
|
10
|
+
class MotorAdmin < RailsAppGenerator::Addon
|
|
11
|
+
required_gem gem.version('motor-admin', '0.3.6', 'Motor Admin allows to create a flexible admin panel while writing less code.')
|
|
12
|
+
|
|
13
|
+
def apply
|
|
14
|
+
say 'Setting up MotorAdmin'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def before_bundle
|
|
18
|
+
say 'Setting up MotorAdmin - before bundle install'
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def after_bundle
|
|
22
|
+
say 'Setting up MotorAdmin - after bundle install'
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -107,6 +107,7 @@ KConfig.configure do |config|
|
|
|
107
107
|
|
|
108
108
|
# NEW GEM ADDONS
|
|
109
109
|
rag.add_option :add_acts_as_list , type: :boolean, default: false
|
|
110
|
+
rag.add_option :add_administrate , type: :boolean, default: false
|
|
110
111
|
rag.add_option :add_browser , type: :boolean, default: false
|
|
111
112
|
rag.add_option :add_bcrypt_ruby , type: :boolean, default: false
|
|
112
113
|
rag.add_option :add_chartkick , type: :boolean, default: false
|
data/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rails_app_generator",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "rails_app_generator",
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.12",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"daisyui": "^2.20.0"
|
|
12
12
|
},
|
data/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"args": {
|
|
3
|
+
"app_path": "administrate",
|
|
4
|
+
"destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/addons"
|
|
5
|
+
},
|
|
6
|
+
"opts": {
|
|
7
|
+
"skip_git": true,
|
|
8
|
+
"skip_test": true,
|
|
9
|
+
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/administrate/_.rb",
|
|
10
|
+
"add_annotate": true,
|
|
11
|
+
"add_administrate": true,
|
|
12
|
+
"add_faker": true,
|
|
13
|
+
"add_rubocop": true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# lib/rails_app_generator/rag_initializer.rb
|
|
4
|
-
# rag.add_option :add_<%= data.name_snake %>
|
|
4
|
+
# rag.add_option :add_<%= data.name_snake %> , type: :boolean, default: false
|
|
5
5
|
|
|
6
6
|
module RailsAppGenerator
|
|
7
7
|
# Custom add-ons for RailsAppGenerator
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails_app_generator
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.12
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- David Cruwys
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-08-
|
|
11
|
+
date: 2022-08-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bootsnap
|
|
@@ -189,6 +189,18 @@ files:
|
|
|
189
189
|
- after_templates/addons/acts_as_list/app/views/todo_items/index.html.erb
|
|
190
190
|
- after_templates/addons/acts_as_list/config/routes.rb
|
|
191
191
|
- after_templates/addons/acts_as_list/db/seeds.rb
|
|
192
|
+
- after_templates/addons/administrate/_.rb
|
|
193
|
+
- after_templates/addons/administrate/app/controllers/home_controller.rb
|
|
194
|
+
- after_templates/addons/administrate/app/dashboards/author_dashboard.rb
|
|
195
|
+
- after_templates/addons/administrate/app/dashboards/post_dashboard.rb
|
|
196
|
+
- after_templates/addons/administrate/app/dashboards/product_dashboard.rb
|
|
197
|
+
- after_templates/addons/administrate/app/models/author.rb
|
|
198
|
+
- after_templates/addons/administrate/app/models/post.rb
|
|
199
|
+
- after_templates/addons/administrate/app/views/home/index.html.erb
|
|
200
|
+
- after_templates/addons/administrate/app/views/layouts/_footer.html.erb
|
|
201
|
+
- after_templates/addons/administrate/app/views/layouts/_navbar.html.erb
|
|
202
|
+
- after_templates/addons/administrate/app/views/layouts/application.html.erb
|
|
203
|
+
- after_templates/addons/administrate/db/seeds.rb
|
|
192
204
|
- after_templates/addons/bcrypt_ruby/_.rb
|
|
193
205
|
- after_templates/addons/bcrypt_ruby/app/controllers/home_controller.rb
|
|
194
206
|
- after_templates/addons/bcrypt_ruby/app/models/user.rb
|
|
@@ -486,6 +498,7 @@ files:
|
|
|
486
498
|
- lib/rails_app_generator/addon.rb
|
|
487
499
|
- lib/rails_app_generator/addon_util.rb
|
|
488
500
|
- lib/rails_app_generator/addons/acts_as_list.rb
|
|
501
|
+
- lib/rails_app_generator/addons/administrate.rb
|
|
489
502
|
- lib/rails_app_generator/addons/annotate.rb
|
|
490
503
|
- lib/rails_app_generator/addons/bcrypt_ruby.rb
|
|
491
504
|
- lib/rails_app_generator/addons/browser.rb
|
|
@@ -508,6 +521,7 @@ files:
|
|
|
508
521
|
- lib/rails_app_generator/addons/irbrc.rb
|
|
509
522
|
- lib/rails_app_generator/addons/lograge.rb
|
|
510
523
|
- lib/rails_app_generator/addons/mini_magick.rb
|
|
524
|
+
- lib/rails_app_generator/addons/motor_admin.rb
|
|
511
525
|
- lib/rails_app_generator/addons/phony_rails.rb
|
|
512
526
|
- lib/rails_app_generator/addons/public_suffix.rb
|
|
513
527
|
- lib/rails_app_generator/addons/pundit.rb
|
|
@@ -558,6 +572,7 @@ files:
|
|
|
558
572
|
- package-lock.json
|
|
559
573
|
- package.json
|
|
560
574
|
- profiles/addons/acts_as_list.json
|
|
575
|
+
- profiles/addons/administrate.json
|
|
561
576
|
- profiles/addons/bcrypt_ruby.json
|
|
562
577
|
- profiles/addons/browser.json
|
|
563
578
|
- profiles/addons/chartkick.json
|