rails_app_generator 0.2.5 → 0.2.8

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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/after_templates/addons/bcrypt_ruby/_.rb +37 -0
  4. data/after_templates/addons/bcrypt_ruby/app/controllers/home_controller.rb +7 -0
  5. data/after_templates/addons/bcrypt_ruby/app/models/user.rb +20 -0
  6. data/after_templates/addons/bcrypt_ruby/app/views/home/index.html.erb +9 -0
  7. data/after_templates/addons/bcrypt_ruby/app/views/layouts/_footer.html.erb +3 -0
  8. data/after_templates/addons/bcrypt_ruby/app/views/layouts/_navbar.html.erb +5 -0
  9. data/after_templates/addons/bcrypt_ruby/app/views/layouts/application.html.erb +23 -0
  10. data/after_templates/addons/bcrypt_ruby/app/views/users/_form.html.erb +27 -0
  11. data/after_templates/addons/bcrypt_ruby/app/views/users/_user.html.erb +17 -0
  12. data/after_templates/addons/bcrypt_ruby/db/seeds.rb +3 -0
  13. data/after_templates/addons/phony_rails/_.rb +62 -0
  14. data/after_templates/addons/phony_rails/app/controllers/home_controller.rb +7 -0
  15. data/after_templates/addons/phony_rails/app/views/home/index.html.erb +46 -0
  16. data/after_templates/addons/phony_rails/app/views/layouts/application.html.erb +19 -0
  17. data/after_templates/addons/phony_rails/db/seeds.rb +16 -0
  18. data/docs/last_run/app_generator_class.json +16 -0
  19. data/docs/last_run/app_generator_data.json +4 -2
  20. data/docs/last_run/rails_options_class.json +17 -1
  21. data/docs/last_run/rails_options_data.json +4 -2
  22. data/lib/rails_app_generator/addons/bcrypt_ruby.rb +15 -0
  23. data/lib/rails_app_generator/addons/phony_rails.rb +13 -0
  24. data/lib/rails_app_generator/addons/public_suffix.rb +1 -21
  25. data/lib/rails_app_generator/rag_initializer.rb +3 -116
  26. data/lib/rails_app_generator/version.rb +1 -1
  27. data/package-lock.json +2 -2
  28. data/package.json +1 -1
  29. data/profiles/addons/bcrypt_ruby.json +12 -0
  30. data/profiles/addons/phony_rails.json +12 -0
  31. data/templates/thor_task/profile/after_template.rb +1 -0
  32. data/templates/thor_task/profile/app/views/layouts/application.html.erb.tt +0 -5
  33. metadata +21 -3
  34. data/templates/thor_task/profile/app/views/layouts/_alerts.html.erb.tt +0 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6643bb1793ae62dd9a03d88815543f732ad40b0be0014dca96028f768d5026f
4
- data.tar.gz: 631e0d1fa33f226a1c20ad45aa4e2c034b8d7ef0477317f8485c24bf9c26dd9c
3
+ metadata.gz: 3e803a1080601b2097577a2d62570ed49a99e4ba73a5d17308e116a3da303ea9
4
+ data.tar.gz: 0ce18a4307afb75ceaa51ec62f24e25a30cd32b96a32a5e7c5a3269a960eaec2
5
5
  SHA512:
6
- metadata.gz: 432e5274201efba75dde019a0ce0d6b03664392e47aa6f98fb78d6d24a91b57a5e85fd528fe7161ab176e9aa653525563c13a4b46bd9f8872246b4794d82286d
7
- data.tar.gz: de5b4c0ad27d3fba243018c9d7cc488e21cd7946475976d1f0681c3bc50190b6fbee0b5ca10165ace830fbda64dbc7223b4b70ce580c33cc87a0fbeed49a2ec7
6
+ metadata.gz: 1863f937b018927dc812d5fddbd36af00cb77b0c6e9e1550cf060fd08007a11d1c0a9824e87d0deea328a583e5c75b584a529a55c006a0fb509d2333ae0f0c2f
7
+ data.tar.gz: a9a0814e79a2dc2eca868ec1e1e60849362063668970bb5e4bbeda998c70e65ab2ea9f0e54cc13507d8e624002857812ae5b18251b3d6ae040dc603cc5d53b57
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## [0.2.7](https://github.com/klueless-io/rails_app_generator/compare/v0.2.6...v0.2.7) (2022-08-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add bcrypt_ruby addon ([34eb3ca](https://github.com/klueless-io/rails_app_generator/commit/34eb3ca4236804dec52ea995addbb1e3749336d9))
7
+ * add bcrypt_ruby addon ([4622249](https://github.com/klueless-io/rails_app_generator/commit/4622249b03ab204728432d04d4743e8ba8569ec3))
8
+
9
+ ## [0.2.6](https://github.com/klueless-io/rails_app_generator/compare/v0.2.5...v0.2.6) (2022-08-10)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * add phony_rails addon ([77aec0e](https://github.com/klueless-io/rails_app_generator/commit/77aec0e7ed2fe9093cb988ab408db1f1e50e78d3))
15
+ * add phony_rails addon ([7a45829](https://github.com/klueless-io/rails_app_generator/commit/7a45829688dfb371a4257a5e1c6bb10ebc0a56ad))
16
+
17
+ ## [0.2.5](https://github.com/klueless-io/rails_app_generator/compare/v0.2.4...v0.2.5) (2022-08-10)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * add public_suffix addon ([dce30f3](https://github.com/klueless-io/rails_app_generator/commit/dce30f3d3a479ca41ab7c60deef59f9d19d2ce13))
23
+
1
24
  ## [0.2.4](https://github.com/klueless-io/rails_app_generator/compare/v0.2.3...v0.2.4) (2022-08-10)
2
25
 
3
26
 
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ # bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords.
4
+ #
5
+ # exe/rag addons/bcrypt_ruby
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
+ end
29
+
30
+ def setup_db
31
+ add_scaffold('user', 'name', 'password', 'password_hash')
32
+ directory "app/models"
33
+ directory "app/views/users"
34
+
35
+ db_migrate
36
+ db_seed
37
+ end
@@ -0,0 +1,7 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def some_action
6
+ end
7
+ end
@@ -0,0 +1,20 @@
1
+ require 'bcrypt'
2
+
3
+ class User < ApplicationRecord
4
+ # users.password_hash in the database is a :string
5
+ include BCrypt
6
+
7
+ def password
8
+ return nil if password_hash.nil?
9
+ @password ||= Password.new(password_hash)
10
+ end
11
+
12
+ def password=(new_password)
13
+ @password = Password.create(new_password)
14
+ self.password_hash = @password
15
+ end
16
+
17
+ def match?(password)
18
+ self.password == password
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ <h1>Bcrypt ruby</h1>
2
+
3
+ <h2>bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords.</h2>
4
+
5
+ <p>If you are using Rails you should probaly be using <code>ActiveModel::SecurePassword</code> instead of using bcrypt</p>
6
+
7
+
8
+
9
+
@@ -0,0 +1,3 @@
1
+ <footer>
2
+ <hr />
3
+ </footer>
@@ -0,0 +1,5 @@
1
+ <header>
2
+ <%= link_to 'Home', root_path %> |
3
+ <%= link_to 'Users', users_path %>
4
+ <hr />
5
+ </header>
@@ -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,27 @@
1
+ <%= form_with(model: user) do |form| %>
2
+ <% if user.errors.any? %>
3
+ <div style="color: red">
4
+ <h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
+
6
+ <ul>
7
+ <% user.errors.each do |error| %>
8
+ <li><%= error.full_message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div>
15
+ <%= form.label :name, style: "display: block" %>
16
+ <%= form.text_field :name %>
17
+ </div>
18
+
19
+ <div>
20
+ <%= form.label :password, style: "display: block" %>
21
+ <%= form.text_field :password %>
22
+ </div>
23
+
24
+ <div>
25
+ <%= form.submit %>
26
+ </div>
27
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <div id="<%= dom_id user %>">
2
+ <p>
3
+ <strong>Name:</strong>
4
+ <%= user.name %>
5
+ </p>
6
+
7
+ <p>
8
+ <strong>Password:</strong>
9
+ <%= user.password %>
10
+ </p>
11
+
12
+ <p>match?('password1'): <%= user.match?('password1') ? '<strong>TRUE</strong>'.html_safe : false %></p>
13
+ <p>match?('password2'): <%= user.match?('password2') ? '<strong>TRUE</strong>'.html_safe : false %></p>
14
+ <p>match?('password3'): <%= user.match?('password3') ? '<strong>TRUE</strong>'.html_safe : false %></p>
15
+ <p>match?('hello'): <%= user.match?('hello') ? '<strong>TRUE</strong>'.html_safe : false %></p>
16
+
17
+ </div>
@@ -0,0 +1,3 @@
1
+ david = User.create(name: 'david', password: 'password1')
2
+ james = User.create(name: 'james', password: 'password2')
3
+ sally = User.create(name: 'sally', password: 'password3')
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This Gem adds useful methods to your Rails app to validate, display and save phone numbers.
4
+ #
5
+ # exe/rag addons/phony_rails
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
+ end
29
+
30
+ def setup_db
31
+ # add_scaffold('post', 'title', 'body:text')
32
+ # add_scaffold('people', 'first_name', 'last_name', 'age:integer', 'address:text')
33
+ # add_scaffold('product', 'name', 'price:integer')
34
+
35
+ # db_migrate
36
+ end
37
+
38
+ # Other template command examples
39
+ # bundle_install
40
+ # css_install('tailwind')
41
+ # rails_command('db:migrate')
42
+ # rails_command('db:migrate')
43
+ # bundle_add('hotwire-rails')
44
+ # rails_command('hotwire:install')
45
+ # run('bin/importmap pin sortablejs')
46
+ # run('npm install daisyui')
47
+ # rubocop
48
+ #
49
+ # directory 'app/assets/images'
50
+ # create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
51
+ # append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
52
+ # insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
53
+ # before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
54
+ # gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
55
+ # template 'home.css', 'app/assets/stylesheets/home.css'
56
+ #
57
+ # add_controller('page', 'benefits', 'faq', 'terms', 'privacy', '--skip-routes')
58
+ # route(<<-'RUBY')
59
+ # PageController.action_methods.each do |action|
60
+ # get "/#{action}", to: "page##{action}", as: "page_#{action}"
61
+ # end
62
+ # RUBY
@@ -0,0 +1,7 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def some_action
6
+ end
7
+ end
@@ -0,0 +1,46 @@
1
+ <style>
2
+ .alert { color: red; }
3
+ .notice { color: green; }
4
+ </style>
5
+
6
+ <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
7
+ <% if flash.any? %><hr /><% end %>
8
+
9
+ <h1>Phony rails</h1>
10
+
11
+ <h2>This Gem adds useful methods to your Rails app to validate, display and save phone numbers.</h2>
12
+
13
+ <hr />
14
+
15
+ <pre>
16
+ <code>
17
+ PhonyRails.normalize_number('0211112222', country_code: 'AU')
18
+ PhonyRails.normalize_number('0424001122', country_code: 'AU')
19
+ PhonyRails.normalize_number('+4790909090', default_country_code: 'SE')
20
+ </code>
21
+ </pre>
22
+
23
+ <pre>
24
+ <code>
25
+ <%= PhonyRails.normalize_number('0211112222', country_code: 'AU') %>
26
+ <%= PhonyRails.normalize_number('0424001122', country_code: 'AU') %>
27
+ <%= PhonyRails.normalize_number('+61424001122', default_country_code: 'AU') %>
28
+ </code>
29
+ </pre>
30
+
31
+ <hr />
32
+
33
+ <pre>
34
+ <code>
35
+ "311012341234".phony_formatted(format: :international, spaces: '-')
36
+ "+31-10-12341234".phony_formatted(format: :international, spaces: '-')
37
+ "+31(0)012341234".phony_formatted(format: :international, spaces: '-')
38
+ </code>
39
+ </pre>
40
+
41
+ <pre>
42
+ <code>
43
+ <%= "311012341234".phony_formatted(format: :international, spaces: '-') %>
44
+ <%= "+31-10-12341234".phony_formatted(format: :international, spaces: '-') %>
45
+ <%= "+31(0)012341234".phony_formatted(format: :international, spaces: '-') %></code>
46
+ </pre>
@@ -0,0 +1,19 @@
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
+ <%%= yield %>
18
+ </body>
19
+ </html>
@@ -0,0 +1,16 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
3
+ #
4
+ # User.find_or_create_by(email: "admin@admin.com") do |user|
5
+ # user.name = 'Admin'
6
+ # user.password = 'password'
7
+ # user.admin = true
8
+ # end
9
+
10
+ # david = User.create(email: 'david@site.com', name: 'david', password: 'password')
11
+ # bob = User.create(email: 'bob@site.com', name: 'bob', password: 'password')
12
+ # lisa = User.create(email: 'lisa@site.com', name: 'lisa', password: 'password')
13
+
14
+ # 10.times do |i|
15
+ # Post.create(title: "Post #{i}", body: "This is the body of post #{i}", user: User.all.sample)
16
+ # end
@@ -47,6 +47,7 @@
47
47
  "add_lograge",
48
48
  "add_acts_as_list",
49
49
  "add_browser",
50
+ "add_bcrypt_ruby",
50
51
  "add_chartkick",
51
52
  "add_faker",
52
53
  "add_groupdate",
@@ -54,6 +55,7 @@
54
55
  "add_httparty",
55
56
  "add_honeybadger",
56
57
  "add_mini_magick",
58
+ "add_phony_rails",
57
59
  "add_public_suffix",
58
60
  "add_rails_html_sanitizer",
59
61
  "add_twilio_ruby"
@@ -388,6 +390,13 @@
388
390
  "default": false,
389
391
  "required": false
390
392
  },
393
+ {
394
+ "name": "add_bcrypt_ruby",
395
+ "description": "Indicates when to generate add bcrypt ruby",
396
+ "type": "boolean",
397
+ "default": false,
398
+ "required": false
399
+ },
391
400
  {
392
401
  "name": "add_chartkick",
393
402
  "description": "Indicates when to generate add chartkick",
@@ -437,6 +446,13 @@
437
446
  "default": false,
438
447
  "required": false
439
448
  },
449
+ {
450
+ "name": "add_phony_rails",
451
+ "description": "Indicates when to generate add phony rails",
452
+ "type": "boolean",
453
+ "default": false,
454
+ "required": false
455
+ },
440
456
  {
441
457
  "name": "add_public_suffix",
442
458
  "description": "Indicates when to generate add public suffix",
@@ -37,6 +37,7 @@
37
37
  "add_lograge": false,
38
38
  "add_acts_as_list": false,
39
39
  "add_browser": false,
40
+ "add_bcrypt_ruby": true,
40
41
  "add_chartkick": false,
41
42
  "add_faker": false,
42
43
  "add_groupdate": false,
@@ -44,9 +45,10 @@
44
45
  "add_httparty": false,
45
46
  "add_honeybadger": false,
46
47
  "add_mini_magick": false,
47
- "add_public_suffix": true,
48
+ "add_phony_rails": false,
49
+ "add_public_suffix": false,
48
50
  "add_rails_html_sanitizer": false,
49
51
  "add_twilio_ruby": false,
50
- "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/public_suffix/_.rb"
52
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/bcrypt_ruby/_.rb"
51
53
  }
52
54
  }
@@ -47,6 +47,7 @@
47
47
  "add_lograge",
48
48
  "add_acts_as_list",
49
49
  "add_browser",
50
+ "add_bcrypt_ruby",
50
51
  "add_chartkick",
51
52
  "add_faker",
52
53
  "add_groupdate",
@@ -54,6 +55,7 @@
54
55
  "add_httparty",
55
56
  "add_honeybadger",
56
57
  "add_mini_magick",
58
+ "add_phony_rails",
57
59
  "add_public_suffix",
58
60
  "add_rails_html_sanitizer",
59
61
  "add_twilio_ruby"
@@ -388,6 +390,13 @@
388
390
  "default": false,
389
391
  "required": false
390
392
  },
393
+ {
394
+ "name": "add_bcrypt_ruby",
395
+ "description": "",
396
+ "type": "boolean",
397
+ "default": false,
398
+ "required": false
399
+ },
391
400
  {
392
401
  "name": "add_chartkick",
393
402
  "description": "",
@@ -432,7 +441,14 @@
432
441
  },
433
442
  {
434
443
  "name": "add_mini_magick",
435
- "description": "Add Mini Magick gem",
444
+ "description": "",
445
+ "type": "boolean",
446
+ "default": false,
447
+ "required": false
448
+ },
449
+ {
450
+ "name": "add_phony_rails",
451
+ "description": "",
436
452
  "type": "boolean",
437
453
  "default": false,
438
454
  "required": false
@@ -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/public_suffix/_.rb",
10
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/bcrypt_ruby/_.rb",
11
11
  "database": "sqlite3",
12
12
  "skip_git": true,
13
13
  "skip_keeps": false,
@@ -47,6 +47,7 @@
47
47
  "add_lograge": false,
48
48
  "add_acts_as_list": false,
49
49
  "add_browser": false,
50
+ "add_bcrypt_ruby": true,
50
51
  "add_chartkick": false,
51
52
  "add_faker": false,
52
53
  "add_groupdate": false,
@@ -54,7 +55,8 @@
54
55
  "add_httparty": false,
55
56
  "add_honeybadger": false,
56
57
  "add_mini_magick": false,
57
- "add_public_suffix": true,
58
+ "add_phony_rails": false,
59
+ "add_public_suffix": false,
58
60
  "add_rails_html_sanitizer": false,
59
61
  "add_twilio_ruby": false
60
62
  }
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAppGenerator
4
+ # Custom add-ons for RailsAppGenerator
5
+ module AddOns
6
+ # Add BcryptRuby to rails application
7
+ class BcryptRuby < RailsAppGenerator::Addon
8
+ required_gem gem.version('bcrypt-ruby', '3.1.5', 'bcrypt() is a sophisticated and secure hash algorithm designed by The OpenBSD project for hashing passwords.')
9
+
10
+ # If you are using Rails you should probably be using
11
+ # <code>ActiveModel::SecurePassword</code> instead of using bcrypt
12
+ def apply; end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RailsAppGenerator
4
+ # Custom add-ons for RailsAppGenerator
5
+ module AddOns
6
+ # Add PhonyRails to rails application
7
+ class PhonyRails < RailsAppGenerator::Addon
8
+ required_gem gem.version('phony_rails', '0.15.0', 'This Gem adds useful methods to your Rails app to validate, display and save phone numbers.')
9
+
10
+ def apply; end
11
+ end
12
+ end
13
+ end
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # lib/rails_app_generator/rag_initializer.rb
4
- # rag.add_option :add_public_suffix , type: :boolean, default: false
5
-
6
3
  module RailsAppGenerator
7
4
  # Custom add-ons for RailsAppGenerator
8
5
  module AddOns
@@ -10,24 +7,7 @@ module RailsAppGenerator
10
7
  class PublicSuffix < RailsAppGenerator::Addon
11
8
  required_gem gem.version('public_suffix', '5.0.0', 'PublicSuffix can parse and decompose a domain name into top level domain, domain and subdomains.')
12
9
 
13
- def apply
14
- say 'Setting up PublicSuffix'
15
- # template('public_suffix_template.rb', 'target/public_suffix.rb', force: true)
16
- # template('app/javascript/stylesheets/components.scss')
17
- # create_file('target/public_suffix.rb', 'put your content here')
18
- # directory 'app/template', 'app/target', force: true
19
- # empty_directory 'app/target'
20
- # inject_into_file('app/application.js', "some content")
21
- # rails_command('tailwindcss:install')
22
- end
23
-
24
- def before_bundle
25
- say 'Setting up PublicSuffix - before bundle install'
26
- end
27
-
28
- def after_bundle
29
- say 'Setting up PublicSuffix - after bundle install'
30
- end
10
+ def apply; end
31
11
  end
32
12
  end
33
13
  end
@@ -12,121 +12,6 @@ KConfig.configure do |config|
12
12
 
13
13
  # rag.add_option :test , type: :string , default: 'rspec'
14
14
 
15
- # # Gem Current Latest Requested Groups
16
- # # aws-sdk
17
- # # capistrano-bundler 1.6.0 2.1.0 ~> 1.2 development, test
18
- # # capybara 3.33.0 3.37.1 = 3.33.0 development, test
19
- # # clamby 1.6.6 1.6.8 = 1.6.6 default
20
- # # createsend 5.1.1 6.0.0 ~> 5.1 default
21
- # # database_cleaner 1.7.0 2.0.1 = 1.7.0 development, test
22
- # # erubi 1.10.0 1.11.0
23
- # # factory_bot 5.2.0 6.2.1
24
- # # factory_bot_rails 5.2.0 6.2.0 = 5.2.0 development, test
25
- # # guard-bundler 2.2.1 3.0.0 = 2.2.1 development, test
26
- # # guard-rubocop 1.4.0 1.5.0 = 1.4.0 development, test
27
- # # http-accept 1.7.0 2.2.0
28
- # # net-ssh 6.1.0 7.0.1
29
- # # oauth2 1.4.10 2.0.6
30
- # # omniauth-oauth2 1.7.3 1.8.0
31
- # # paper_trail 10.3.1 12.3.0 ~> 10.3 default
32
- # # pg 0.21.0 1.4.2 ~> 0.20 default
33
- # # pg_search 2.3.0 2.3.6 ~> 2.0 default
34
- # # public_suffix 2.0.5 5.0.0 ~> 2.0 default
35
- # # pusher 1.4.3 2.0.2 ~> 1.3 default
36
- # # rack-mini-profiler 0.10.7 3.0.0 ~> 0.10 default
37
- # # rack-test 0.6.3 2.0.2
38
- # # rails 5.0.7.2 7.0.3.1 = 5.0.7.2 default
39
- # # railties 5.0.7.2 7.0.3.1
40
- # # ransack 1.8.10 3.2.1 ~> 1.8 default
41
- # # redis 3.3.5 4.7.1 ~> 3.3 default
42
- # # redis-store 1.6.0 1.9.1
43
- # # regexp_parser 1.8.2 2.5.0
44
- # # rspec 3.10.0 3.11.0
45
- # # rspec-core 3.10.1 3.11.0 = 3.10.1 development, test
46
- # # rspec-expectations 3.10.1 3.11.0 = 3.10.1 development, test
47
- # # rspec-mocks 3.10.2 3.11.1 = 3.10.2 development, test
48
- # # rspec-rails 4.1.2 5.1.2 = 4.1.2 development, test
49
- # # rspec-support 3.10.2 3.11.0 = 3.10.2 development, test
50
- # # rubyzip 1.3.0 2.3.2 ~> 1.3 default
51
- # # scenic 1.5.4 1.6.0 = 1.5.4 default
52
- # # scout_apm 4.1.2 5.2.0 ~> 4.1 default
53
- # # selenium-webdriver 3.142.7 4.3.0 = 3.142.7 development, test
54
- # # shoulda-matchers 4.0.1 5.1.0 = 4.0.1 development, test
55
- # # sidekiq 4.2.10 6.5.1 ~> 4.2 default
56
- # # sidekiq-pool 1.9.3 2.0.1 ~> 1.8 default
57
- # # sidekiq-unique-jobs 6.0.25 7.1.27 ~> 6.0 default
58
- # # spring 2.1.1 4.0.0 ~> 2.0 development, test
59
- # # sprockets 3.7.2 4.1.1 ~> 3.7 default
60
- # # sprockets-rails 3.2.2 3.4.2
61
- # # timecop 0.8.1 0.9.5 = 0.8.1 development, test
62
- # # tzinfo 1.2.10 2.0.5
63
- # # uglifier 3.2.0 4.2.0 ~> 3.2 default
64
- # # unicorn 5.8.0 6.1.0 ~> 5.3 default
65
- # # webmock 3.13.0 3.16.0 = 3.13.0 development, test
66
- # # websocket-driver 0.6.5 0.7.5
67
-
68
- # # acts_as_list 0.9.19 1.0.4 ~> 0.9 default
69
- # # arel 7.1.4 9.0.0
70
- # # bigdecimal 1.4.4 3.1.2 ~> 1.4 development, test
71
- # # binding_of_caller 0.8.0 1.0.0 ~> 0.8 default
72
- # # browser 2.7.1 5.3.1 ~> 2.3 default
73
- # # capistrano-bundler 1.6.0 2.1.0 ~> 1.2 development, test
74
- # # capybara 3.33.0 3.37.1 = 3.33.0 development, test
75
- # # chartkick 2.3.5 4.2.0 ~> 2.3 default
76
- # # childprocess 3.0.0 4.1.0
77
- # # clamby 1.6.6 1.6.8 = 1.6.6 default
78
- # # createsend 5.1.1 6.0.0 ~> 5.1 default
79
- # # database_cleaner 1.7.0 2.0.1 = 1.7.0 development, test
80
- # # factory_bot 5.2.0 6.2.1
81
- # # factory_bot_rails 5.2.0 6.2.0 = 5.2.0 development, test
82
- # # faker 1.9.6 2.22.0 ~> 1.7 default
83
- # # groupdate 4.3.0 6.1.0 ~> 4.1 default
84
- # # guard-bundler 2.2.1 3.0.0 = 2.2.1 development, test
85
- # # guard-rubocop 1.4.0 1.5.0 = 1.4.0 development, test
86
- # # hashie 3.6.0 5.0.0
87
- # # http-accept 1.7.0 2.1.1
88
- # # k_log 0.0.18 0.0.33 = 0.0.18 development, test
89
- # # net-ssh 6.1.0 7.0.1
90
- # # oauth2 1.4.10 2.0.6
91
- # # omniauth-oauth2 1.7.3 1.8.0
92
- # # paper_trail 10.3.1 12.3.0 ~> 10.3 default
93
- # # pg 0.21.0 1.4.2 ~> 0.20 default
94
- # # pg_search 2.3.0 2.3.6 ~> 2.0 default
95
- # # pry 0.13.1 0.14.1
96
- # # public_suffix 2.0.5 5.0.0 ~> 2.0 default
97
- # # pusher 1.4.3 2.0.2 ~> 1.3 default
98
- # # rack-mini-profiler 0.10.7 3.0.0 ~> 0.10 default
99
- # # rack-test 0.6.3 2.0.2
100
- # # rails 5.0.7.2 7.0.3.1 = 5.0.7.2 default
101
- # # railties 5.0.7.2 7.0.3.1
102
- # # ransack 1.8.10 3.2.1 ~> 1.8 default
103
- # # redis 3.3.5 4.7.1 ~> 3.3 default
104
- # # redis-store 1.6.0 1.9.1
105
- # # regexp_parser 1.8.2 2.5.0
106
- # # rspec 3.10.0 3.11.0
107
- # # rspec-core 3.10.1 3.11.0 = 3.10.1 development, test
108
- # # rspec-expectations 3.10.1 3.11.0 = 3.10.1 development, test
109
- # # rspec-mocks 3.10.2 3.11.1 = 3.10.2 development, test
110
- # # rspec-rails 4.1.2 5.1.2 = 4.1.2 development, test
111
- # # rspec-support 3.10.2 3.11.0 = 3.10.2 development, test
112
- # # rubyzip 1.3.0 2.3.2 ~> 1.3 default
113
- # # scenic 1.5.4 1.6.0 = 1.5.4 default
114
- # # scout_apm 4.1.2 5.2.0 ~> 4.1 default
115
- # # selenium-webdriver 3.142.7 4.3.0 = 3.142.7 development, test
116
- # # shoulda-matchers 4.0.1 5.1.0 = 4.0.1 development, test
117
- # # sidekiq 4.2.10 6.5.1 ~> 4.2 default
118
- # # sidekiq-pool 1.9.3 2.0.1 ~> 1.8 default
119
- # # sidekiq-unique-jobs 6.0.25 7.1.27 ~> 6.0 default
120
- # # spring 2.1.1 4.0.0 ~> 2.0 development, test
121
- # # sprockets 3.7.2 4.1.1 ~> 3.7 default
122
- # # sprockets-rails 3.2.2 3.4.2
123
- # # timecop 0.8.1 0.9.5 = 0.8.1 development, test
124
- # # tzinfo 1.2.10 2.0.5
125
- # # uglifier 3.2.0 4.2.0 ~> 3.2 default
126
- # # unicorn 5.8.0 6.1.0 ~> 5.3 default
127
- # # webmock 3.13.0 3.14.0 = 3.13.0 development, test
128
- # # websocket-driver 0.6.5 0.7.5
129
-
130
15
  # rag.add_option :skip_namespace , type: :boolean , default: false , description: "Skip namespace (affects only isolated engines)"
131
16
  # rag.add_option :skip_collision_check , type: :boolean , default: false , description: "Skip collision check"
132
17
  rag.add_option :force , type: :boolean , default: nil , description: 'Overwrite files that already exist'
@@ -223,13 +108,15 @@ KConfig.configure do |config|
223
108
  # NEW GEM ADDONS
224
109
  rag.add_option :add_acts_as_list , type: :boolean, default: false
225
110
  rag.add_option :add_browser , type: :boolean, default: false
111
+ rag.add_option :add_bcrypt_ruby , type: :boolean, default: false
226
112
  rag.add_option :add_chartkick , type: :boolean, default: false
227
113
  rag.add_option :add_faker , type: :boolean, default: false
228
114
  rag.add_option :add_groupdate , type: :boolean, default: false
229
115
  rag.add_option :add_hexapdf , type: :boolean, default: false
230
116
  rag.add_option :add_httparty , type: :boolean, default: false
231
117
  rag.add_option :add_honeybadger , type: :boolean, default: false
232
- rag.add_option :add_mini_magick , type: :boolean, default: false , description: 'Add Mini Magick gem'
118
+ rag.add_option :add_mini_magick , type: :boolean, default: false
119
+ rag.add_option :add_phony_rails , type: :boolean, default: false
233
120
  rag.add_option :add_public_suffix , type: :boolean, default: false
234
121
  rag.add_option :add_rails_html_sanitizer , type: :boolean, default: false
235
122
  rag.add_option :add_twilio_ruby , type: :boolean, default: false
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAppGenerator
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.8'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.2.5",
3
+ "version": "0.2.8",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.2.5",
9
+ "version": "0.2.8",
10
10
  "dependencies": {
11
11
  "daisyui": "^2.20.0"
12
12
  },
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.2.5",
3
+ "version": "0.2.8",
4
4
  "description": "Create new Rails Application with custom opinions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "bcrypt_ruby",
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/bcrypt_ruby/_.rb",
10
+ "add_bcrypt_ruby": true
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "phony_rails",
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/phony_rails/_.rb",
10
+ "add_phony_rails": true
11
+ }
12
+ }
@@ -33,6 +33,7 @@ def setup_db
33
33
  # add_scaffold('product', 'name', 'price:integer')
34
34
 
35
35
  # db_migrate
36
+ # db_seed
36
37
  end
37
38
 
38
39
  # Other template command examples
@@ -11,16 +11,11 @@
11
11
  <%- else -%>
12
12
  <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
13
13
  <%- end -%>
14
- <style>
15
- .alert { color: red; }
16
- .notice { color: green; }
17
- </style>
18
14
  </head>
19
15
 
20
16
  <body>
21
17
  <%%= render 'layouts/navbar' %>
22
18
  <main>
23
- <%%= render 'layouts/alerts' %>
24
19
  <%%= yield %>
25
20
  </main>
26
21
  <%%= render 'layouts/footer' %>
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.5
4
+ version: 0.2.8
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-10 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootsnap
@@ -189,6 +189,16 @@ 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/bcrypt_ruby/_.rb
193
+ - after_templates/addons/bcrypt_ruby/app/controllers/home_controller.rb
194
+ - after_templates/addons/bcrypt_ruby/app/models/user.rb
195
+ - after_templates/addons/bcrypt_ruby/app/views/home/index.html.erb
196
+ - after_templates/addons/bcrypt_ruby/app/views/layouts/_footer.html.erb
197
+ - after_templates/addons/bcrypt_ruby/app/views/layouts/_navbar.html.erb
198
+ - after_templates/addons/bcrypt_ruby/app/views/layouts/application.html.erb
199
+ - after_templates/addons/bcrypt_ruby/app/views/users/_form.html.erb
200
+ - after_templates/addons/bcrypt_ruby/app/views/users/_user.html.erb
201
+ - after_templates/addons/bcrypt_ruby/db/seeds.rb
192
202
  - after_templates/addons/browser/_.rb
193
203
  - after_templates/addons/browser/app/controllers/home_controller.rb
194
204
  - after_templates/addons/browser/app/views/home/index.html.erb
@@ -250,6 +260,11 @@ files:
250
260
  - after_templates/addons/mini_magick/app/views/layouts/_footer.html.erb
251
261
  - after_templates/addons/mini_magick/app/views/layouts/_navbar.html.erb
252
262
  - after_templates/addons/mini_magick/app/views/layouts/application.html.erb
263
+ - after_templates/addons/phony_rails/_.rb
264
+ - after_templates/addons/phony_rails/app/controllers/home_controller.rb
265
+ - after_templates/addons/phony_rails/app/views/home/index.html.erb
266
+ - after_templates/addons/phony_rails/app/views/layouts/application.html.erb
267
+ - after_templates/addons/phony_rails/db/seeds.rb
253
268
  - after_templates/addons/public_suffix/_.rb
254
269
  - after_templates/addons/public_suffix/app/controllers/home_controller.rb
255
270
  - after_templates/addons/public_suffix/app/views/home/index.html.erb
@@ -466,6 +481,7 @@ files:
466
481
  - lib/rails_app_generator/addon_util.rb
467
482
  - lib/rails_app_generator/addons/acts_as_list.rb
468
483
  - lib/rails_app_generator/addons/annotate.rb
484
+ - lib/rails_app_generator/addons/bcrypt_ruby.rb
469
485
  - lib/rails_app_generator/addons/browser.rb
470
486
  - lib/rails_app_generator/addons/chartkick.rb
471
487
  - lib/rails_app_generator/addons/continuous_integration.rb
@@ -486,6 +502,7 @@ files:
486
502
  - lib/rails_app_generator/addons/irbrc.rb
487
503
  - lib/rails_app_generator/addons/lograge.rb
488
504
  - lib/rails_app_generator/addons/mini_magick.rb
505
+ - lib/rails_app_generator/addons/phony_rails.rb
489
506
  - lib/rails_app_generator/addons/public_suffix.rb
490
507
  - lib/rails_app_generator/addons/pundit.rb
491
508
  - lib/rails_app_generator/addons/rails_html_sanitizer.rb
@@ -534,6 +551,7 @@ files:
534
551
  - package-lock.json
535
552
  - package.json
536
553
  - profiles/addons/acts_as_list.json
554
+ - profiles/addons/bcrypt_ruby.json
537
555
  - profiles/addons/browser.json
538
556
  - profiles/addons/chartkick.json
539
557
  - profiles/addons/dotenv.json
@@ -543,6 +561,7 @@ files:
543
561
  - profiles/addons/httparty.json
544
562
  - profiles/addons/lograge.json
545
563
  - profiles/addons/mini_magick.json
564
+ - profiles/addons/phony_rails.json
546
565
  - profiles/addons/public_suffix.json
547
566
  - profiles/addons/rails-html-sanitizer.json
548
567
  - profiles/addons/rubocop.json
@@ -610,7 +629,6 @@ files:
610
629
  - templates/thor_task/profile/after_template.rb
611
630
  - templates/thor_task/profile/app/controllers/home_controller.rb
612
631
  - templates/thor_task/profile/app/views/home/index.html.erb.tt
613
- - templates/thor_task/profile/app/views/layouts/_alerts.html.erb.tt
614
632
  - templates/thor_task/profile/app/views/layouts/_footer.html.erb.tt
615
633
  - templates/thor_task/profile/app/views/layouts/_navbar.html.erb
616
634
  - templates/thor_task/profile/app/views/layouts/application.html.erb.tt
@@ -1,2 +0,0 @@
1
- <% flash.each do |type, msg| %><div class="<%= type %>"><%= msg %></div><% end %>
2
- <% if flash.any? %><hr /><% end %>