rails-interactive 0.1.9 → 2.1.0
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 +4 -4
- data/.github/workflows/main.yml +57 -57
- data/.rubocop.yml +9 -0
- data/Gemfile.lock +77 -72
- data/README.md +1 -1
- data/bin/console +2 -9
- data/lib/cli/category.rb +18 -0
- data/lib/cli/command.rb +29 -0
- data/lib/cli/command_handler.rb +32 -0
- data/lib/cli/config/categories.yml +51 -0
- data/lib/cli/config/commands.yml +128 -0
- data/lib/cli/message.rb +55 -0
- data/lib/cli/prompt.rb +42 -0
- data/lib/{rails_interactive → cli}/templates/setup_avo.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_awesome_print.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_better_errors.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_brakeman.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_bullet.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_cancancan.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_devise.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_faker.rb +0 -0
- data/lib/cli/templates/setup_friendly_id.rb +5 -0
- data/lib/{rails_interactive → cli}/templates/setup_graphql.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_haml.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_kaminari.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_letter_opener.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_omniauth.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_pundit.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_rails_admin.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_rspec.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_rubocop.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_sidekiq.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_slim.rb +0 -0
- data/lib/{rails_interactive → cli}/templates/setup_standardrb.rb +0 -0
- data/lib/cli/utils.rb +38 -0
- data/lib/{rails_interactive → cli}/version.rb +3 -1
- data/lib/rails_interactive.rb +71 -100
- data/rails-interactive.gemspec +4 -2
- metadata +60 -26
- data/lib/rails_interactive/message.rb +0 -52
- data/lib/rails_interactive/prompt.rb +0 -40
- data/lib/rails_interactive/templates/setup_friendly_id.rb +0 -26
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 482ad6f26a28d35ab5a4d58ea8f0f56bfe977bd1096bfc25a26bed05cf318b1f
|
|
4
|
+
data.tar.gz: fad72c7fec9fe01a3e28ba23e370f1c200155ad2207dc32e8c57b969c0b4e882
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a91c4823bd9b5322c5e72b3fb402edba3d8d90f951aeb5c9b4e7762ea14a50bb91669995b2171a6a478d70b2e4234f5b55870d7c3eaa1ef159535cdd08c3a3f
|
|
7
|
+
data.tar.gz: 17c8c28bfa9286d09bb0e72a56372f40438a68ff594836fbca9e1146a7709f443ae37ccfeddce8e4cd842ac83025018b1171f98a8a6799b4d5918aed384bc2b1
|
data/.github/workflows/main.yml
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
name: Release and Publish
|
|
2
|
-
on:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
jobs:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
# name: Release and Publish
|
|
2
|
+
# on:
|
|
3
|
+
# push:
|
|
4
|
+
# branches:
|
|
5
|
+
# - main
|
|
6
|
+
# jobs:
|
|
7
|
+
# build:
|
|
8
|
+
# runs-on: ubuntu-latest
|
|
9
|
+
# steps:
|
|
10
|
+
# - name: Wait for tests to succeed
|
|
11
|
+
# uses: lewagon/wait-on-check-action@v1.0.0
|
|
12
|
+
# with:
|
|
13
|
+
# ref: ${{ github.ref }}
|
|
14
|
+
# check-name: 'Run tests'
|
|
15
|
+
# repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
16
|
+
# wait-interval: 10
|
|
17
|
+
# - uses: GoogleCloudPlatform/release-please-action@v2
|
|
18
|
+
# id: release
|
|
19
|
+
# with:
|
|
20
|
+
# release-type: ruby
|
|
21
|
+
# package-name: rails-interactive
|
|
22
|
+
# version-file: 'lib/rails_interactive/version.rb'
|
|
23
|
+
# - uses: actions/checkout@v2
|
|
24
|
+
# if: ${{ steps.release.outputs.release_created }}
|
|
25
|
+
# - name: Set up Ruby
|
|
26
|
+
# uses: ruby/setup-ruby@v1
|
|
27
|
+
# if: ${{ steps.release.outputs.release_created }}
|
|
28
|
+
# with:
|
|
29
|
+
# ruby-version: 3.0.2
|
|
30
|
+
# bundler-cache: true
|
|
31
|
+
# - name: Bundle Install
|
|
32
|
+
# run: bundle install
|
|
33
|
+
# if: ${{ steps.release.outputs.release_created }}
|
|
34
|
+
# - name: Set Credentials
|
|
35
|
+
# run: |
|
|
36
|
+
# mkdir -p $HOME/.gem
|
|
37
|
+
# touch $HOME/.gem/credentials
|
|
38
|
+
# chmod 0600 $HOME/.gem/credentials
|
|
39
|
+
# printf -- "---\n:github: Bearer ${GITHUB_TOKEN}\n" > $HOME/.gem/credentials
|
|
40
|
+
# printf -- "---\n:rubygems_api_key: ${RUBYGEMS_TOKEN}\n" > $HOME/.gem/credentials
|
|
41
|
+
# if: ${{ steps.release.outputs.release_created }}
|
|
42
|
+
# env:
|
|
43
|
+
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
44
|
+
# RUBYGEMS_TOKEN: '${{secrets.RUBYGEMS_TOKEN}}'
|
|
45
|
+
# - name: Publish to GitHub Packages
|
|
46
|
+
# run: |
|
|
47
|
+
# export OWNER=$( echo ${{ github.repository }} | cut -d "/" -f 1 )
|
|
48
|
+
# gem build *.gemspec
|
|
49
|
+
# gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
|
50
|
+
# gem push *.gem
|
|
51
|
+
# if: ${{ steps.release.outputs.release_created }}
|
|
52
|
+
# - name: Publish to RubyGems
|
|
53
|
+
# run: |
|
|
54
|
+
# gem build *.gemspec
|
|
55
|
+
# gem push --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
|
56
|
+
# gem push *.gem
|
|
57
|
+
# if: ${{ steps.release.outputs.release_created }}
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,73 +1,73 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rails-interactive (
|
|
4
|
+
rails-interactive (2.1.0)
|
|
5
5
|
tty-prompt
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
|
-
actioncable (7.0.
|
|
11
|
-
actionpack (= 7.0.
|
|
12
|
-
activesupport (= 7.0.
|
|
10
|
+
actioncable (7.0.3)
|
|
11
|
+
actionpack (= 7.0.3)
|
|
12
|
+
activesupport (= 7.0.3)
|
|
13
13
|
nio4r (~> 2.0)
|
|
14
14
|
websocket-driver (>= 0.6.1)
|
|
15
|
-
actionmailbox (7.0.
|
|
16
|
-
actionpack (= 7.0.
|
|
17
|
-
activejob (= 7.0.
|
|
18
|
-
activerecord (= 7.0.
|
|
19
|
-
activestorage (= 7.0.
|
|
20
|
-
activesupport (= 7.0.
|
|
15
|
+
actionmailbox (7.0.3)
|
|
16
|
+
actionpack (= 7.0.3)
|
|
17
|
+
activejob (= 7.0.3)
|
|
18
|
+
activerecord (= 7.0.3)
|
|
19
|
+
activestorage (= 7.0.3)
|
|
20
|
+
activesupport (= 7.0.3)
|
|
21
21
|
mail (>= 2.7.1)
|
|
22
22
|
net-imap
|
|
23
23
|
net-pop
|
|
24
24
|
net-smtp
|
|
25
|
-
actionmailer (7.0.
|
|
26
|
-
actionpack (= 7.0.
|
|
27
|
-
actionview (= 7.0.
|
|
28
|
-
activejob (= 7.0.
|
|
29
|
-
activesupport (= 7.0.
|
|
25
|
+
actionmailer (7.0.3)
|
|
26
|
+
actionpack (= 7.0.3)
|
|
27
|
+
actionview (= 7.0.3)
|
|
28
|
+
activejob (= 7.0.3)
|
|
29
|
+
activesupport (= 7.0.3)
|
|
30
30
|
mail (~> 2.5, >= 2.5.4)
|
|
31
31
|
net-imap
|
|
32
32
|
net-pop
|
|
33
33
|
net-smtp
|
|
34
34
|
rails-dom-testing (~> 2.0)
|
|
35
|
-
actionpack (7.0.
|
|
36
|
-
actionview (= 7.0.
|
|
37
|
-
activesupport (= 7.0.
|
|
35
|
+
actionpack (7.0.3)
|
|
36
|
+
actionview (= 7.0.3)
|
|
37
|
+
activesupport (= 7.0.3)
|
|
38
38
|
rack (~> 2.0, >= 2.2.0)
|
|
39
39
|
rack-test (>= 0.6.3)
|
|
40
40
|
rails-dom-testing (~> 2.0)
|
|
41
41
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
42
|
-
actiontext (7.0.
|
|
43
|
-
actionpack (= 7.0.
|
|
44
|
-
activerecord (= 7.0.
|
|
45
|
-
activestorage (= 7.0.
|
|
46
|
-
activesupport (= 7.0.
|
|
42
|
+
actiontext (7.0.3)
|
|
43
|
+
actionpack (= 7.0.3)
|
|
44
|
+
activerecord (= 7.0.3)
|
|
45
|
+
activestorage (= 7.0.3)
|
|
46
|
+
activesupport (= 7.0.3)
|
|
47
47
|
globalid (>= 0.6.0)
|
|
48
48
|
nokogiri (>= 1.8.5)
|
|
49
|
-
actionview (7.0.
|
|
50
|
-
activesupport (= 7.0.
|
|
49
|
+
actionview (7.0.3)
|
|
50
|
+
activesupport (= 7.0.3)
|
|
51
51
|
builder (~> 3.1)
|
|
52
52
|
erubi (~> 1.4)
|
|
53
53
|
rails-dom-testing (~> 2.0)
|
|
54
54
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
55
|
-
activejob (7.0.
|
|
56
|
-
activesupport (= 7.0.
|
|
55
|
+
activejob (7.0.3)
|
|
56
|
+
activesupport (= 7.0.3)
|
|
57
57
|
globalid (>= 0.3.6)
|
|
58
|
-
activemodel (7.0.
|
|
59
|
-
activesupport (= 7.0.
|
|
60
|
-
activerecord (7.0.
|
|
61
|
-
activemodel (= 7.0.
|
|
62
|
-
activesupport (= 7.0.
|
|
63
|
-
activestorage (7.0.
|
|
64
|
-
actionpack (= 7.0.
|
|
65
|
-
activejob (= 7.0.
|
|
66
|
-
activerecord (= 7.0.
|
|
67
|
-
activesupport (= 7.0.
|
|
58
|
+
activemodel (7.0.3)
|
|
59
|
+
activesupport (= 7.0.3)
|
|
60
|
+
activerecord (7.0.3)
|
|
61
|
+
activemodel (= 7.0.3)
|
|
62
|
+
activesupport (= 7.0.3)
|
|
63
|
+
activestorage (7.0.3)
|
|
64
|
+
actionpack (= 7.0.3)
|
|
65
|
+
activejob (= 7.0.3)
|
|
66
|
+
activerecord (= 7.0.3)
|
|
67
|
+
activesupport (= 7.0.3)
|
|
68
68
|
marcel (~> 1.0)
|
|
69
69
|
mini_mime (>= 1.1.0)
|
|
70
|
-
activesupport (7.0.
|
|
70
|
+
activesupport (7.0.3)
|
|
71
71
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
72
72
|
i18n (>= 1.6, < 2)
|
|
73
73
|
minitest (>= 5.1)
|
|
@@ -75,8 +75,9 @@ GEM
|
|
|
75
75
|
ast (2.4.2)
|
|
76
76
|
builder (3.2.4)
|
|
77
77
|
byebug (11.1.3)
|
|
78
|
+
coderay (1.1.3)
|
|
78
79
|
colorize (0.8.1)
|
|
79
|
-
concurrent-ruby (1.1.
|
|
80
|
+
concurrent-ruby (1.1.10)
|
|
80
81
|
crass (1.0.6)
|
|
81
82
|
diff-lcs (1.5.0)
|
|
82
83
|
digest (3.1.0)
|
|
@@ -85,8 +86,7 @@ GEM
|
|
|
85
86
|
activesupport (>= 5.0)
|
|
86
87
|
i18n (1.10.0)
|
|
87
88
|
concurrent-ruby (~> 1.0)
|
|
88
|
-
|
|
89
|
-
loofah (2.14.0)
|
|
89
|
+
loofah (2.18.0)
|
|
90
90
|
crass (~> 1.0.2)
|
|
91
91
|
nokogiri (>= 1.5.9)
|
|
92
92
|
mail (2.7.1)
|
|
@@ -103,56 +103,58 @@ GEM
|
|
|
103
103
|
digest
|
|
104
104
|
net-protocol
|
|
105
105
|
timeout
|
|
106
|
-
net-protocol (0.1.
|
|
107
|
-
io-wait
|
|
106
|
+
net-protocol (0.1.3)
|
|
108
107
|
timeout
|
|
109
108
|
net-smtp (0.3.1)
|
|
110
109
|
digest
|
|
111
110
|
net-protocol
|
|
112
111
|
timeout
|
|
113
112
|
nio4r (2.5.8)
|
|
114
|
-
nokogiri (1.13.
|
|
113
|
+
nokogiri (1.13.6-x86_64-darwin)
|
|
115
114
|
racc (~> 1.4)
|
|
116
|
-
nokogiri (1.13.
|
|
115
|
+
nokogiri (1.13.6-x86_64-linux)
|
|
117
116
|
racc (~> 1.4)
|
|
118
|
-
parallel (1.
|
|
119
|
-
parser (3.1.
|
|
117
|
+
parallel (1.22.1)
|
|
118
|
+
parser (3.1.2.0)
|
|
120
119
|
ast (~> 2.4.1)
|
|
121
120
|
pastel (0.8.0)
|
|
122
121
|
tty-color (~> 0.5)
|
|
122
|
+
pry (0.14.1)
|
|
123
|
+
coderay (~> 1.1)
|
|
124
|
+
method_source (~> 1.0)
|
|
123
125
|
racc (1.6.0)
|
|
124
|
-
rack (2.2.3)
|
|
126
|
+
rack (2.2.3.1)
|
|
125
127
|
rack-test (1.1.0)
|
|
126
128
|
rack (>= 1.0, < 3)
|
|
127
|
-
rails (7.0.
|
|
128
|
-
actioncable (= 7.0.
|
|
129
|
-
actionmailbox (= 7.0.
|
|
130
|
-
actionmailer (= 7.0.
|
|
131
|
-
actionpack (= 7.0.
|
|
132
|
-
actiontext (= 7.0.
|
|
133
|
-
actionview (= 7.0.
|
|
134
|
-
activejob (= 7.0.
|
|
135
|
-
activemodel (= 7.0.
|
|
136
|
-
activerecord (= 7.0.
|
|
137
|
-
activestorage (= 7.0.
|
|
138
|
-
activesupport (= 7.0.
|
|
129
|
+
rails (7.0.3)
|
|
130
|
+
actioncable (= 7.0.3)
|
|
131
|
+
actionmailbox (= 7.0.3)
|
|
132
|
+
actionmailer (= 7.0.3)
|
|
133
|
+
actionpack (= 7.0.3)
|
|
134
|
+
actiontext (= 7.0.3)
|
|
135
|
+
actionview (= 7.0.3)
|
|
136
|
+
activejob (= 7.0.3)
|
|
137
|
+
activemodel (= 7.0.3)
|
|
138
|
+
activerecord (= 7.0.3)
|
|
139
|
+
activestorage (= 7.0.3)
|
|
140
|
+
activesupport (= 7.0.3)
|
|
139
141
|
bundler (>= 1.15.0)
|
|
140
|
-
railties (= 7.0.
|
|
142
|
+
railties (= 7.0.3)
|
|
141
143
|
rails-dom-testing (2.0.3)
|
|
142
144
|
activesupport (>= 4.2.0)
|
|
143
145
|
nokogiri (>= 1.6)
|
|
144
146
|
rails-html-sanitizer (1.4.2)
|
|
145
147
|
loofah (~> 2.3)
|
|
146
|
-
railties (7.0.
|
|
147
|
-
actionpack (= 7.0.
|
|
148
|
-
activesupport (= 7.0.
|
|
148
|
+
railties (7.0.3)
|
|
149
|
+
actionpack (= 7.0.3)
|
|
150
|
+
activesupport (= 7.0.3)
|
|
149
151
|
method_source
|
|
150
152
|
rake (>= 12.2)
|
|
151
153
|
thor (~> 1.0)
|
|
152
154
|
zeitwerk (~> 2.5)
|
|
153
155
|
rainbow (3.1.1)
|
|
154
156
|
rake (13.0.6)
|
|
155
|
-
regexp_parser (2.
|
|
157
|
+
regexp_parser (2.5.0)
|
|
156
158
|
rexml (3.2.5)
|
|
157
159
|
rspec (3.11.0)
|
|
158
160
|
rspec-core (~> 3.11.0)
|
|
@@ -163,25 +165,25 @@ GEM
|
|
|
163
165
|
rspec-expectations (3.11.0)
|
|
164
166
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
165
167
|
rspec-support (~> 3.11.0)
|
|
166
|
-
rspec-mocks (3.11.
|
|
168
|
+
rspec-mocks (3.11.1)
|
|
167
169
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
168
170
|
rspec-support (~> 3.11.0)
|
|
169
171
|
rspec-support (3.11.0)
|
|
170
|
-
rubocop (1.
|
|
172
|
+
rubocop (1.30.0)
|
|
171
173
|
parallel (~> 1.10)
|
|
172
174
|
parser (>= 3.1.0.0)
|
|
173
175
|
rainbow (>= 2.2.2, < 4.0)
|
|
174
176
|
regexp_parser (>= 1.8, < 3.0)
|
|
175
|
-
rexml
|
|
176
|
-
rubocop-ast (>= 1.
|
|
177
|
+
rexml (>= 3.2.5, < 4.0)
|
|
178
|
+
rubocop-ast (>= 1.18.0, < 2.0)
|
|
177
179
|
ruby-progressbar (~> 1.7)
|
|
178
180
|
unicode-display_width (>= 1.4.0, < 3.0)
|
|
179
|
-
rubocop-ast (1.
|
|
181
|
+
rubocop-ast (1.18.0)
|
|
180
182
|
parser (>= 3.1.1.0)
|
|
181
183
|
ruby-progressbar (1.11.0)
|
|
182
|
-
strscan (3.0.
|
|
184
|
+
strscan (3.0.3)
|
|
183
185
|
thor (1.2.1)
|
|
184
|
-
timeout (0.
|
|
186
|
+
timeout (0.3.0)
|
|
185
187
|
tty-color (0.6.0)
|
|
186
188
|
tty-cursor (0.7.1)
|
|
187
189
|
tty-prompt (0.23.1)
|
|
@@ -199,6 +201,7 @@ GEM
|
|
|
199
201
|
websocket-extensions (>= 0.1.0)
|
|
200
202
|
websocket-extensions (0.1.5)
|
|
201
203
|
wisper (2.0.1)
|
|
204
|
+
yaml (0.2.0)
|
|
202
205
|
zeitwerk (2.5.4)
|
|
203
206
|
|
|
204
207
|
PLATFORMS
|
|
@@ -209,12 +212,14 @@ DEPENDENCIES
|
|
|
209
212
|
bundler
|
|
210
213
|
byebug (~> 11.1.2)
|
|
211
214
|
colorize
|
|
215
|
+
pry
|
|
212
216
|
rails
|
|
213
217
|
rails-interactive!
|
|
214
218
|
rake (~> 13.0)
|
|
215
219
|
rspec (~> 3.0)
|
|
216
220
|
rubocop (~> 1.7)
|
|
217
221
|
tty-prompt
|
|
222
|
+
yaml
|
|
218
223
|
|
|
219
224
|
BUNDLED WITH
|
|
220
225
|
2.2.22
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
](https://asciinema.org/a/mFutWNTzym5aZPqK7AgBSMjLE)
|
|
2
2
|
|
|
3
3
|
# Rails::Interactive
|
|
4
4
|
[](https://badge.fury.io/rb/rails-interactive)
|
data/bin/console
CHANGED
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
require "bundler/setup"
|
|
5
5
|
require "rails_interactive"
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require "irb"
|
|
15
|
-
IRB.start(__FILE__)
|
|
7
|
+
require "pry"
|
|
8
|
+
Pry.start
|
data/lib/cli/category.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "yaml"
|
|
4
|
+
|
|
5
|
+
module RailsInteractive
|
|
6
|
+
class CLI
|
|
7
|
+
# Categories class for the interactive CLI module
|
|
8
|
+
class Category
|
|
9
|
+
def initialize
|
|
10
|
+
@categories = YAML.load_file("#{__dir__}/config/categories.yml").uniq
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def all
|
|
14
|
+
@categories.sort_by { |category| category["weight"] }
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/cli/command.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "yaml"
|
|
4
|
+
|
|
5
|
+
module RailsInteractive
|
|
6
|
+
class CLI
|
|
7
|
+
# Commands class for the interactive CLI module
|
|
8
|
+
class Command
|
|
9
|
+
def initialize
|
|
10
|
+
@commands = YAML.load_file("#{__dir__}/config/commands.yml").uniq
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def all
|
|
14
|
+
@commands
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def find_by_identifier(identifier)
|
|
18
|
+
@commands.find { |command| command["identifier"] == identifier }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def dependencies(identifier)
|
|
22
|
+
identifier = identifier.is_a?(Array) ? identifier.join("") : identifier
|
|
23
|
+
command ||= find_by_identifier(identifier)
|
|
24
|
+
|
|
25
|
+
command["dependencies"]
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "cli/command"
|
|
4
|
+
require "yaml"
|
|
5
|
+
|
|
6
|
+
module RailsInteractive
|
|
7
|
+
class CLI
|
|
8
|
+
# Commands class for the interactive CLI module
|
|
9
|
+
class CommandHandler
|
|
10
|
+
def initialize
|
|
11
|
+
@commands = Command.new.all
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def handle_multi_options(options, dependencies = nil)
|
|
15
|
+
handle_dependencies(dependencies)
|
|
16
|
+
options.each { |option| system("bin/rails app:template LOCATION=templates/setup_#{option}.rb") }
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def handle_option(option, dependencies = nil)
|
|
20
|
+
handle_dependencies(dependencies)
|
|
21
|
+
system("bin/rails app:template LOCATION=templates/setup_#{option}.rb")
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def handle_dependencies(dependencies)
|
|
25
|
+
dependencies&.each do |dependency|
|
|
26
|
+
puts ">> Dependency Detected: #{dependency} "
|
|
27
|
+
system("bin/rails app:template LOCATION=templates/setup_#{dependency}.rb")
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
-
|
|
3
|
+
name: authentication
|
|
4
|
+
weight: 1
|
|
5
|
+
type: "multi_select"
|
|
6
|
+
required: false
|
|
7
|
+
-
|
|
8
|
+
name: authorization
|
|
9
|
+
weight: 2
|
|
10
|
+
type: "select"
|
|
11
|
+
required: false
|
|
12
|
+
-
|
|
13
|
+
name: testing
|
|
14
|
+
weight: 3
|
|
15
|
+
type: "select"
|
|
16
|
+
required: false
|
|
17
|
+
-
|
|
18
|
+
name: template_engine
|
|
19
|
+
weight: 4
|
|
20
|
+
type: "select"
|
|
21
|
+
required: false
|
|
22
|
+
-
|
|
23
|
+
name: code_quality
|
|
24
|
+
weight: 5
|
|
25
|
+
type: "select"
|
|
26
|
+
required: false
|
|
27
|
+
-
|
|
28
|
+
name: background_job
|
|
29
|
+
weight: 6
|
|
30
|
+
type: "select"
|
|
31
|
+
required: false
|
|
32
|
+
-
|
|
33
|
+
name: security
|
|
34
|
+
weight: 7
|
|
35
|
+
type: "select"
|
|
36
|
+
required: false
|
|
37
|
+
-
|
|
38
|
+
name: admin_panel
|
|
39
|
+
weight: 8
|
|
40
|
+
type: "select"
|
|
41
|
+
required: false
|
|
42
|
+
-
|
|
43
|
+
name: features
|
|
44
|
+
weight: 9
|
|
45
|
+
type: "multi_select"
|
|
46
|
+
required: false
|
|
47
|
+
-
|
|
48
|
+
name: development
|
|
49
|
+
weight: 10
|
|
50
|
+
type: "multi_select"
|
|
51
|
+
required: false
|