rails_app_generator 0.2.11 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.builders/generators/project-plan.rb +2 -0
- data/CHANGELOG.md +21 -0
- data/Rakefile +0 -2
- data/after_templates/addons/acts_as_list/_.rb +0 -2
- data/after_templates/addons/administrate/_.rb +2 -2
- data/after_templates/addons/administrate/app/views/layouts/_navbar.html.erb +4 -1
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/_.rb +2 -2
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/controllers/home_controller.rb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/models/user.rb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/views/home/index.html.erb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/views/layouts/_footer.html.erb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/views/layouts/_navbar.html.erb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/views/layouts/application.html.erb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/views/users/_form.html.erb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/app/views/users/_user.html.erb +0 -0
- data/after_templates/addons/{bcrypt_ruby → bcrypt}/db/seeds.rb +0 -0
- data/after_templates/addons/browser/_.rb +0 -2
- data/after_templates/addons/chartkick/_.rb +0 -2
- data/after_templates/addons/faker/_.rb +0 -2
- data/after_templates/addons/hexapdf/_.rb +0 -2
- data/after_templates/addons/honeybadger/_.rb +0 -2
- data/after_templates/addons/httparty/_.rb +0 -2
- data/after_templates/addons/mini_magick/_.rb +0 -2
- data/after_templates/addons/motor_admin/_.rb +46 -0
- data/after_templates/addons/motor_admin/app/controllers/home_controller.rb +4 -0
- data/after_templates/addons/motor_admin/app/views/home/index.html.erb +3 -0
- data/after_templates/addons/motor_admin/app/views/layouts/_footer.html.erb +3 -0
- data/after_templates/addons/motor_admin/app/views/layouts/_navbar.html.erb +8 -0
- data/after_templates/addons/motor_admin/app/views/layouts/application.html.erb +23 -0
- data/after_templates/addons/motor_admin/db/seeds.rb +116 -0
- data/after_templates/addons/rails_html_sanitizer/_.rb +0 -2
- data/after_templates/addons/twilio_ruby/_.rb +0 -2
- data/after_templates/printspeak_bak/_.rb +0 -2
- data/after_templates/rag/bootstrap/_.rb +0 -2
- data/after_templates/rag/devise/_.rb +0 -2
- data/after_templates/rag/import_map/_.rb +0 -2
- data/after_templates/rag/simple/_.rb +0 -2
- data/after_templates/rag/tailwind/_.rb +0 -2
- data/after_templates/rag/tailwind_daisyui/_.rb +0 -2
- data/after_templates/rag/tailwind_emulating_bootstrap/_.rb +0 -2
- data/after_templates/rag/tailwind_hotwire/_.rb +0 -2
- data/after_templates/rag/tailwind_hotwire_flash/_.rb +0 -1
- data/after_templates/rag/tailwind_hotwire_form/_.rb +0 -1
- data/after_templates/rag/tailwind_hotwire_form_search/_.rb +0 -1
- data/docs/last_run/app_generator_class.json +12 -4
- data/docs/last_run/app_generator_data.json +8 -7
- data/docs/last_run/rails_options_class.json +11 -3
- data/docs/last_run/rails_options_data.json +8 -7
- data/docs/project-plan/project.drawio +53 -47
- data/docs/project-plan/project_done.svg +1 -1
- data/exe/rag +0 -1
- data/lib/rails_app_generator/addons/administrate.rb +0 -7
- data/lib/rails_app_generator/addons/bcrypt.rb +25 -0
- data/lib/rails_app_generator/addons/motor_admin.rb +29 -0
- data/lib/rails_app_generator/app_generator.rb +29 -7
- data/lib/rails_app_generator/cli/profile.rb +1 -1
- data/lib/rails_app_generator/options/options_builder.rb +2 -2
- data/lib/rails_app_generator/rag_initializer.rb +2 -1
- data/lib/rails_app_generator/starter.rb +1 -12
- data/lib/rails_app_generator/util.rb +11 -0
- data/lib/rails_app_generator/version.rb +1 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- data/profiles/addons/{bcrypt_ruby.json → bcrypt.json} +3 -3
- data/profiles/addons/motor_admin.json +15 -0
- data/tasks/profile.thor +0 -1
- data/templates/thor_task/addon/addon.tt +1 -0
- data/templates/thor_task/profile/app/views/home/index.html.erb.tt +1 -1
- metadata +22 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 927857ef18a2d46709fe372c54e7bab633901d719d06d092c78ccf541c84ace4
|
4
|
+
data.tar.gz: 391d0d0bbd89bf6c03bb96ec44a6021b0fee37a955cb3f676d6e9da1384c1143
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cab948d559713b50b47334e904821008fd6ae420cc4435408b38443464221d54600e10e7c035e2d8f8cba0213143816a88b568fba59c6c43ae554f1a997e3df5
|
7
|
+
data.tar.gz: e58f2589d2faa6a39519aaa2c35c0665a04507324792390864f69a6a9edddb3c1566cbdba9916220a6ccea16655dccc6349fe5bf7fdd6e5317ef6c2ebd1dccd4
|
@@ -39,6 +39,8 @@ KManager.action :project_plan do
|
|
39
39
|
|
40
40
|
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
41
41
|
|
42
|
+
todo(title: 'add addon - administrate')
|
43
|
+
todo(title: 'add addon - bcrypt')
|
42
44
|
todo(title: 'add addon - groupdate')
|
43
45
|
todo(title: 'add addon - chartkick')
|
44
46
|
todo(title: 'add addon - browser')
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,24 @@
|
|
1
|
+
## [0.2.13](https://github.com/klueless-io/rails_app_generator/compare/v0.2.12...v0.2.13) (2022-08-12)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* add motor-admin profile ([f74dc4b](https://github.com/klueless-io/rails_app_generator/commit/f74dc4bf2671ae460a27bbc67df0701499526afa))
|
7
|
+
|
8
|
+
## [0.2.12](https://github.com/klueless-io/rails_app_generator/compare/v0.2.11...v0.2.12) (2022-08-12)
|
9
|
+
|
10
|
+
|
11
|
+
### Bug Fixes
|
12
|
+
|
13
|
+
* add motor-admin profile ([0e41a1e](https://github.com/klueless-io/rails_app_generator/commit/0e41a1ece000a1b818d5756aabbd14d52788b462))
|
14
|
+
|
15
|
+
## [0.2.11](https://github.com/klueless-io/rails_app_generator/compare/v0.2.10...v0.2.11) (2022-08-12)
|
16
|
+
|
17
|
+
|
18
|
+
### Bug Fixes
|
19
|
+
|
20
|
+
* add administrate profile ([4049add](https://github.com/klueless-io/rails_app_generator/commit/4049add2e8b4ccf840daa22a817a454cb8bf2ab0))
|
21
|
+
|
1
22
|
## [0.2.10](https://github.com/klueless-io/rails_app_generator/compare/v0.2.9...v0.2.10) (2022-08-11)
|
2
23
|
|
3
24
|
|
data/Rakefile
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# require 'pry'
|
4
|
-
|
5
3
|
# This "acts_as" extension provides the capabilities for sorting and reordering a number of objects in a list. The class that has this specified needs to have a "position" column defined as an integer on the mapped database table.
|
6
4
|
#
|
7
5
|
# exe/rag addons/acts_as_list
|
@@ -8,7 +8,7 @@ self.local_template_path = File.dirname(__FILE__)
|
|
8
8
|
|
9
9
|
gac 'base rails 7 image created'
|
10
10
|
|
11
|
-
|
11
|
+
prepare_environment
|
12
12
|
|
13
13
|
add_controller('home', 'index')
|
14
14
|
|
@@ -30,7 +30,7 @@ after_bundle do
|
|
30
30
|
|
31
31
|
directory "app/dashboards"
|
32
32
|
|
33
|
-
|
33
|
+
rubocop_minimal
|
34
34
|
end
|
35
35
|
|
36
36
|
def setup_db
|
@@ -1,5 +1,8 @@
|
|
1
1
|
<header>
|
2
2
|
<%= link_to 'Home', root_path %> |
|
3
|
-
<%= link_to '
|
3
|
+
<%= link_to 'Authors', authors_path %> |
|
4
|
+
<%= link_to 'Posts', posts_path %> |
|
5
|
+
<%= link_to 'Products', products_path %> |
|
6
|
+
<%= link_to 'ADMIN', admin_root_path %>
|
4
7
|
<hr />
|
5
8
|
</header>
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
# bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords.
|
4
4
|
#
|
5
|
-
# exe/rag addons/
|
5
|
+
# exe/rag addons/bcrypt
|
6
6
|
|
7
7
|
self.local_template_path = File.dirname(__FILE__)
|
8
8
|
|
9
9
|
gac 'base rails 7 image created'
|
10
10
|
|
11
|
-
|
11
|
+
prepare_environment
|
12
12
|
|
13
13
|
add_controller('home', 'index')
|
14
14
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Motor Admin allows to create a flexible admin panel while writing less code.
|
4
|
+
#
|
5
|
+
# exe/rag addons/motor_admin
|
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('motor:install')
|
30
|
+
# db_migrate
|
31
|
+
|
32
|
+
# directory "app/dashboards"
|
33
|
+
|
34
|
+
rubocop
|
35
|
+
end
|
36
|
+
|
37
|
+
def setup_db
|
38
|
+
add_scaffold('author', 'name:string email:string bio:text')
|
39
|
+
add_scaffold('post', 'title:string content:text published:boolean author:references')
|
40
|
+
add_scaffold('product', 'name', 'quantity:integer', 'price:decimal')
|
41
|
+
|
42
|
+
directory "app/models"
|
43
|
+
|
44
|
+
db_migrate
|
45
|
+
db_seed
|
46
|
+
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
|
@@ -48,7 +48,7 @@
|
|
48
48
|
"add_acts_as_list",
|
49
49
|
"add_administrate",
|
50
50
|
"add_browser",
|
51
|
-
"
|
51
|
+
"add_bcrypt",
|
52
52
|
"add_chartkick",
|
53
53
|
"add_faker",
|
54
54
|
"add_groupdate",
|
@@ -56,6 +56,7 @@
|
|
56
56
|
"add_httparty",
|
57
57
|
"add_honeybadger",
|
58
58
|
"add_mini_magick",
|
59
|
+
"add_motor_admin",
|
59
60
|
"add_phony_rails",
|
60
61
|
"add_public_suffix",
|
61
62
|
"add_rails_html_sanitizer",
|
@@ -109,7 +110,7 @@
|
|
109
110
|
"name": "ruby",
|
110
111
|
"description": "Path to the Ruby binary of your choice",
|
111
112
|
"type": "string",
|
112
|
-
"default": "/Users/davidcruwys/.asdf/installs/ruby/
|
113
|
+
"default": "/Users/davidcruwys/.asdf/installs/ruby/3.1.1/bin/ruby",
|
113
114
|
"required": false
|
114
115
|
},
|
115
116
|
{
|
@@ -400,8 +401,8 @@
|
|
400
401
|
"required": false
|
401
402
|
},
|
402
403
|
{
|
403
|
-
"name": "
|
404
|
-
"description": "Indicates when to generate add bcrypt
|
404
|
+
"name": "add_bcrypt",
|
405
|
+
"description": "Indicates when to generate add bcrypt",
|
405
406
|
"type": "boolean",
|
406
407
|
"default": false,
|
407
408
|
"required": false
|
@@ -455,6 +456,13 @@
|
|
455
456
|
"default": false,
|
456
457
|
"required": false
|
457
458
|
},
|
459
|
+
{
|
460
|
+
"name": "add_motor_admin",
|
461
|
+
"description": "Indicates when to generate add motor admin",
|
462
|
+
"type": "boolean",
|
463
|
+
"default": false,
|
464
|
+
"required": false
|
465
|
+
},
|
458
466
|
{
|
459
467
|
"name": "add_phony_rails",
|
460
468
|
"description": "Indicates when to generate add phony rails",
|
@@ -2,7 +2,7 @@
|
|
2
2
|
"options": {
|
3
3
|
"skip_namespace": false,
|
4
4
|
"skip_collision_check": false,
|
5
|
-
"ruby": "/Users/davidcruwys/.asdf/installs/ruby/
|
5
|
+
"ruby": "/Users/davidcruwys/.asdf/installs/ruby/3.1.1/bin/ruby",
|
6
6
|
"database": "sqlite3",
|
7
7
|
"skip_git": true,
|
8
8
|
"skip_keeps": false,
|
@@ -32,25 +32,26 @@
|
|
32
32
|
"test": "rspec",
|
33
33
|
"add_devise": false,
|
34
34
|
"add_dotenv": false,
|
35
|
-
"add_rubocop":
|
36
|
-
"add_annotate":
|
35
|
+
"add_rubocop": false,
|
36
|
+
"add_annotate": false,
|
37
37
|
"add_lograge": false,
|
38
38
|
"add_acts_as_list": false,
|
39
|
-
"add_administrate":
|
39
|
+
"add_administrate": false,
|
40
40
|
"add_browser": false,
|
41
|
-
"
|
41
|
+
"add_bcrypt": true,
|
42
42
|
"add_chartkick": false,
|
43
|
-
"add_faker":
|
43
|
+
"add_faker": false,
|
44
44
|
"add_groupdate": false,
|
45
45
|
"add_hexapdf": false,
|
46
46
|
"add_httparty": false,
|
47
47
|
"add_honeybadger": false,
|
48
48
|
"add_mini_magick": false,
|
49
|
+
"add_motor_admin": false,
|
49
50
|
"add_phony_rails": false,
|
50
51
|
"add_public_suffix": false,
|
51
52
|
"add_rails_html_sanitizer": false,
|
52
53
|
"add_redcarpet": false,
|
53
54
|
"add_twilio_ruby": false,
|
54
|
-
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/
|
55
|
+
"template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/bcrypt/_.rb"
|
55
56
|
}
|
56
57
|
}
|