rails-crud-tools 0.6.7 → 0.6.9
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/.rspec +3 -0
- data/.rubocop.yml +269 -0
- data/CHANGELOG.md +75 -0
- data/Dockerfile +21 -0
- data/Gemfile +18 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +73 -0
- data/Rakefile +12 -0
- data/docker-compose.yml +11 -0
- data/exe/console +15 -0
- data/exe/crud +30 -0
- data/exe/setup +8 -0
- data/lib/rails/crud/tools/cli.rb +186 -0
- data/lib/rails/crud/tools/constants.rb +11 -0
- data/lib/rails/crud/tools/crud_config.rb +51 -0
- data/lib/rails/crud/tools/crud_data.rb +108 -0
- data/lib/rails/crud/tools/crud_logger.rb +26 -0
- data/lib/rails/crud/tools/crud_notifications.rb +158 -0
- data/lib/rails/crud/tools/crud_operations.rb +54 -0
- data/lib/rails/crud/tools/crud_operations_logger.rb +164 -0
- data/lib/rails/crud/tools/railtie.rb +40 -0
- data/lib/rails/crud/tools/version.rb +9 -0
- data/lib/rails/crud/tools.rb +39 -0
- data/sig/rails/crud.rbs +6 -0
- data/tools/crud_macro.xlsm +0 -0
- metadata +34 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d60769342a2c4f14ca5185dac7446f06fb2ab137c2835f004da3994a97bad2d
|
4
|
+
data.tar.gz: d0f0ba569e37b04b0d5e5692b4ca60c05becc2ab3c91b0da2a315e12ca26f274
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3cfd62496d6616601689aa943fd6a4face9369249489dbb88d1be2c825b69118e28ac850cd9e91299930153a91b38ff7d9caa1413d1d5592d58ec58a9c8ce141
|
7
|
+
data.tar.gz: fcc34ae205587a64a795e07ad9d5111443a86d4913cfda3823a72358c53c0c0cca7290726b652b2a349990afb5c322402711d99ffaa544795252a448401db4e7
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,269 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.7
|
3
|
+
Exclude:
|
4
|
+
- 'ide/**/*'
|
5
|
+
- 'spec/**/*'
|
6
|
+
- 'lib/rails/crud/tools/cli.rb'
|
7
|
+
Style/StringLiterals:
|
8
|
+
Enabled: true
|
9
|
+
EnforcedStyle: double_quotes
|
10
|
+
|
11
|
+
Style/StringLiteralsInInterpolation:
|
12
|
+
Enabled: true
|
13
|
+
EnforcedStyle: double_quotes
|
14
|
+
|
15
|
+
Layout/LineLength:
|
16
|
+
Max: 200
|
17
|
+
|
18
|
+
Metrics/MethodLength:
|
19
|
+
Max: 50
|
20
|
+
|
21
|
+
Metrics/AbcSize:
|
22
|
+
Max: 60
|
23
|
+
|
24
|
+
Metrics/CyclomaticComplexity:
|
25
|
+
Max: 20
|
26
|
+
|
27
|
+
Metrics/PerceivedComplexity:
|
28
|
+
Max: 20
|
29
|
+
|
30
|
+
Metrics/ModuleLength:
|
31
|
+
Max: 120
|
32
|
+
Gemspec/AddRuntimeDependency:
|
33
|
+
Enabled: true
|
34
|
+
Gemspec/DeprecatedAttributeAssignment:
|
35
|
+
Enabled: true
|
36
|
+
Gemspec/DevelopmentDependencies:
|
37
|
+
Enabled: true
|
38
|
+
Gemspec/RequireMFA:
|
39
|
+
Enabled: true
|
40
|
+
Layout/LineContinuationLeadingSpace:
|
41
|
+
Enabled: true
|
42
|
+
Layout/LineContinuationSpacing:
|
43
|
+
Enabled: true
|
44
|
+
Layout/LineEndStringConcatenationIndentation:
|
45
|
+
Enabled: true
|
46
|
+
Layout/SpaceBeforeBrackets:
|
47
|
+
Enabled: true
|
48
|
+
Lint/AmbiguousAssignment:
|
49
|
+
Enabled: true
|
50
|
+
Lint/AmbiguousOperatorPrecedence:
|
51
|
+
Enabled: true
|
52
|
+
Lint/AmbiguousRange:
|
53
|
+
Enabled: true
|
54
|
+
Lint/ConstantOverwrittenInRescue:
|
55
|
+
Enabled: true
|
56
|
+
Lint/DeprecatedConstants:
|
57
|
+
Enabled: true
|
58
|
+
Lint/DuplicateBranch:
|
59
|
+
Enabled: true
|
60
|
+
Lint/DuplicateMagicComment:
|
61
|
+
Enabled: true
|
62
|
+
Lint/DuplicateMatchPattern:
|
63
|
+
Enabled: true
|
64
|
+
Lint/DuplicateRegexpCharacterClassElement:
|
65
|
+
Enabled: true
|
66
|
+
Lint/DuplicateSetElement:
|
67
|
+
Enabled: true
|
68
|
+
Lint/EmptyBlock:
|
69
|
+
Enabled: true
|
70
|
+
Lint/EmptyClass:
|
71
|
+
Enabled: true
|
72
|
+
Lint/EmptyInPattern:
|
73
|
+
Enabled: true
|
74
|
+
Lint/HashNewWithKeywordArgumentsAsDefault:
|
75
|
+
Enabled: true
|
76
|
+
Lint/IncompatibleIoSelectWithFiberScheduler:
|
77
|
+
Enabled: true
|
78
|
+
Lint/ItWithoutArgumentsInBlock:
|
79
|
+
Enabled: true
|
80
|
+
Lint/LambdaWithoutLiteralBlock:
|
81
|
+
Enabled: true
|
82
|
+
Lint/LiteralAssignmentInCondition:
|
83
|
+
Enabled: true
|
84
|
+
Lint/MixedCaseRange:
|
85
|
+
Enabled: true
|
86
|
+
Lint/NoReturnInBeginEndBlocks:
|
87
|
+
Enabled: true
|
88
|
+
Lint/NonAtomicFileOperation:
|
89
|
+
Enabled: true
|
90
|
+
Lint/NumberedParameterAssignment:
|
91
|
+
Enabled: true
|
92
|
+
Lint/NumericOperationWithConstantResult:
|
93
|
+
Enabled: true
|
94
|
+
Lint/OrAssignmentToConstant:
|
95
|
+
Enabled: true
|
96
|
+
Lint/RedundantDirGlobSort:
|
97
|
+
Enabled: true
|
98
|
+
Lint/RedundantRegexpQuantifiers:
|
99
|
+
Enabled: true
|
100
|
+
Lint/RefinementImportMethods:
|
101
|
+
Enabled: true
|
102
|
+
Lint/RequireRangeParentheses:
|
103
|
+
Enabled: true
|
104
|
+
Lint/RequireRelativeSelfPath:
|
105
|
+
Enabled: true
|
106
|
+
Lint/SymbolConversion:
|
107
|
+
Enabled: true
|
108
|
+
Lint/ToEnumArguments:
|
109
|
+
Enabled: true
|
110
|
+
Lint/TripleQuotes:
|
111
|
+
Enabled: true
|
112
|
+
Lint/UnescapedBracketInRegexp:
|
113
|
+
Enabled: true
|
114
|
+
Lint/UnexpectedBlockArity:
|
115
|
+
Enabled: true
|
116
|
+
Lint/UnmodifiedReduceAccumulator:
|
117
|
+
Enabled: true
|
118
|
+
Lint/UselessDefined:
|
119
|
+
Enabled: true
|
120
|
+
Lint/UselessNumericOperation:
|
121
|
+
Enabled: true
|
122
|
+
Lint/UselessRescue:
|
123
|
+
Enabled: true
|
124
|
+
Lint/UselessRuby2Keywords:
|
125
|
+
Enabled: true
|
126
|
+
Metrics/CollectionLiteralLength:
|
127
|
+
Enabled: true
|
128
|
+
Naming/BlockForwarding:
|
129
|
+
Enabled: true
|
130
|
+
Security/CompoundHash:
|
131
|
+
Enabled: true
|
132
|
+
Security/IoMethods:
|
133
|
+
Enabled: true
|
134
|
+
Style/AmbiguousEndlessMethodDefinition:
|
135
|
+
Enabled: true
|
136
|
+
Style/ArgumentsForwarding:
|
137
|
+
Enabled: true
|
138
|
+
Style/ArrayIntersect:
|
139
|
+
Enabled: true
|
140
|
+
Style/BitwisePredicate:
|
141
|
+
Enabled: true
|
142
|
+
Style/CollectionCompact:
|
143
|
+
Enabled: true
|
144
|
+
Style/CombinableDefined:
|
145
|
+
Enabled: true
|
146
|
+
Style/ComparableClamp:
|
147
|
+
Enabled: true
|
148
|
+
Style/ConcatArrayLiterals:
|
149
|
+
Enabled: true
|
150
|
+
Style/DataInheritance:
|
151
|
+
Enabled: true
|
152
|
+
Style/DigChain:
|
153
|
+
Enabled: true
|
154
|
+
Style/DirEmpty:
|
155
|
+
Enabled: true
|
156
|
+
Style/DocumentDynamicEvalDefinition:
|
157
|
+
Enabled: true
|
158
|
+
Style/EmptyHeredoc:
|
159
|
+
Enabled: true
|
160
|
+
Style/EndlessMethod:
|
161
|
+
Enabled: true
|
162
|
+
Style/EnvHome:
|
163
|
+
Enabled: true
|
164
|
+
Style/ExactRegexpMatch:
|
165
|
+
Enabled: true
|
166
|
+
Style/FetchEnvVar:
|
167
|
+
Enabled: true
|
168
|
+
Style/FileEmpty:
|
169
|
+
Enabled: true
|
170
|
+
Style/FileNull:
|
171
|
+
Enabled: true
|
172
|
+
Style/FileRead:
|
173
|
+
Enabled: true
|
174
|
+
Style/FileTouch:
|
175
|
+
Enabled: true
|
176
|
+
Style/FileWrite:
|
177
|
+
Enabled: true
|
178
|
+
Style/HashConversion:
|
179
|
+
Enabled: true
|
180
|
+
Style/HashExcept:
|
181
|
+
Enabled: true
|
182
|
+
Style/IfWithBooleanLiteralBranches:
|
183
|
+
Enabled: true
|
184
|
+
Style/InPatternThen:
|
185
|
+
Enabled: true
|
186
|
+
Style/KeywordArgumentsMerging:
|
187
|
+
Enabled: true
|
188
|
+
Style/MagicCommentFormat:
|
189
|
+
Enabled: true
|
190
|
+
Style/MapCompactWithConditionalBlock:
|
191
|
+
Enabled: true
|
192
|
+
Style/MapIntoArray:
|
193
|
+
Enabled: true
|
194
|
+
Style/MapToHash:
|
195
|
+
Enabled: true
|
196
|
+
Style/MapToSet:
|
197
|
+
Enabled: true
|
198
|
+
Style/MinMaxComparison:
|
199
|
+
Enabled: true
|
200
|
+
Style/MultilineInPatternThen:
|
201
|
+
Enabled: true
|
202
|
+
Style/NegatedIfElseCondition:
|
203
|
+
Enabled: true
|
204
|
+
Style/NestedFileDirname:
|
205
|
+
Enabled: true
|
206
|
+
Style/NilLambda:
|
207
|
+
Enabled: true
|
208
|
+
Style/NumberedParameters:
|
209
|
+
Enabled: true
|
210
|
+
Style/NumberedParametersLimit:
|
211
|
+
Enabled: true
|
212
|
+
Style/ObjectThen:
|
213
|
+
Enabled: true
|
214
|
+
Style/OpenStructUse:
|
215
|
+
Enabled: true
|
216
|
+
Style/OperatorMethodCall:
|
217
|
+
Enabled: true
|
218
|
+
Style/QuotedSymbols:
|
219
|
+
Enabled: true
|
220
|
+
Style/RedundantArgument:
|
221
|
+
Enabled: true
|
222
|
+
Style/RedundantArrayConstructor:
|
223
|
+
Enabled: true
|
224
|
+
Style/RedundantConstantBase:
|
225
|
+
Enabled: true
|
226
|
+
Style/RedundantCurrentDirectoryInPath:
|
227
|
+
Enabled: true
|
228
|
+
Style/RedundantDoubleSplatHashBraces:
|
229
|
+
Enabled: true
|
230
|
+
Style/RedundantEach:
|
231
|
+
Enabled: true
|
232
|
+
Style/RedundantFilterChain:
|
233
|
+
Enabled: true
|
234
|
+
Style/RedundantHeredocDelimiterQuotes:
|
235
|
+
Enabled: true
|
236
|
+
Style/RedundantInitialize:
|
237
|
+
Enabled: true
|
238
|
+
Style/RedundantInterpolationUnfreeze:
|
239
|
+
Enabled: true
|
240
|
+
Style/RedundantLineContinuation:
|
241
|
+
Enabled: true
|
242
|
+
Style/RedundantRegexpArgument:
|
243
|
+
Enabled: true
|
244
|
+
Style/RedundantRegexpConstructor:
|
245
|
+
Enabled: true
|
246
|
+
Style/RedundantSelfAssignmentBranch:
|
247
|
+
Enabled: true
|
248
|
+
Style/RedundantStringEscape:
|
249
|
+
Enabled: true
|
250
|
+
Style/ReturnNilInPredicateMethodDefinition:
|
251
|
+
Enabled: true
|
252
|
+
Style/SafeNavigationChainLength:
|
253
|
+
Enabled: true
|
254
|
+
Style/SelectByRegexp:
|
255
|
+
Enabled: true
|
256
|
+
Style/SendWithLiteralMethodName:
|
257
|
+
Enabled: true
|
258
|
+
Style/SingleLineDoEndBlock:
|
259
|
+
Enabled: true
|
260
|
+
Style/StringChars:
|
261
|
+
Enabled: true
|
262
|
+
Style/SuperArguments:
|
263
|
+
Enabled: true
|
264
|
+
Style/SuperWithArgsParentheses:
|
265
|
+
Enabled: true
|
266
|
+
Style/SwapValues:
|
267
|
+
Enabled: true
|
268
|
+
Style/YAMLFileRead:
|
269
|
+
Enabled: true
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
## [0.6.3] - 2025-01-09
|
2
|
+
- refactoring gem dependency
|
3
|
+
|
4
|
+
## [0.6.2] - 2025-01-09
|
5
|
+
- bug fix:uninitialized constant RubyXL::Cell
|
6
|
+
|
7
|
+
## [0.6.1] - 2025-01-09
|
8
|
+
- Rubocop support
|
9
|
+
- Change of configuration file name
|
10
|
+
|
11
|
+
## [0.6.0] - 2025-01-08
|
12
|
+
- Support for select insert, select update, and select delete
|
13
|
+
|
14
|
+
## [0.5.0] - 2025-01-07
|
15
|
+
- Multiple table support
|
16
|
+
|
17
|
+
## [0.4.3] - 2025-01-07
|
18
|
+
- Refactored `crud_notifications.rb`.
|
19
|
+
- Modified to not execute the `setup` method in `tools.rb` when running commands.
|
20
|
+
|
21
|
+
## [0.4.2] - 2025-01-06
|
22
|
+
- Fixed to update the last modifier of the CRUD file
|
23
|
+
- Changed CRUD file saving process to asynchronous processing
|
24
|
+
|
25
|
+
## [0.4.1] - 2025-01-04
|
26
|
+
- Create the base directory if it does not exist during initialization
|
27
|
+
|
28
|
+
## [0.4.0] - 2025-01-04
|
29
|
+
- Fixed to save only when cell values change
|
30
|
+
- Added sheet name to configuration file
|
31
|
+
- Added font name to configuration file
|
32
|
+
- Created test code
|
33
|
+
- Added initialization command
|
34
|
+
- Added configuration file creation command
|
35
|
+
|
36
|
+
## [0.3.2] - 2025-01-01
|
37
|
+
- Multi-thread support
|
38
|
+
|
39
|
+
## [0.3.1] - 2024-12-31
|
40
|
+
- Changed to rails-crud-tools
|
41
|
+
|
42
|
+
## [0.3.0] - 2024-12-30
|
43
|
+
- Job support
|
44
|
+
- Added command to generate CRUD diagrams
|
45
|
+
|
46
|
+
## [0.2.2] - 2024-12-25
|
47
|
+
- Added ON/OFF for SQL output
|
48
|
+
- Improved summary log
|
49
|
+
|
50
|
+
## [0.2.1] - 2024-12-25
|
51
|
+
- Refactoring
|
52
|
+
|
53
|
+
## [0.2.0] - 2024-12-25
|
54
|
+
- API support
|
55
|
+
|
56
|
+
## [0.1.6] - 2024-12-25
|
57
|
+
- Improved logging
|
58
|
+
|
59
|
+
## [0.1.5] - 2024-12-25
|
60
|
+
- Improved multi-threading
|
61
|
+
|
62
|
+
## [0.1.4] - 2024-12-24
|
63
|
+
- Refactoring
|
64
|
+
|
65
|
+
## [0.1.3] - 2024-12-24
|
66
|
+
- Bug fix
|
67
|
+
|
68
|
+
## [0.1.2] - 2024-12-24
|
69
|
+
- Bug fix
|
70
|
+
|
71
|
+
## [0.1.1] - 2024-12-24
|
72
|
+
- Preview release
|
73
|
+
|
74
|
+
## [0.1.0] - 2024-12-23
|
75
|
+
- Initial release
|
data/Dockerfile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
FROM ruby:3.1.4
|
2
|
+
|
3
|
+
ARG IDEURL=https://download.jetbrains.com/ruby/RubyMine-2024.3.1.1.tar.gz
|
4
|
+
|
5
|
+
RUN apt-get update -qq && apt-get install -y \
|
6
|
+
build-essential \
|
7
|
+
vim && \
|
8
|
+
rm -rf /var/lib/apt/lists/*
|
9
|
+
|
10
|
+
ENV EDITOR=vim
|
11
|
+
|
12
|
+
WORKDIR /root/app
|
13
|
+
|
14
|
+
RUN curl -fsSL -o ide.tar.gz $IDEURL && \
|
15
|
+
mkdir ide && \
|
16
|
+
tar xfz ide.tar.gz --strip-components=1 -C ide && \
|
17
|
+
rm ide.tar.gz
|
18
|
+
|
19
|
+
CMD yes '' | ide/bin/remote-dev-server.sh run $APP_ROOT --listenOn 0.0.0.0 --port 5995
|
20
|
+
|
21
|
+
EXPOSE 5995
|
data/Gemfile
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in rails-crud-tools.gemspec
|
6
|
+
gemspec
|
7
|
+
|
8
|
+
gem "rake", "~> 13.0"
|
9
|
+
|
10
|
+
gem "rspec", "~> 3.0"
|
11
|
+
|
12
|
+
gem "rubocop", "~> 1.21"
|
13
|
+
|
14
|
+
gem "rubyzip", "~> 2.4"
|
15
|
+
|
16
|
+
gem "rails"
|
17
|
+
|
18
|
+
gem "simplecov"
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2024 yamabiko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 yhijikata
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# Rails::Crud::Tools
|
2
|
+
|
3
|
+
Welcome to Rails::Crud::Tools!
|
4
|
+
This gem provides a tool to automatically update CRUD diagrams as you interact with your application.
|
5
|
+
It simplifies logging and managing CRUD operations seamlessly within a Rails application.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add the gem to the `development` group in your application's Gemfile by including the following lines:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'rails-crud-tools'
|
13
|
+
```
|
14
|
+
|
15
|
+
Then execute:
|
16
|
+
|
17
|
+
```sh
|
18
|
+
$ bundle install
|
19
|
+
```
|
20
|
+
|
21
|
+
If you are not using Bundler, you can install the gem manually:
|
22
|
+
|
23
|
+
```sh
|
24
|
+
$ gem install rails-crud-tools
|
25
|
+
```
|
26
|
+
|
27
|
+
## Usage
|
28
|
+
|
29
|
+
### Setup
|
30
|
+
This command will generate the **doc/crud.xlsx** file and the **.crudconfig.yml** file.
|
31
|
+
|
32
|
+
```sh
|
33
|
+
$ bundle exec crud init
|
34
|
+
```
|
35
|
+
|
36
|
+
.crudconfig.yml
|
37
|
+
```yaml
|
38
|
+
enabled: true # Enables or disables the CRUD tools functionality
|
39
|
+
base_dir: doc # The base directory where the CRUD files will be stored
|
40
|
+
crud_file: crud.xlsx # The name of the CRUD Excel file
|
41
|
+
sheet_name: CRUD # The name of the sheet in the CRUD Excel file
|
42
|
+
method_col: Verb # Column indicating the HTTP method
|
43
|
+
action_col: Controller#Action # Column indicating the controller and action
|
44
|
+
table_start_col: your_first_table # Column where the table starts
|
45
|
+
header_bg_color: 00FFCC # The background color for the header in the CRUD Excel file
|
46
|
+
sql_logging_enabled: true # Enables or disables SQL logging for CRUD operations
|
47
|
+
font_name: Arial # The font name used in the CRUD Excel file
|
48
|
+
```
|
49
|
+
|
50
|
+
### How It Works
|
51
|
+
|
52
|
+
Once integrated, the gem automatically tracks CRUD operations (Create, Read, Update, Delete) performed in your application.
|
53
|
+
The diagrams will update dynamically based on these operations, providing you with real-time insights into your application's data flow.
|
54
|
+
|
55
|
+
## Logs
|
56
|
+
|
57
|
+
Please refer to the log file at `log/crud.log`.
|
58
|
+
|
59
|
+
## CRUD Macro Workbook
|
60
|
+
|
61
|
+
The `tools/crud_macro.xlsm` file is a macro-enabled workbook used for manipulating CRUD diagrams.
|
62
|
+
This workbook contains macros that help in managing and visualizing CRUD operations within your application.
|
63
|
+
|
64
|
+
### Excel Macro Download
|
65
|
+
|
66
|
+
You can download the `crud_macro.xlsm` file from the following link:
|
67
|
+
|
68
|
+
[Download crud_macro.xlsm](https://github.com/YamabikoLab/rails-crud-tools/raw/main/tools/crud_macro.xlsm)
|
69
|
+
|
70
|
+
## License
|
71
|
+
|
72
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
73
|
+
|
data/Rakefile
ADDED
data/docker-compose.yml
ADDED
data/exe/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "rails/crud/tools"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
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__)
|
data/exe/crud
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
ENV["SKIP_CRUD_SETUP"] = "true"
|
5
|
+
require "rails/crud/tools/cli"
|
6
|
+
|
7
|
+
def display_help
|
8
|
+
puts <<~HELP
|
9
|
+
Usage: crud [command]
|
10
|
+
|
11
|
+
Commands:
|
12
|
+
init Initialize by generating CRUD and config files
|
13
|
+
gen crud Generate CRUD file
|
14
|
+
gen config Generate config file
|
15
|
+
help Display this help message
|
16
|
+
HELP
|
17
|
+
end
|
18
|
+
|
19
|
+
if ARGV.empty? || ARGV.include?("help")
|
20
|
+
display_help
|
21
|
+
elsif ARGV.include?("init")
|
22
|
+
RailsCrudTools::CLI.init
|
23
|
+
elsif ARGV == %w[gen crud]
|
24
|
+
RailsCrudTools::CLI.generate_crud_file
|
25
|
+
elsif ARGV == %w[gen config]
|
26
|
+
RailsCrudTools::CLI.generate_crud_config
|
27
|
+
else
|
28
|
+
puts "Unknown command: #{ARGV.join(" ")}"
|
29
|
+
display_help
|
30
|
+
end
|