rails_app_generator 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfc40090a855c5ad3416566e5d0b5d9d6548c6258b538e3c19a98fa32467da92
4
- data.tar.gz: ec270928cdc2dc8da04b1a2c0ec8f511c3f53af359d8de49e1eb5ae7fb06d920
3
+ metadata.gz: d6643bb1793ae62dd9a03d88815543f732ad40b0be0014dca96028f768d5026f
4
+ data.tar.gz: 631e0d1fa33f226a1c20ad45aa4e2c034b8d7ef0477317f8485c24bf9c26dd9c
5
5
  SHA512:
6
- metadata.gz: 0e50e462d5d9617d6e5e31ef9c03cdbafbc489653006a7821b6d7c1b3cad83ddd7851aac17a73f9e673c657e2ce1ccb50b97c69f30b827fcb8a718f08c0f2195
7
- data.tar.gz: c1c52da4c520cbe826b47a20ddb6ead1b45faeaaab530c41ea1bb9eda94084fd480ba8cf20f8040d05854522e19cf7b27f3884d1b426f5082c89b2a22b257c5d
6
+ metadata.gz: 432e5274201efba75dde019a0ce0d6b03664392e47aa6f98fb78d6d24a91b57a5e85fd528fe7161ab176e9aa653525563c13a4b46bd9f8872246b4794d82286d
7
+ data.tar.gz: de5b4c0ad27d3fba243018c9d7cc488e21cd7946475976d1f0681c3bc50190b6fbee0b5ca10165ace830fbda64dbc7223b4b70ce580c33cc87a0fbeed49a2ec7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.2.4](https://github.com/klueless-io/rails_app_generator/compare/v0.2.3...v0.2.4) (2022-08-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add lograge addon ([e980bb2](https://github.com/klueless-io/rails_app_generator/commit/e980bb2ccf46a33aba755c0370a9ae263e820256))
7
+ * cops ([cce097d](https://github.com/klueless-io/rails_app_generator/commit/cce097d61da2a5d8a3d1c335a08820cacb1936f4))
8
+
1
9
  ## [0.2.3](https://github.com/klueless-io/rails_app_generator/compare/v0.2.2...v0.2.3) (2022-08-09)
2
10
 
3
11
 
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ # PublicSuffix can parse and decompose a domain name into top level domain, domain and subdomains.
4
+ #
5
+ # exe/rag addons/public_suffix
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
+
@@ -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,29 @@
1
+ <h1>Public suffix</h1>
2
+
3
+ <h2>PublicSuffix can parse and decompose a domain name into top level domain, domain and subdomains.</h2>
4
+
5
+ <hr />
6
+
7
+ <p>PublicSuffix.domain("<b>KlueLess.io</b>")</p>
8
+ <code><%= PublicSuffix.domain("KlueLess.io") %></code>
9
+ <br><br>
10
+ <p>PublicSuffix.domain("<b>AppyDave.com</b>")</p>
11
+ <code><%= PublicSuffix.domain("AppyDave.com") %></code>
12
+ <br><br>
13
+ <p>PublicSuffix.domain("<b>www.google.com</b>")</p>
14
+ <code><%= PublicSuffix.domain("www.google.com") %></code>
15
+ <br><br>
16
+ <p>PublicSuffix.domain("<b>www.google.co.uk</b>")</p>
17
+ <code><%= PublicSuffix.domain("www.google.co.uk") %></code>
18
+ <br><br>
19
+
20
+ <hr />
21
+
22
+ <p>domain = PublicSuffix.parse("<b>www.google.com</b>")</p>
23
+ <% domain = PublicSuffix.parse("www.google.com") %>
24
+
25
+ <p>tld: <code><b><%= domain.tld %></b></code>
26
+ <p>sld: <code><b><%= domain.sld %></b></code>
27
+ <p>trd: <code><b><%= domain.trd %></b></code>
28
+ <p>domain: <code><b><%= domain.domain %></b></code>
29
+ <p>subdomain: <code><b><%= domain.subdomain %></b></code>
@@ -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
+ <style>
15
+ .alert { color: red; }
16
+ .notice { color: green; }
17
+ </style>
18
+ </head>
19
+
20
+ <body>
21
+ <%%= yield %>
22
+ </body>
23
+ </html>
@@ -54,6 +54,7 @@
54
54
  "add_httparty",
55
55
  "add_honeybadger",
56
56
  "add_mini_magick",
57
+ "add_public_suffix",
57
58
  "add_rails_html_sanitizer",
58
59
  "add_twilio_ruby"
59
60
  ],
@@ -436,6 +437,13 @@
436
437
  "default": false,
437
438
  "required": false
438
439
  },
440
+ {
441
+ "name": "add_public_suffix",
442
+ "description": "Indicates when to generate add public suffix",
443
+ "type": "boolean",
444
+ "default": false,
445
+ "required": false
446
+ },
439
447
  {
440
448
  "name": "add_rails_html_sanitizer",
441
449
  "description": "Indicates when to generate add rails html sanitizer",
@@ -34,7 +34,7 @@
34
34
  "add_dotenv": false,
35
35
  "add_rubocop": false,
36
36
  "add_annotate": false,
37
- "add_lograge": true,
37
+ "add_lograge": false,
38
38
  "add_acts_as_list": false,
39
39
  "add_browser": false,
40
40
  "add_chartkick": false,
@@ -44,8 +44,9 @@
44
44
  "add_httparty": false,
45
45
  "add_honeybadger": false,
46
46
  "add_mini_magick": false,
47
+ "add_public_suffix": true,
47
48
  "add_rails_html_sanitizer": false,
48
49
  "add_twilio_ruby": false,
49
- "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/lograge/_.rb"
50
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/public_suffix/_.rb"
50
51
  }
51
52
  }
@@ -54,6 +54,7 @@
54
54
  "add_httparty",
55
55
  "add_honeybadger",
56
56
  "add_mini_magick",
57
+ "add_public_suffix",
57
58
  "add_rails_html_sanitizer",
58
59
  "add_twilio_ruby"
59
60
  ],
@@ -436,6 +437,13 @@
436
437
  "default": false,
437
438
  "required": false
438
439
  },
440
+ {
441
+ "name": "add_public_suffix",
442
+ "description": "",
443
+ "type": "boolean",
444
+ "default": false,
445
+ "required": false
446
+ },
439
447
  {
440
448
  "name": "add_rails_html_sanitizer",
441
449
  "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/lograge/_.rb",
10
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/public_suffix/_.rb",
11
11
  "database": "sqlite3",
12
12
  "skip_git": true,
13
13
  "skip_keeps": false,
@@ -44,7 +44,7 @@
44
44
  "add_dotenv": false,
45
45
  "add_rubocop": false,
46
46
  "add_annotate": false,
47
- "add_lograge": true,
47
+ "add_lograge": false,
48
48
  "add_acts_as_list": false,
49
49
  "add_browser": false,
50
50
  "add_chartkick": false,
@@ -54,6 +54,7 @@
54
54
  "add_httparty": false,
55
55
  "add_honeybadger": false,
56
56
  "add_mini_magick": false,
57
+ "add_public_suffix": true,
57
58
  "add_rails_html_sanitizer": false,
58
59
  "add_twilio_ruby": false
59
60
  }
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ # lib/rails_app_generator/rag_initializer.rb
4
+ # rag.add_option :add_public_suffix , type: :boolean, default: false
5
+
6
+ module RailsAppGenerator
7
+ # Custom add-ons for RailsAppGenerator
8
+ module AddOns
9
+ # Add PublicSuffix to rails application
10
+ class PublicSuffix < RailsAppGenerator::Addon
11
+ 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
+
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
31
+ end
32
+ end
33
+ end
@@ -31,7 +31,6 @@ KConfig.configure do |config|
31
31
  # # paper_trail 10.3.1 12.3.0 ~> 10.3 default
32
32
  # # pg 0.21.0 1.4.2 ~> 0.20 default
33
33
  # # pg_search 2.3.0 2.3.6 ~> 2.0 default
34
- # # pry 0.13.1 0.14.1
35
34
  # # public_suffix 2.0.5 5.0.0 ~> 2.0 default
36
35
  # # pusher 1.4.3 2.0.2 ~> 1.3 default
37
36
  # # rack-mini-profiler 0.10.7 3.0.0 ~> 0.10 default
@@ -222,17 +221,18 @@ KConfig.configure do |config|
222
221
  # rag.add_option :add_shoulda , type: :boolean, default: false
223
222
 
224
223
  # NEW GEM ADDONS
225
- rag.add_option :add_acts_as_list , type: :boolean, default: false
226
- rag.add_option :add_browser , type: :boolean, default: false
227
- rag.add_option :add_chartkick , type: :boolean, default: false
228
- rag.add_option :add_faker , type: :boolean, default: false
229
- rag.add_option :add_groupdate , type: :boolean, default: false
230
- rag.add_option :add_hexapdf , type: :boolean, default: false
231
- rag.add_option :add_httparty , type: :boolean, default: false
232
- rag.add_option :add_honeybadger , type: :boolean, default: false
233
- rag.add_option :add_mini_magick , type: :boolean, default: false , description: 'Add Mini Magick gem'
234
- rag.add_option :add_rails_html_sanitizer , type: :boolean, default: false
235
- rag.add_option :add_twilio_ruby , type: :boolean, default: false
224
+ rag.add_option :add_acts_as_list , type: :boolean, default: false
225
+ rag.add_option :add_browser , type: :boolean, default: false
226
+ rag.add_option :add_chartkick , type: :boolean, default: false
227
+ rag.add_option :add_faker , type: :boolean, default: false
228
+ rag.add_option :add_groupdate , type: :boolean, default: false
229
+ rag.add_option :add_hexapdf , type: :boolean, default: false
230
+ rag.add_option :add_httparty , type: :boolean, default: false
231
+ 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'
233
+ rag.add_option :add_public_suffix , type: :boolean, default: false
234
+ rag.add_option :add_rails_html_sanitizer , type: :boolean, default: false
235
+ rag.add_option :add_twilio_ruby , type: :boolean, default: false
236
236
  end
237
237
 
238
238
  # Make sure that RailsOptions reflect the options available from Railties
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAppGenerator
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.5'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.2.4",
9
+ "version": "0.2.5",
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.4",
3
+ "version": "0.2.5",
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": "public_suffix",
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/public_suffix/_.rb",
10
+ "add_public_suffix": true
11
+ }
12
+ }
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # require 'pry'
4
-
5
3
  # <%= data.description %>
6
4
  #
7
5
  # exe/rag addons/<%= data.name_snake %>
@@ -10,6 +8,8 @@ self.local_template_path = File.dirname(__FILE__)
10
8
 
11
9
  gac 'base rails 7 image created'
12
10
 
11
+ bundle_install
12
+
13
13
  add_controller('home', 'index')
14
14
 
15
15
  route("root 'home#index'")
@@ -17,9 +17,7 @@ route("root 'home#index'")
17
17
  force_copy
18
18
 
19
19
  directory "app/controllers"
20
-
21
20
  directory "app/views/home"
22
-
23
21
  directory "app/views/layouts"
24
22
  template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
25
23
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_app_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -250,6 +250,10 @@ files:
250
250
  - after_templates/addons/mini_magick/app/views/layouts/_footer.html.erb
251
251
  - after_templates/addons/mini_magick/app/views/layouts/_navbar.html.erb
252
252
  - after_templates/addons/mini_magick/app/views/layouts/application.html.erb
253
+ - after_templates/addons/public_suffix/_.rb
254
+ - after_templates/addons/public_suffix/app/controllers/home_controller.rb
255
+ - after_templates/addons/public_suffix/app/views/home/index.html.erb
256
+ - after_templates/addons/public_suffix/app/views/layouts/application.html.erb
253
257
  - after_templates/addons/rails_html_sanitizer/_.rb
254
258
  - after_templates/addons/rails_html_sanitizer/home/index.html.erb
255
259
  - after_templates/addons/rubocop/_.rb
@@ -482,6 +486,7 @@ files:
482
486
  - lib/rails_app_generator/addons/irbrc.rb
483
487
  - lib/rails_app_generator/addons/lograge.rb
484
488
  - lib/rails_app_generator/addons/mini_magick.rb
489
+ - lib/rails_app_generator/addons/public_suffix.rb
485
490
  - lib/rails_app_generator/addons/pundit.rb
486
491
  - lib/rails_app_generator/addons/rails_html_sanitizer.rb
487
492
  - lib/rails_app_generator/addons/rspec.rb
@@ -538,6 +543,7 @@ files:
538
543
  - profiles/addons/httparty.json
539
544
  - profiles/addons/lograge.json
540
545
  - profiles/addons/mini_magick.json
546
+ - profiles/addons/public_suffix.json
541
547
  - profiles/addons/rails-html-sanitizer.json
542
548
  - profiles/addons/rubocop.json
543
549
  - profiles/addons/twilio_ruby.json