rails_app_generator 0.0.15 → 0.1.0
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 -1
- data/CHANGELOG.md +7 -0
- data/README.md +10 -1
- data/docs/project-plan/project.drawio +23 -20
- data/docs/project-plan/project_done.svg +1 -1
- data/exe/rag +23 -51
- data/lib/rails_app_generator/cli/diff.rb +49 -0
- data/lib/rails_app_generator/cli/profile.rb +37 -0
- data/lib/rails_app_generator/starter.rb +4 -0
- data/lib/rails_app_generator/version.rb +1 -1
- data/lib/rails_app_generator.rb +2 -1
- data/package-lock.json +2 -2
- data/package.json +1 -1
- metadata +3 -2
- data/lib/rails_app_generator/cli.rb +0 -64
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cfde02d61ec2b1c82f6e6f41fc1f2e2ce9b1c8cc9574e35cd979c0c5c1af461
|
4
|
+
data.tar.gz: b75d287d8ff8478b380a61eca203733273172c85e2f2e4d92151ddacd2349294
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f919095f76dfd58d779f8016cbd0d68b204b86556b31f8880961b1888b4890b0749dac2edccfc5178b82c7bbd642ca63eb7f1c6f4f32e5a9dcef533e8f78eb5
|
7
|
+
data.tar.gz: 31315631468f7b3bf3e0be1cbadbc7000db39cc5bfb74f89f022ff9a4836505b06e3b33505fe64564ef464e5b2e8e745b1342c65b0768e9a10f5514ac7a8ce8e
|
@@ -7,7 +7,6 @@ KManager.action :project_plan do
|
|
7
7
|
.page('In progress', theme: :style_03, margin_left: 0, margin_top: 0) do
|
8
8
|
grid_layout(y: 90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
9
9
|
|
10
|
-
todo(title: 'cli support for profile')
|
11
10
|
|
12
11
|
end
|
13
12
|
.page('To Do', theme: :style_02, margin_left: 0, margin_top: 0) do
|
@@ -23,6 +22,8 @@ KManager.action :project_plan do
|
|
23
22
|
|
24
23
|
grid_layout(y:90, direction: :horizontal, grid_h: 80, grid_w: 320, wrap_at: 3, grid: 0)
|
25
24
|
|
25
|
+
todo(title: 'cli support for profile')
|
26
|
+
todo(title: 'separate CLI methods into include modules')
|
26
27
|
todo(title: 'cli support for diff')
|
27
28
|
todo(title: 'add diff tool - open in editor')
|
28
29
|
todo(title: 'add diff tool supporting lhs only, rhs only, same and different')
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [0.0.15](https://github.com/klueless-io/rails_app_generator/compare/v0.0.14...v0.0.15) (2022-07-26)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* update project plan documentation ([7ed1728](https://github.com/klueless-io/rails_app_generator/commit/7ed1728e081149e56eb4292f37825169a5f21690))
|
7
|
+
|
1
8
|
## [0.0.14](https://github.com/klueless-io/rails_app_generator/compare/v0.0.13...v0.0.14) (2022-07-26)
|
2
9
|
|
3
10
|
|
data/README.md
CHANGED
@@ -22,6 +22,15 @@ Or install it yourself as:
|
|
22
22
|
gem install rails_app_generator
|
23
23
|
```
|
24
24
|
|
25
|
+
Use the Gem
|
26
|
+
|
27
|
+
```
|
28
|
+
rag rag-simple
|
29
|
+
rag rag-tailwind
|
30
|
+
rag rag-bootstrap
|
31
|
+
```
|
32
|
+
|
33
|
+
|
25
34
|
## Notes
|
26
35
|
|
27
36
|
You can use rails_app_generator to create Rails 7 applications
|
@@ -37,7 +46,7 @@ Templates for rails are separated from templates for addons
|
|
37
46
|
|
38
47
|
As a Developer, I want to create new Rails application with flexible opinions so that I can build different rails proof of concepts
|
39
48
|
|
40
|
-
|
49
|
+
[Project Plan](./docs/project-plan.md)
|
41
50
|
|
42
51
|
|
43
52
|
## Usage
|
@@ -1,49 +1,52 @@
|
|
1
|
-
<mxfile host="
|
2
|
-
<diagram id="
|
1
|
+
<mxfile host="NQB">
|
2
|
+
<diagram id="LFr" name="In progress">
|
3
3
|
<mxGraphModel dx="0" dy="0" background="#FFFAFA" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
4
4
|
<root>
|
5
|
-
<mxCell id="
|
6
|
-
<mxCell id="
|
7
|
-
<mxCell id="avE-2" value="cli support for profile" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#d5e8d4;strokeColor=#82b366;fontColor=#333333" vertex="1" parent="node_root_avE">
|
8
|
-
<mxGeometry x="10" y="10" width="300" height="60" as="geometry"/>
|
9
|
-
</mxCell>
|
5
|
+
<mxCell id="page_root_LFr" parent="LFr"/>
|
6
|
+
<mxCell id="node_root_LFr" parent="page_root_LFr"/>
|
10
7
|
</root>
|
11
8
|
</mxGraphModel>
|
12
9
|
</diagram>
|
13
|
-
<diagram id="
|
10
|
+
<diagram id="OEp" name="To Do">
|
14
11
|
<mxGraphModel dx="0" dy="0" background="#FFFAFA" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
15
12
|
<root>
|
16
|
-
<mxCell id="
|
17
|
-
<mxCell id="
|
18
|
-
<mxCell id="
|
13
|
+
<mxCell id="page_root_OEp" parent="OEp"/>
|
14
|
+
<mxCell id="node_root_OEp" parent="page_root_OEp"/>
|
15
|
+
<mxCell id="OEp-2" value="cli help support for diff" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#333333" vertex="1" parent="node_root_OEp">
|
19
16
|
<mxGeometry x="10" y="10" width="300" height="60" as="geometry"/>
|
20
17
|
</mxCell>
|
21
|
-
<mxCell id="
|
18
|
+
<mxCell id="OEp-3" value="cli support for rails new (rag new should work like rails new) - buggy, need to work through" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#333333" vertex="1" parent="node_root_OEp">
|
22
19
|
<mxGeometry x="330" y="10" width="300" height="60" as="geometry"/>
|
23
20
|
</mxCell>
|
24
|
-
<mxCell id="
|
21
|
+
<mxCell id="OEp-4" value="need an option for deleting target project path" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontColor=#333333" vertex="1" parent="node_root_OEp">
|
25
22
|
<mxGeometry x="650" y="10" width="300" height="60" as="geometry"/>
|
26
23
|
</mxCell>
|
27
24
|
</root>
|
28
25
|
</mxGraphModel>
|
29
26
|
</diagram>
|
30
|
-
<diagram id="
|
27
|
+
<diagram id="esj" name="Done">
|
31
28
|
<mxGraphModel dx="0" dy="0" background="#FFFAFA" grid="0" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
32
29
|
<root>
|
33
|
-
<mxCell id="
|
34
|
-
<mxCell id="
|
35
|
-
<mxCell id="
|
30
|
+
<mxCell id="page_root_esj" parent="esj"/>
|
31
|
+
<mxCell id="node_root_esj" parent="page_root_esj"/>
|
32
|
+
<mxCell id="esj-2" value="cli support for profile" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#f8cecc;strokeColor=#b85450;fontColor=#333333" vertex="1" parent="node_root_esj">
|
36
33
|
<mxGeometry x="10" y="10" width="300" height="60" as="geometry"/>
|
37
34
|
</mxCell>
|
38
|
-
<mxCell id="
|
35
|
+
<mxCell id="esj-3" value="separate CLI methods into include modules" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#f8cecc;strokeColor=#b85450;fontColor=#333333" vertex="1" parent="node_root_esj">
|
39
36
|
<mxGeometry x="330" y="10" width="300" height="60" as="geometry"/>
|
40
37
|
</mxCell>
|
41
|
-
<mxCell id="
|
38
|
+
<mxCell id="esj-4" value="cli support for diff" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#f8cecc;strokeColor=#b85450;fontColor=#333333" vertex="1" parent="node_root_esj">
|
42
39
|
<mxGeometry x="650" y="10" width="300" height="60" as="geometry"/>
|
43
40
|
</mxCell>
|
44
|
-
<mxCell id="
|
41
|
+
<mxCell id="esj-5" value="add diff tool - open in editor" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#f8cecc;strokeColor=#b85450;fontColor=#333333" vertex="1" parent="node_root_esj">
|
45
42
|
<mxGeometry x="10" y="90" width="300" height="60" as="geometry"/>
|
46
43
|
</mxCell>
|
44
|
+
<mxCell id="esj-6" value="add diff tool supporting lhs only, rhs only, same and different" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#f8cecc;strokeColor=#b85450;fontColor=#333333" vertex="1" parent="node_root_esj">
|
45
|
+
<mxGeometry x="330" y="90" width="300" height="60" as="geometry"/>
|
46
|
+
</mxCell>
|
47
|
+
<mxCell id="esj-7" value="add project plan to do list" style="whiteSpace=wrap;html=1;rounded=1;glass=1;fillColor=#f8cecc;strokeColor=#b85450;fontColor=#333333" vertex="1" parent="node_root_esj">
|
48
|
+
<mxGeometry x="650" y="90" width="300" height="60" as="geometry"/>
|
49
|
+
</mxCell>
|
47
50
|
</root>
|
48
51
|
</mxGraphModel>
|
49
52
|
</diagram>
|
@@ -1,3 +1,3 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="142px" viewBox="-0.5 -0.5 942 142"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">cli support for
|
3
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="942px" height="142px" viewBox="-0.5 -0.5 942 142"><defs><linearGradient x1="0%" y1="0%" x2="0%" y2="100%" id="mx-gradient-ffffff-0.9-ffffff-0.1-s-0"><stop offset="0%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.9;"/><stop offset="100%" style="stop-color: rgb(255, 255, 255); stop-opacity: 0.1;"/></linearGradient></defs><g><rect x="0" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 -1 Q -1 -1 -1 10.15 L -1 24 Q 150 42 301 24 L 301 10.15 Q 301 -1 289.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">cli support for profile</div></div></div></foreignObject><text x="150" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">cli support for profile</text></switch></g><rect x="320" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 330.15 -1 Q 319 -1 319 10.15 L 319 24 Q 470 42 621 24 L 621 10.15 Q 621 -1 609.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">separate CLI methods into include modules</div></div></div></foreignObject><text x="470" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">separate CLI methods into include modules</text></switch></g><rect x="640" y="0" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 650.15 -1 Q 639 -1 639 10.15 L 639 24 Q 790 42 941 24 L 941 10.15 Q 941 -1 929.85 -1 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 30px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">cli support for diff</div></div></div></foreignObject><text x="790" y="34" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">cli support for diff</text></switch></g><rect x="0" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 10.15 79 Q -1 79 -1 90.15 L -1 104 Q 150 122 301 104 L 301 90.15 Q 301 79 289.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 1px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add diff tool - open in editor</div></div></div></foreignObject><text x="150" y="114" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add diff tool - open in editor</text></switch></g><rect x="320" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 330.15 79 Q 319 79 319 90.15 L 319 104 Q 470 122 621 104 L 621 90.15 Q 621 79 609.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 321px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add diff tool supporting lhs only, rhs only, same and different</div></div></div></foreignObject><text x="470" y="114" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add diff tool supporting lhs only, rhs only, same...</text></switch></g><rect x="640" y="80" width="300" height="60" rx="9" ry="9" fill="#f8cecc" stroke="#b85450" pointer-events="all"/><path d="M 650.15 79 Q 639 79 639 90.15 L 639 104 Q 790 122 941 104 L 941 90.15 Q 941 79 929.85 79 Z" fill="url(#mx-gradient-ffffff-0.9-ffffff-0.1-s-0)" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility" style="overflow: visible; text-align: left;"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 298px; height: 1px; padding-top: 110px; margin-left: 641px;"><div data-drawio-colors="color: #333333; " style="box-sizing: border-box; font-size: 0px; text-align: center;"><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: rgb(51, 51, 51); line-height: 1.2; pointer-events: all; white-space: normal; overflow-wrap: normal;">add project plan to do list</div></div></div></foreignObject><text x="790" y="114" fill="#333333" font-family="Helvetica" font-size="12px" text-anchor="middle">add project plan to do list</text></switch></g></g><switch><g requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"/><a transform="translate(0,-5)" xlink:href="https://www.diagrams.net/doc/faq/svg-export-text-problems" target="_blank"><text text-anchor="middle" font-size="10px" x="50%" y="100%">Text is not SVG - cannot display</text></a></switch></svg>
|
data/exe/rag
CHANGED
@@ -9,62 +9,34 @@ $LOAD_PATH << source_path
|
|
9
9
|
|
10
10
|
require 'rails_app_generator'
|
11
11
|
|
12
|
+
first = ARGV.first
|
13
|
+
|
12
14
|
if ARGV.empty?
|
13
15
|
puts 'Please provide a profile for the new application'
|
14
16
|
puts
|
15
17
|
puts 'See --help for more info'
|
16
|
-
|
17
|
-
elsif %w[-v --version].include? ARGV[0]
|
18
|
+
elsif %w[-v --version].include?(first)
|
18
19
|
puts RailsAppGenerator::VERSION
|
19
|
-
|
20
|
+
elsif first == 'diff'
|
21
|
+
RailsAppGenerator::Cli::Diff.start(ARGV)
|
22
|
+
elsif first == 'new'
|
23
|
+
puts 'TODO: NEW'
|
24
|
+
|
25
|
+
# # Use RAG with in the same way as the Rails generator (the following commands should be equivalent)
|
26
|
+
# # rails new args
|
27
|
+
# # rag new args
|
28
|
+
# if ARGV.first == 'new'
|
29
|
+
# # NOTE: This is not yet working
|
30
|
+
# RailsAppGenerator::Cli::Standard.start ARGV[1..]
|
31
|
+
# exit 0
|
32
|
+
# elsif !ARGV.first.nil?
|
33
|
+
# end
|
34
|
+
|
35
|
+
else
|
36
|
+
fallback_profile_path = File.expand_path("#{Pathname.new(__FILE__).dirname}/../profiles")
|
37
|
+
args = ['profile'] + ARGV + ["--fallback-profile-path=#{fallback_profile_path}"]
|
38
|
+
|
39
|
+
RailsAppGenerator::Cli::Profile.start(args)
|
20
40
|
end
|
21
41
|
|
22
|
-
RailsAppGenerator::Cli.start(ARGV)
|
23
|
-
|
24
42
|
exit 0
|
25
|
-
|
26
|
-
# # Use RAG with in the same way as the Rails generator (the following commands should be equivalent)
|
27
|
-
# # rails new args
|
28
|
-
# # rag new args
|
29
|
-
# if ARGV.first == 'new'
|
30
|
-
# # NOTE: This is not yet working
|
31
|
-
# RailsAppGenerator::Cli::Standard.start ARGV[1..]
|
32
|
-
# exit 0
|
33
|
-
# elsif ARGV.first == 'diff'
|
34
|
-
# # args, opts = Thor::Arguments.split(ARGV[1..])
|
35
|
-
# RailsAppGenerator::Cli::Diff.start(ARGV[1..]) # , { lhs: true, rhs: true, compare: true } )
|
36
|
-
# exit 0
|
37
|
-
# elsif ARGV.first == 'diff_lhs'
|
38
|
-
# RailsAppGenerator::Cli::Diff.start(ARGV[1..], { lhs: true })
|
39
|
-
# exit 0
|
40
|
-
# elsif ARGV.first == 'diff_rhs'
|
41
|
-
# RailsAppGenerator::Cli::Diff.start(ARGV[1..], { rhs: true })
|
42
|
-
# exit 0
|
43
|
-
# elsif ARGV.first == 'diff_compare'
|
44
|
-
# RailsAppGenerator::Cli::Diff.start(ARGV[1..], { compare: true })
|
45
|
-
# exit 0
|
46
|
-
# elsif !ARGV.first.nil?
|
47
|
-
# profile_path = File.expand_path("#{Pathname.new(__FILE__).dirname}/../profiles")
|
48
|
-
# profile_name = ARGV[0]
|
49
|
-
# profile_name += '.json' unless profile_name.end_with?('.json')
|
50
|
-
# profile_file = File.join(profile_path, profile_name)
|
51
|
-
|
52
|
-
# RailsAppGenerator::Cli::Profile.start(profile_file)
|
53
|
-
|
54
|
-
# exit 0
|
55
|
-
# end
|
56
|
-
|
57
|
-
# if File.exist?(profile_file)
|
58
|
-
# puts "Using profile #{profile_file}"
|
59
|
-
|
60
|
-
# profile = JSON.parse(File.read(profile_file), symbolize_names: true)
|
61
|
-
# args = profile[:args]
|
62
|
-
# opts = profile[:opts]
|
63
|
-
# rails_options = RailsAppGenerator::RailsOptions.new(opts)
|
64
|
-
|
65
|
-
# instance = RailsAppGenerator::Starter.new(args)
|
66
|
-
# FileUtils.rm_rf(instance.target_path)
|
67
|
-
# instance.start(rails_options)
|
68
|
-
# else
|
69
|
-
# puts "Profile #{profile_file} not found"
|
70
|
-
# exit 1
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RailsAppGenerator
|
4
|
+
module Cli
|
5
|
+
# Folder Diff
|
6
|
+
class Diff < Thor
|
7
|
+
desc 'diff lhs_folder rhs_folder [options]', 'Diff two different rails folders'
|
8
|
+
|
9
|
+
# Run report to console for following options
|
10
|
+
option :show_left_only , type: :boolean
|
11
|
+
option :show_right_only , type: :boolean
|
12
|
+
option :show_same , type: :boolean
|
13
|
+
option :show_different , type: :boolean
|
14
|
+
|
15
|
+
# Open files in VSCode for for following options
|
16
|
+
option :open_left_only , type: :boolean
|
17
|
+
option :open_right_only , type: :boolean
|
18
|
+
option :open_same , type: :boolean
|
19
|
+
option :open_different , type: :boolean
|
20
|
+
|
21
|
+
# rubocop:disable Metrics/AbcSize
|
22
|
+
def diff(lhs_folder, rhs_folder)
|
23
|
+
# puts "Diffing #{lhs_folder} and #{rhs_folder}"
|
24
|
+
# puts JSON.pretty_generate(options)
|
25
|
+
processor = RailsAppGenerator::Diff::Processor.new(lhs_folder, rhs_folder)
|
26
|
+
compare_info = processor.compare
|
27
|
+
|
28
|
+
report = RailsAppGenerator::Diff::Report.new(
|
29
|
+
compare_info,
|
30
|
+
show_left_only: options[:show_left_only],
|
31
|
+
show_right_only: options[:show_right_only],
|
32
|
+
show_same: options[:show_same],
|
33
|
+
show_different: options[:show_different]
|
34
|
+
)
|
35
|
+
report.display
|
36
|
+
|
37
|
+
vscode = RailsAppGenerator::Diff::OpenInEditor.new(
|
38
|
+
compare_info,
|
39
|
+
open_left_only: options[:open_left_only],
|
40
|
+
open_right_only: options[:open_right_only],
|
41
|
+
open_same: options[:open_same],
|
42
|
+
open_different: options[:show_different]
|
43
|
+
)
|
44
|
+
vscode.open
|
45
|
+
end
|
46
|
+
# rubocop:enable Metrics/AbcSize
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RailsAppGenerator
|
4
|
+
module Cli
|
5
|
+
# Folder Diff
|
6
|
+
class Profile < Thor
|
7
|
+
desc 'xxx [options]', 'Create a new rails app based on a RAG profile'
|
8
|
+
|
9
|
+
option :profile_path , type: :string
|
10
|
+
option :fallback_profile_path , type: :string
|
11
|
+
|
12
|
+
# rubocop:disable Metrics/AbcSize
|
13
|
+
def profile(name)
|
14
|
+
path = options[:profile_path] || options[:fallback_profile_path]
|
15
|
+
profile_name = name.end_with?('.json') ? name : "#{name}.json"
|
16
|
+
profile_file = File.join(path, profile_name)
|
17
|
+
|
18
|
+
unless File.exist?(profile_file)
|
19
|
+
puts "Profile [#{profile_file}] not found"
|
20
|
+
exit 1
|
21
|
+
end
|
22
|
+
|
23
|
+
puts "Using profile #{profile_file}"
|
24
|
+
|
25
|
+
profile = JSON.parse(File.read(profile_file), symbolize_names: true)
|
26
|
+
args = profile[:args]
|
27
|
+
opts = RailsAppGenerator::RailsOptions.new(profile[:opts])
|
28
|
+
|
29
|
+
starter = RailsAppGenerator::Starter.new(args)
|
30
|
+
|
31
|
+
starter.delete_target_folder
|
32
|
+
starter.start(opts)
|
33
|
+
end
|
34
|
+
# rubocop:enable Metrics/AbcSize
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/rails_app_generator.rb
CHANGED
@@ -8,7 +8,8 @@ require 'rails/generators/rails/app/app_generator'
|
|
8
8
|
require 'bundler'
|
9
9
|
|
10
10
|
require 'rails_app_generator/version'
|
11
|
-
require 'rails_app_generator/cli'
|
11
|
+
require 'rails_app_generator/cli/diff'
|
12
|
+
require 'rails_app_generator/cli/profile'
|
12
13
|
require 'rails_app_generator/util'
|
13
14
|
require 'rails_app_generator/diff/file_pair'
|
14
15
|
require 'rails_app_generator/diff/compare_info'
|
data/package-lock.json
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "rails_app_generator",
|
3
|
-
"version": "0.0
|
3
|
+
"version": "0.1.0",
|
4
4
|
"lockfileVersion": 2,
|
5
5
|
"requires": true,
|
6
6
|
"packages": {
|
7
7
|
"": {
|
8
8
|
"name": "rails_app_generator",
|
9
|
-
"version": "0.0
|
9
|
+
"version": "0.1.0",
|
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
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.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Cruwys
|
@@ -207,7 +207,8 @@ files:
|
|
207
207
|
- lib/rails_app_generator/addons/views.rb
|
208
208
|
- lib/rails_app_generator/app_builder.rb
|
209
209
|
- lib/rails_app_generator/app_generator.rb
|
210
|
-
- lib/rails_app_generator/cli.rb
|
210
|
+
- lib/rails_app_generator/cli/diff.rb
|
211
|
+
- lib/rails_app_generator/cli/profile.rb
|
211
212
|
- lib/rails_app_generator/context.rb
|
212
213
|
- lib/rails_app_generator/dependencies.rb
|
213
214
|
- lib/rails_app_generator/diff/compare_info.rb
|
@@ -1,64 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RailsAppGenerator
|
4
|
-
# Thor CLI
|
5
|
-
class Cli < Thor
|
6
|
-
desc 'diff lhs_folder rhs_folder [options]', 'Diff two different rails folders'
|
7
|
-
|
8
|
-
# Run report to console for following options
|
9
|
-
option :show_left_only , type: :boolean
|
10
|
-
option :show_right_only , type: :boolean
|
11
|
-
option :show_same , type: :boolean
|
12
|
-
option :show_different , type: :boolean
|
13
|
-
|
14
|
-
# Open files in VSCode for for following options
|
15
|
-
option :open_left_only , type: :boolean
|
16
|
-
option :open_right_only , type: :boolean
|
17
|
-
option :open_same , type: :boolean
|
18
|
-
option :open_different , type: :boolean
|
19
|
-
|
20
|
-
# rubocop:disable Metrics/AbcSize
|
21
|
-
def diff(lhs_folder, rhs_folder)
|
22
|
-
# puts "Diffing #{lhs_folder} and #{rhs_folder}"
|
23
|
-
# puts JSON.pretty_generate(options)
|
24
|
-
processor = RailsAppGenerator::Diff::Processor.new(lhs_folder, rhs_folder)
|
25
|
-
compare_info = processor.compare
|
26
|
-
|
27
|
-
report = RailsAppGenerator::Diff::Report.new(
|
28
|
-
compare_info,
|
29
|
-
show_left_only: options[:show_left_only],
|
30
|
-
show_right_only: options[:show_right_only],
|
31
|
-
show_same: options[:show_same],
|
32
|
-
show_different: options[:show_different]
|
33
|
-
)
|
34
|
-
report.display
|
35
|
-
|
36
|
-
vscode = RailsAppGenerator::Diff::OpenInEditor.new(
|
37
|
-
compare_info,
|
38
|
-
open_left_only: options[:open_left_only],
|
39
|
-
open_right_only: options[:open_right_only],
|
40
|
-
open_same: options[:open_same],
|
41
|
-
open_different: options[:show_different]
|
42
|
-
)
|
43
|
-
vscode.open
|
44
|
-
end
|
45
|
-
# rubocop:enable Metrics/AbcSize
|
46
|
-
|
47
|
-
# def initialize(profile_file)
|
48
|
-
# @profile_file = profile_file
|
49
|
-
# end
|
50
|
-
|
51
|
-
# def run
|
52
|
-
# puts "Using profile #{profile_file}"
|
53
|
-
|
54
|
-
# profile = JSON.parse(File.read(profile_file), symbolize_names: true)
|
55
|
-
# args = profile[:args]
|
56
|
-
# opts = profile[:opts]
|
57
|
-
# rails_options = RailsAppGenerator::RailsOptions.new(opts)
|
58
|
-
|
59
|
-
# instance = RailsAppGenerator::Starter.new(args)
|
60
|
-
# FileUtils.rm_rf(instance.target_path)
|
61
|
-
# instance.start(rails_options)
|
62
|
-
# end
|
63
|
-
end
|
64
|
-
end
|