rails_app_generator 0.0.7 → 0.0.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/after_templates/README.md +3 -0
  4. data/after_templates/___base_template.rb +1 -0
  5. data/after_templates/___r7_hotwire.rb +1 -0
  6. data/after_templates/rag_bootstrap/application-yield.html.erb +5 -0
  7. data/after_templates/rag_bootstrap/application.html.erb +4 -0
  8. data/after_templates/rag_bootstrap/component-cards-fancy.css +84 -0
  9. data/after_templates/rag_bootstrap/component-cards-fancy.html +80 -0
  10. data/after_templates/rag_bootstrap/component-cards-staff.css +90 -0
  11. data/after_templates/rag_bootstrap/component-cards-staff.html +140 -0
  12. data/after_templates/rag_bootstrap/component-cards-styled.html +31 -0
  13. data/after_templates/rag_bootstrap/component-footer.html +34 -0
  14. data/after_templates/rag_bootstrap/component-hero.html +15 -0
  15. data/after_templates/rag_bootstrap/component-nav.html +36 -0
  16. data/after_templates/rag_bootstrap/custom-bootstrap-import.scss +5 -0
  17. data/after_templates/rag_bootstrap/custom-using-css.css +3 -0
  18. data/after_templates/rag_bootstrap/custom-using-scss.scss +5 -0
  19. data/after_templates/rag_bootstrap/manifest.js +3 -0
  20. data/after_templates/rag_bootstrap.rb +1 -0
  21. data/after_templates/rag_simple.rb +25 -0
  22. data/after_templates/rag_tailwind.rb +74 -0
  23. data/lib/rails_app_generator/app_generator.rb +47 -5
  24. data/lib/rails_app_generator/version.rb +1 -1
  25. data/package-lock.json +2 -2
  26. data/package.json +1 -1
  27. data/profiles/rag-bootstrap.json +2 -0
  28. data/profiles/rag-simple.json +2 -1
  29. data/profiles/rag-tailwind.json +12 -0
  30. metadata +36 -3
  31. data/after_templates/test.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7729b3a10ff4b9d4608b9c5cbd2e3fefe036a43b90066b447f4048b252a893b
4
- data.tar.gz: 02c9a488f5a9296402f5923935fdcd88b69346d8f2337b34dc335640b532cd45
3
+ metadata.gz: 41476a3a9b133970991c3fbf3562c102ba8249f5b682233f20d84884fb8af678
4
+ data.tar.gz: 3a9cf1a5878bbee17e0cfff3c6facac2c8af128bd940ce5bdc6bd5894b6c8cf3
5
5
  SHA512:
6
- metadata.gz: dae7db0f0f6c5656253178dc635e141cd84289fab9d5c7bd621e337732d14f752969902df3e8458fbf43c8ff6239e79fb2d8f077a023ba1e6cb8ae539a5f6070
7
- data.tar.gz: d14b704ed3d27d52f85bfd36e07be35490fb0c42f05a182504073c0fbcc59a5d27511a2ce59dfa54209438d449472ac3d71e28687c2e04d8cd7e3f3d9dc25c7d
6
+ metadata.gz: 5c88ba2a2ea096fd88795844acd1437af6cc87398f63002ad34dfe99576284ef8ede1e6f34c57b1fe7be9b4fccf174d25211a9084ee8691004c7ed243bc6c061
7
+ data.tar.gz: 0a16711784c631424eea1d80174697b1e04df33d8803b0963e23b76f70c625ceaa05815b665c81ea78c6958872676632187d487e160e1781e90b914d93a1ef00
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.0.7](https://github.com/klueless-io/rails_app_generator/compare/v0.0.6...v0.0.7) (2022-07-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add support for profiles and after templates ([1ecf4ab](https://github.com/klueless-io/rails_app_generator/commit/1ecf4abef1bc0f45928a33319ed9db8bebe1c27a))
7
+
1
8
  ## [0.0.6](https://github.com/klueless-io/rails_app_generator/compare/v0.0.5...v0.0.6) (2022-07-21)
2
9
 
3
10
 
@@ -0,0 +1,3 @@
1
+ # After Templates
2
+
3
+ A set of templates that can be used via the `--template` argument
@@ -0,0 +1 @@
1
+ # frozen_string_literal: true
@@ -0,0 +1 @@
1
+ # frozen_string_literal: true
@@ -0,0 +1,5 @@
1
+ <div class="container">
2
+ <div class="row">
3
+ <%= yield %>
4
+ </div>
5
+ </div>
@@ -0,0 +1,4 @@
1
+ <%= stylesheet_link_tag "custom-using-css" %>
2
+ <%= stylesheet_link_tag "custom-using-scss" %>
3
+ <%= stylesheet_link_tag "custom-component" %>
4
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g==" crossorigin="anonymous" referrerpolicy="no-referrer" />
@@ -0,0 +1,84 @@
1
+ // Cards 1 : Source: https://codepen.io/donho_zamo/pen/YzXzPXZ
2
+
3
+ /*---- Main Style ----*/
4
+ #cards_landscape_wrap-2{
5
+ text-align: center;
6
+ background: #F7F7F7;
7
+ }
8
+ #cards_landscape_wrap-2 .container{
9
+ padding-top: 80px;
10
+ padding-bottom: 100px;
11
+ }
12
+ #cards_landscape_wrap-2 a{
13
+ text-decoration: none;
14
+ outline: none;
15
+ }
16
+ #cards_landscape_wrap-2 .card-flyer {
17
+ border-radius: 5px;
18
+ }
19
+ #cards_landscape_wrap-2 .card-flyer .image-box{
20
+ background: #ffffff;
21
+ overflow: hidden;
22
+ box-shadow: 0px 2px 15px rgba(0, 0, 0, 0.50);
23
+ border-radius: 5px;
24
+ }
25
+ #cards_landscape_wrap-2 .card-flyer .image-box img{
26
+ -webkit-transition:all .9s ease;
27
+ -moz-transition:all .9s ease;
28
+ -o-transition:all .9s ease;
29
+ -ms-transition:all .9s ease;
30
+ width: 100%;
31
+ height: 200px;
32
+ }
33
+ #cards_landscape_wrap-2 .card-flyer:hover .image-box img{
34
+ opacity: 0.7;
35
+ -webkit-transform:scale(1.15);
36
+ -moz-transform:scale(1.15);
37
+ -ms-transform:scale(1.15);
38
+ -o-transform:scale(1.15);
39
+ transform:scale(1.15);
40
+ }
41
+ #cards_landscape_wrap-2 .card-flyer .text-box{
42
+ text-align: center;
43
+ }
44
+ #cards_landscape_wrap-2 .card-flyer .text-box .text-container{
45
+ padding: 30px 18px;
46
+ }
47
+ #cards_landscape_wrap-2 .card-flyer{
48
+ background: #FFFFFF;
49
+ margin-top: 50px;
50
+ -webkit-transition: all 0.2s ease-in;
51
+ -moz-transition: all 0.2s ease-in;
52
+ -ms-transition: all 0.2s ease-in;
53
+ -o-transition: all 0.2s ease-in;
54
+ transition: all 0.2s ease-in;
55
+ box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.40);
56
+ }
57
+ #cards_landscape_wrap-2 .card-flyer:hover{
58
+ background: #fff;
59
+ box-shadow: 0px 15px 26px rgba(0, 0, 0, 0.50);
60
+ -webkit-transition: all 0.2s ease-in;
61
+ -moz-transition: all 0.2s ease-in;
62
+ -ms-transition: all 0.2s ease-in;
63
+ -o-transition: all 0.2s ease-in;
64
+ transition: all 0.2s ease-in;
65
+ margin-top: 50px;
66
+ }
67
+ #cards_landscape_wrap-2 .card-flyer .text-box p{
68
+ margin-top: 10px;
69
+ margin-bottom: 0px;
70
+ padding-bottom: 0px;
71
+ font-size: 14px;
72
+ letter-spacing: 1px;
73
+ color: #000000;
74
+ }
75
+ #cards_landscape_wrap-2 .card-flyer .text-box h6{
76
+ margin-top: 0px;
77
+ margin-bottom: 4px;
78
+ font-size: 18px;
79
+ font-weight: bold;
80
+ text-transform: uppercase;
81
+ font-family: 'Roboto Black', sans-serif;
82
+ letter-spacing: 1px;
83
+ color: #00acc1;
84
+ }
@@ -0,0 +1,80 @@
1
+ <!-- Topic Cards -->
2
+ <div id="cards_landscape_wrap-2">
3
+ <div class="container">
4
+ <div class="row">
5
+ <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
6
+ <a href="">
7
+ <div class="card-flyer">
8
+ <div class="text-box">
9
+ <div class="image-box">
10
+ <img src="https://cdn.pixabay.com/photo/2018/03/30/15/11/deer-3275594_960_720.jpg" alt="" />
11
+ </div>
12
+ <div class="text-container">
13
+ <h6>Title 01</h6>
14
+ <p>
15
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
16
+ industry's standard dummy text ever since the 1500s.
17
+ </p>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </a>
22
+ </div>
23
+ <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
24
+ <a href="">
25
+ <div class="card-flyer">
26
+ <div class="text-box">
27
+ <div class="image-box">
28
+ <img src="https://cdn.pixabay.com/photo/2018/04/09/19/55/low-poly-3305284_960_720.jpg" alt="" />
29
+ </div>
30
+ <div class="text-container">
31
+ <h6>Title 02</h6>
32
+ <p>
33
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
34
+ industry's standard dummy text ever since the 1500s.
35
+ </p>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </a>
40
+ </div>
41
+ <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
42
+ <a href="">
43
+ <div class="card-flyer">
44
+ <div class="text-box">
45
+ <div class="image-box">
46
+ <img src="https://cdn.pixabay.com/photo/2018/04/06/13/46/poly-3295856_960_720.png" alt="" />
47
+ </div>
48
+
49
+ <div class="text-container">
50
+ <h6>Title 03</h6>
51
+ <p>
52
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
53
+ industry's standard dummy text ever since the 1500s.
54
+ </p>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </a>
59
+ </div>
60
+ <div class="col-xs-12 col-sm-6 col-md-3 col-lg-3">
61
+ <a href="">
62
+ <div class="card-flyer">
63
+ <div class="text-box">
64
+ <div class="image-box">
65
+ <img src="https://cdn.pixabay.com/photo/2018/03/30/15/12/dog-3275593_960_720.jpg" alt="" />
66
+ </div>
67
+ <div class="text-container">
68
+ <h6>Title 04</h6>
69
+ <p>
70
+ Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the
71
+ industry's standard dummy text ever since the 1500s.
72
+ </p>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ </a>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
@@ -0,0 +1,90 @@
1
+ // Cards 2 - Source: https://codepen.io/design007/pen/KKmbZzm
2
+
3
+ @import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
4
+ @import url('https://use.fontawesome.com/releases/v5.13.0/css/all.css');
5
+ :root {
6
+ --font3: 'Roboto', sans-serif;
7
+ }
8
+
9
+ .h1,
10
+ h1 {
11
+ font-size: 1.5rem;
12
+ }
13
+
14
+ .container-fluid {
15
+ max-width: 1400px;
16
+ }
17
+
18
+ .card {
19
+ background: #fff;
20
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08), 0 0 6px rgba(0, 0, 0, 0.05);
21
+ border: 1;
22
+ border-radius: 1rem;
23
+ }
24
+
25
+ .img-hover-zoom--colorize img {
26
+ border-radius: 50%;
27
+ width: 150px;
28
+ height: auto;
29
+ margin-top: 20px;
30
+ padding: 1px;
31
+ transition: transform 0.5s;
32
+ filter: grayscale(100%);
33
+ }
34
+
35
+ .img-hover-zoom--colorize:hover img {
36
+ filter: grayscale(0);
37
+ transform: scale(1.05);
38
+ }
39
+
40
+ .card h5 {
41
+ overflow: hidden;
42
+ height: 80px;
43
+ font-weight: 300;
44
+ font-size: 1rem;
45
+ }
46
+
47
+ .card h5 a {
48
+ color: black;
49
+ text-decoration: none;
50
+ }
51
+
52
+ .role {
53
+ color: #7a7a7a;
54
+ }
55
+
56
+ .box {
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ }
61
+
62
+ .fab {
63
+ font-size: 1.5rem;
64
+ color: darkgray;
65
+ transition: transform 0.5s;
66
+ }
67
+
68
+ .fab:hover {
69
+ color: black;
70
+ transform: scale(1.1);
71
+ }
72
+
73
+ .card h2 {
74
+ font-size: 1rem;
75
+ }
76
+
77
+ /* MEDIA */
78
+
79
+ @media only screen and (min-width: 1200px) {
80
+ .img-hover-zoom--colorize img {
81
+ width: 200px;
82
+ }
83
+ }
84
+
85
+ @media only screen and (min-width: 1200px) {
86
+ .h1,
87
+ h1 {
88
+ font-size: 2rem;
89
+ }
90
+ }
@@ -0,0 +1,140 @@
1
+ <div class="container p-5">
2
+ <div class="row row-cols-1 row-cols-xs-2 row-cols-sm-2 row-cols-lg-4 g-3">
3
+ <div class="col">
4
+ <div class="card h-100 shadow-sm">
5
+ <div class="text-center">
6
+ <div class="img-hover-zoom img-hover-zoom--colorize">
7
+ <img
8
+ class="shadow"
9
+ src="https://source.unsplash.com/rDEOVtE7vOs/600x600"
10
+ alt="Another Image zoom-on-hover effect"
11
+ />
12
+ </div>
13
+ </div>
14
+
15
+ <div class="card-body">
16
+ <div class="clearfix mb-3"></div>
17
+
18
+ <div class="my-2 text-center">
19
+ <h1>Mia Wallace</h1>
20
+ </div>
21
+ <div class="mb-3">
22
+ <h2 class="text-uppercase text-center role">Senior Frontend Developer</h2>
23
+ </div>
24
+ <div class="box">
25
+ <div>
26
+ <ul class="list-inline">
27
+ <li class="list-inline-item"><i class="fab fa-github"></i></li>
28
+ <li class="list-inline-item"><i class="fab fa-linkedin-in"></i></li>
29
+ <li class="list-inline-item"><i class="fab fa-instagram"></i></li>
30
+ <li class="list-inline-item"><i class="fab fa-twitter"></i></li>
31
+ </ul>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ <div class="col">
38
+ <div class="card h-100 shadow-sm">
39
+ <div class="text-center">
40
+ <div class="img-hover-zoom img-hover-zoom--colorize">
41
+ <img
42
+ class="shadow"
43
+ src="https://source.unsplash.com/XHVpWcr5grQ/600x600"
44
+ alt="Another Image zoom-on-hover effect"
45
+ />
46
+ </div>
47
+ </div>
48
+
49
+ <div class="card-body">
50
+ <div class="clearfix mb-3"></div>
51
+
52
+ <div class="my-2 text-center">
53
+ <h1>Vincent Vega</h1>
54
+ </div>
55
+ <div class="mb-3">
56
+ <h2 class="text-uppercase text-center role">SEO Specialist</h2>
57
+ </div>
58
+ <div class="box">
59
+ <div>
60
+ <ul class="list-inline">
61
+ <li class="list-inline-item"><i class="fab fa-github"></i></li>
62
+ <li class="list-inline-item"><i class="fab fa-linkedin-in"></i></li>
63
+ <li class="list-inline-item"><i class="fab fa-instagram"></i></li>
64
+ <li class="list-inline-item"><i class="fab fa-twitter"></i></li>
65
+ </ul>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </div>
71
+ <div class="col">
72
+ <div class="card h-100 shadow-sm">
73
+ <div class="text-center">
74
+ <div class="img-hover-zoom img-hover-zoom--colorize">
75
+ <img
76
+ class="shadow"
77
+ src="https://source.unsplash.com/n4KewLKFOZw/600x600"
78
+ alt="Another Image zoom-on-hover effect"
79
+ />
80
+ </div>
81
+ </div>
82
+
83
+ <div class="card-body">
84
+ <div class="clearfix mb-3"></div>
85
+
86
+ <div class="my-2 text-center">
87
+ <h1>Mr. Wolf</h1>
88
+ </div>
89
+ <div class="mb-3">
90
+ <h2 class="text-uppercase text-center role">DIGITAL MARKETING SPECIALIST</h2>
91
+ </div>
92
+ <div class="box">
93
+ <div>
94
+ <ul class="list-inline">
95
+ <li class="list-inline-item"><i class="fab fa-github"></i></li>
96
+ <li class="list-inline-item"><i class="fab fa-linkedin-in"></i></li>
97
+ <li class="list-inline-item"><i class="fab fa-instagram"></i></li>
98
+ <li class="list-inline-item"><i class="fab fa-twitter"></i></li>
99
+ </ul>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ </div>
105
+ <div class="col">
106
+ <div class="card h-100 shadow-sm">
107
+ <div class="text-center">
108
+ <div class="img-hover-zoom img-hover-zoom--colorize">
109
+ <img
110
+ class="shadow"
111
+ src="https://source.unsplash.com/B4TjXnI0Y2c/600x600"
112
+ alt="Another Image zoom-on-hover effect"
113
+ />
114
+ </div>
115
+ </div>
116
+
117
+ <div class="card-body">
118
+ <div class="clearfix mb-3"></div>
119
+
120
+ <div class="my-2 text-center">
121
+ <h1>O-Ren Ishii</h1>
122
+ </div>
123
+ <div class="mb-3">
124
+ <h2 class="text-uppercase text-center role">Web Developer</h2>
125
+ </div>
126
+ <div class="box">
127
+ <div>
128
+ <ul class="list-inline">
129
+ <li class="list-inline-item"><i class="fab fa-github"></i></li>
130
+ <li class="list-inline-item"><i class="fab fa-linkedin-in"></i></li>
131
+ <li class="list-inline-item"><i class="fab fa-instagram"></i></li>
132
+ <li class="list-inline-item"><i class="fab fa-twitter"></i></li>
133
+ </ul>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ </div>
140
+ </div>
@@ -0,0 +1,31 @@
1
+ <div class="m-4">
2
+ <div class="row row-cols-1 row-cols-md-3 g-3">
3
+ <div class="col">
4
+ <!-- Card with default left text alignment -->
5
+ <div class="card">
6
+ <div class="card-body card1">
7
+ <h3 class="card-title">Bootstrap @import</h3>
8
+ <p class="card-text">Use standard SAAS transpiling</p>
9
+ </div>
10
+ </div>
11
+ </div>
12
+ <div class="col">
13
+ <!-- Card with center text alignment -->
14
+ <div class="card text-center">
15
+ <div class="card-body card2">
16
+ <h3 class="card-title">CSS</h3>
17
+ <p class="card-text">Using plain CSS files</p>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ <div class="col">
22
+ <!-- Card with right text alignment -->
23
+ <div class="card text-end">
24
+ <div class="card-body card3">
25
+ <h3 class="card-title">SCSS</h3>
26
+ <p class="card-text">Using SASS/SCSS files</p>
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
@@ -0,0 +1,34 @@
1
+ <footer class="bg-dark text-center text-white">
2
+ <!-- Grid container -->
3
+ <div class="container p-4 pb-0">
4
+ <!-- Section: Social media -->
5
+ <section class="mb-4">
6
+ <!-- Facebook -->
7
+ <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-facebook-f"></i></a>
8
+
9
+ <!-- Twitter -->
10
+ <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-twitter"></i></a>
11
+
12
+ <!-- Google -->
13
+ <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-google"></i></a>
14
+
15
+ <!-- Instagram -->
16
+ <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-instagram"></i></a>
17
+
18
+ <!-- Linkedin -->
19
+ <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-linkedin-in"></i></a>
20
+
21
+ <!-- Github -->
22
+ <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-github"></i></a>
23
+ </section>
24
+ <!-- Section: Social media -->
25
+ </div>
26
+ <!-- Grid container -->
27
+
28
+ <!-- Copyright -->
29
+ <div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2)">
30
+ © 2020 Copyright:
31
+ <a class="text-white" href="https://mdbootstrap.com/">MDBootstrap.com</a>
32
+ </div>
33
+ <!-- Copyright -->
34
+ </footer>
@@ -0,0 +1,15 @@
1
+ <div class="px-4 pt-5 my-5 text-center border-bottom">
2
+ <h1 class="display-4 fw-bold">Centered screenshot</h1>
3
+ <div class="col-lg-6 mx-auto">
4
+ <p class="lead mb-4">Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.</p>
5
+ <div class="d-grid gap-2 d-sm-flex justify-content-sm-center mb-5">
6
+ <button type="button" class="btn btn-primary btn-lg px-4 me-sm-3" data-bs-toggle="modal" data-bs-target="#exampleModal">Click Me</button>
7
+ <%= link_to 'People', people_path, class: "btn btn-outline-secondary btn-lg px-4" %>
8
+ </div>
9
+ </div>
10
+ <div class="overflow-hidden" style="max-height: 30vh;">
11
+ <div class="container px-5">
12
+ <img src="https://getbootstrap.com/docs/5.0/examples/heroes/bootstrap-themes.png" class="img-fluid border rounded-3 shadow-lg mb-4" alt="Example image" width="700" height="500" loading="lazy">
13
+ </div>
14
+ </div>
15
+ </div>
@@ -0,0 +1,36 @@
1
+ <nav class="navbar navbar-expand-lg navbar-light bg-light">
2
+ <div class="container-fluid">
3
+ <a class="navbar-brand" href="#">Navbar</a>
4
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
5
+ <span class="navbar-toggler-icon"></span>
6
+ </button>
7
+ <div class="collapse navbar-collapse" id="navbarSupportedContent">
8
+ <ul class="navbar-nav me-auto mb-2 mb-lg-0">
9
+ <li class="nav-item">
10
+ <a class="nav-link active" aria-current="page" href="#">Home</a>
11
+ </li>
12
+ <li class="nav-item">
13
+ <a class="nav-link" href="#">Link</a>
14
+ </li>
15
+ <li class="nav-item dropdown">
16
+ <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
17
+ Dropdown
18
+ </a>
19
+ <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
20
+ <li><a class="dropdown-item" href="#">Action</a></li>
21
+ <li><a class="dropdown-item" href="#">Another action</a></li>
22
+ <li><hr class="dropdown-divider"></li>
23
+ <li><a class="dropdown-item" href="#">Something else here</a></li>
24
+ </ul>
25
+ </li>
26
+ <li class="nav-item">
27
+ <a class="nav-link disabled" href="#" tabindex="-1" aria-disabled="true">Disabled</a>
28
+ </li>
29
+ </ul>
30
+ <form class="d-flex">
31
+ <input class="form-control me-2" type="search" placeholder="Search" aria-label="Search">
32
+ <button class="btn btn-outline-success" type="submit">Search</button>
33
+ </form>
34
+ </div>
35
+ </div>
36
+ </nav>
@@ -0,0 +1,5 @@
1
+ .card1 {
2
+ $color-left: #ffafbd;
3
+ $color-right: #ffc3a0;
4
+ background-image: linear-gradient(to right, $color-left, $color-right);
5
+ }
@@ -0,0 +1,3 @@
1
+ .card2 {
2
+ background-image: linear-gradient(to bottom, #ff8f1f, #f32b60);
3
+ }
@@ -0,0 +1,5 @@
1
+ .card3 {
2
+ $color-left: #ffdde1;
3
+ $color-right: #ee9ca7;
4
+ background-image: linear-gradient(to right, $color-left, $color-right);
5
+ }
@@ -0,0 +1,3 @@
1
+ //= link custom-using-css.css
2
+ //= link custom-using-scss.css
3
+ //= link custom-component.css
@@ -0,0 +1 @@
1
+ # frozen_string_literal: true
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Rails 7 with Bootstrap CSS and custom CSS
4
+ # https://www.youtube.com/watch?v=tYr8yn7yRKw
5
+
6
+ require 'pry'
7
+
8
+ self.local_template_path = File.join(File.dirname(__FILE__), 'rag_simple')
9
+
10
+ gac 'base rails 7 image created'
11
+
12
+ def application_html
13
+ <<-HTML
14
+ <div class="container">
15
+ <div class="row">
16
+ <%= yield %>
17
+ </div>
18
+ </div>
19
+ HTML
20
+ end
21
+
22
+ gsub_file 'app/views/layouts/application.html.erb' , %( <%= yield %>), application_html
23
+
24
+ # after_bundle do
25
+ # end
@@ -0,0 +1,74 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Rails 7 with Bootstrap CSS and custom CSS
4
+ # resources:
5
+ # https://www.youtube.com/watch?v=tYr8yn7yRKw
6
+ # https://youtu.be/phOUsR0dm5s?t=493
7
+ # https://www.youtube.com/watch?v=nxKDTtuKOo4
8
+
9
+ require 'pry'
10
+
11
+ self.local_template_path = File.join(File.dirname(__FILE__), 'rag_bootstrap')
12
+
13
+ gac 'base rails 7 image created'
14
+
15
+ add_controller('home', 'index', 'about')
16
+ route("root 'home#index'")
17
+
18
+ # # need a join template method
19
+ # index_content = join_templates(
20
+ # 'component-nav.html',
21
+ # 'component-hero.html',
22
+ # 'component-cards-fancy.html',
23
+ # 'component-cards-staff.html',
24
+ # 'component-cards-styled.html',
25
+ # 'component-modal.html',
26
+ # 'component-footer.html',
27
+ # )
28
+
29
+ # move the nav bar into
30
+ # 'app/views/shared/_navbar.html.erb'
31
+ # and add the nav bar to the layout
32
+ # 'app/views/layouts/application.html.erb'
33
+ # <%= render partial: 'shared/navbar' %>
34
+
35
+ # create_file 'app/views/home/index.html.erb', index_content, force: true
36
+
37
+ # gem 'sassc-rails'
38
+
39
+ after_bundle do
40
+ # add_css_customizations
41
+
42
+ # add_crud_people
43
+
44
+ # rails_command("db:migrate")
45
+ end
46
+
47
+ def add_css_customizations
48
+ # Update the manifest to include the stylesheets
49
+ append_to_file 'app/assets/config/manifest.js' , read_template('manifest.js')
50
+
51
+ # This is how you would add custom styling via @import in the application.bootstrap.css
52
+ append_to_file 'app/assets/stylesheets/application.bootstrap.scss' , "@import 'custom-bootstrap-import.scss';"
53
+ create_file 'app/assets/stylesheets/custom-bootstrap-import.scss' , read_template('custom-bootstrap-import.scss')
54
+
55
+ # This is how you would add custom styling using standard CSS
56
+ create_file 'app/assets/stylesheets/custom-using-css.css' , read_template('custom-using-css.css')
57
+
58
+ # This is how you would add custom styling using standard SAAS/SCSS
59
+ create_file 'app/assets/stylesheets/custom-using-scss.scss' , read_template('custom-using-scss.scss')
60
+
61
+ # This is custom CSS for the fancier components
62
+ create_file 'app/assets/stylesheets/custom-component.css' , join_templates('component-cards-fancy.css', 'component-cards-staff.css')
63
+
64
+ # Update the layout so that the stylesheets are included
65
+ insert_into_file 'app/views/layouts/application.html.erb', read_template('application.html.erb'),
66
+ before: %( <%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>)
67
+ gsub_file 'app/views/layouts/application.html.erb', %( <%= yield %>), read_template('application-yield.html.erb')
68
+ end
69
+
70
+ def add_crud_people
71
+ # Need to get the bootstrap form styling working
72
+ # Follow the instructions at: https://youtu.be/phOUsR0dm5s?t=493
73
+ add_scaffold('people', 'first_name', 'last_name', 'age:integer', 'address:text')
74
+ end
@@ -171,6 +171,14 @@ module RailsAppGenerator
171
171
  end
172
172
 
173
173
  no_commands do
174
+ # USED BY AFTER_TEMPLATE
175
+ def gac(message)
176
+ return unless active?(:git)
177
+
178
+ git add: '.'
179
+ git commit: " -m '#{message}'"
180
+ end
181
+
174
182
  def add_controller(name, *args)
175
183
  generate(:controller, name, *args)
176
184
  end
@@ -179,14 +187,28 @@ module RailsAppGenerator
179
187
  generate(:scaffold, name, *args)
180
188
  end
181
189
 
190
+ def read_template(template_file)
191
+ path = find_in_source_paths(template_file)
192
+
193
+ File.read(path)
194
+ end
195
+
196
+ def join_templates(*template_files, join: "\n\n")
197
+ template_files.map { |template_file| read_template(template_file) }.join(join)
198
+ end
199
+
200
+ # Local template path is handy when you want template files used when working with the --template flag
201
+ attr_accessor :local_template_path
202
+
182
203
  def source_paths
183
- [
184
- context.rails_override_template_path,
185
- context.rails_template_path
186
- ]
204
+ paths = local_template_path ? [local_template_path] : []
205
+ paths << context.rails_override_template_path
206
+ paths << context.rails_template_path
207
+ paths
187
208
  end
188
209
 
189
210
  # Context wraps the configured options and can be made available to addons
211
+ # TODO: should I add local_template_path to the context?
190
212
  def context
191
213
  @context ||= Context.new(
192
214
  self.class.rails_template_path,
@@ -210,8 +232,28 @@ module RailsAppGenerator
210
232
  add(addon) if options[option_name]
211
233
  end
212
234
 
235
+ def skip_flag?(option_name)
236
+ value = options["skip_#{option_name}".to_sym]
237
+
238
+ return false if value.nil?
239
+
240
+ value == true
241
+ end
242
+
243
+ def add_flag?(option_name)
244
+ value = options["add_#{option_name}".to_sym]
245
+
246
+ return false if value.nil?
247
+
248
+ value == true
249
+ end
250
+
251
+ def active?(option_name)
252
+ add_flag?(option_name) || !skip_flag?(option_name)
253
+ end
254
+
213
255
  def uses?(addon)
214
- return false if options["skip_#{addon}".to_sym]
256
+ return false unless active?(addon)
215
257
 
216
258
  addon = AddOn.get(addon)
217
259
  Dependencies.new(addon, context).satisfied?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAppGenerator
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.0.7",
9
+ "version": "0.0.8",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.1",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Create new Rails Application with custom opinions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -5,6 +5,8 @@
5
5
  },
6
6
  "opts": {
7
7
  "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/rag_bootstrap.rb",
8
10
  "css": "bootstrap"
9
11
  }
10
12
  }
@@ -5,6 +5,7 @@
5
5
  },
6
6
  "opts": {
7
7
  "skip_git": true,
8
- "skip_bundle": true
8
+ "skip_bundle": true,
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/rag_simple.rb"
9
10
  }
10
11
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "tailwind",
4
+ "destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/rag"
5
+ },
6
+ "opts": {
7
+ "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/rag_tailwind.rb",
10
+ "css": "tailwind"
11
+ }
12
+ }
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.0.7
4
+ version: 0.0.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-07-22 00:00:00.000000000 Z
11
+ date: 2022-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bootsnap
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: tailwindcss-rails
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: turbo-rails
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -131,7 +145,25 @@ files:
131
145
  - README.md
132
146
  - Rakefile
133
147
  - after_templates/README.md
134
- - after_templates/test.rb
148
+ - after_templates/___base_template.rb
149
+ - after_templates/___r7_hotwire.rb
150
+ - after_templates/rag_bootstrap.rb
151
+ - after_templates/rag_bootstrap/application-yield.html.erb
152
+ - after_templates/rag_bootstrap/application.html.erb
153
+ - after_templates/rag_bootstrap/component-cards-fancy.css
154
+ - after_templates/rag_bootstrap/component-cards-fancy.html
155
+ - after_templates/rag_bootstrap/component-cards-staff.css
156
+ - after_templates/rag_bootstrap/component-cards-staff.html
157
+ - after_templates/rag_bootstrap/component-cards-styled.html
158
+ - after_templates/rag_bootstrap/component-footer.html
159
+ - after_templates/rag_bootstrap/component-hero.html
160
+ - after_templates/rag_bootstrap/component-nav.html
161
+ - after_templates/rag_bootstrap/custom-bootstrap-import.scss
162
+ - after_templates/rag_bootstrap/custom-using-css.css
163
+ - after_templates/rag_bootstrap/custom-using-scss.scss
164
+ - after_templates/rag_bootstrap/manifest.js
165
+ - after_templates/rag_simple.rb
166
+ - after_templates/rag_tailwind.rb
135
167
  - bin/console
136
168
  - bin/setup
137
169
  - exe/rag
@@ -192,6 +224,7 @@ files:
192
224
  - profiles/rag-add-some-pages.json
193
225
  - profiles/rag-bootstrap.json
194
226
  - profiles/rag-simple.json
227
+ - profiles/rag-tailwind.json
195
228
  - sig/rails_app_generator.rbs
196
229
  - templates/README.md.erb
197
230
  - templates/addons/annotate/auto_annotate_models.rake
@@ -1,12 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'pry'
4
-
5
- # after_bundle do
6
- # setup_rails.after_bundle
7
- # end
8
-
9
- add_scaffold('post', 'title', 'content:text')
10
- add_scaffold('book', 'title', 'content:text')
11
- # add_resource("comment", "post:references", 'content:text')
12
- # add_mailer("posts", "submitted", "broken")