blue-eyes 1.3.3 → 1.3.4
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/.ruby-version +1 -0
- data/.simplecov +8 -0
- data/Gemfile +24 -0
- data/Gemfile.lock +257 -0
- data/Guardfile +25 -0
- data/LICENSE +24 -0
- data/README.md +188 -0
- data/Rakefile +17 -0
- data/lib/.DS_Store +0 -0
- data/lib/blue_eyes/.DS_Store +0 -0
- data/lib/blue_eyes/cli.rb +26 -0
- data/lib/blue_eyes/extensions/string.rb +42 -0
- data/lib/blue_eyes/generators/.DS_Store +0 -0
- data/lib/blue_eyes/generators/app/.DS_Store +0 -0
- data/lib/blue_eyes/generators/app/app_generator.rb +163 -0
- data/lib/blue_eyes/generators/app/templates/.DS_Store +0 -0
- data/lib/blue_eyes/generators/app/templates/.rubocop.yml.erb +19 -0
- data/lib/blue_eyes/generators/app/templates/.rubocop_todo.yml.erb +1 -0
- data/lib/blue_eyes/generators/app/templates/.ruby-version.erb +1 -0
- data/lib/blue_eyes/generators/app/templates/.simplecov.erb +9 -0
- data/lib/blue_eyes/generators/app/templates/Gemfile.erb +39 -0
- data/lib/blue_eyes/generators/app/templates/Guardfile.erb +25 -0
- data/lib/blue_eyes/generators/app/templates/Procfile.dev.erb +6 -0
- data/lib/blue_eyes/generators/app/templates/Procfile.erb +1 -0
- data/lib/blue_eyes/generators/app/templates/README.md +1 -0
- data/lib/blue_eyes/generators/app/templates/Rakefile.erb +4 -0
- data/lib/blue_eyes/generators/app/templates/app/controllers/application_controller.rb +15 -0
- data/lib/blue_eyes/generators/app/templates/app/models/.gitkeep +0 -0
- data/lib/blue_eyes/generators/app/templates/app/views/layout.erb.tt +32 -0
- data/lib/blue_eyes/generators/app/templates/app/views/welcome.erb +23 -0
- data/lib/blue_eyes/generators/app/templates/bin/dev +11 -0
- data/lib/blue_eyes/generators/app/templates/config/db.yml +35 -0
- data/lib/blue_eyes/generators/app/templates/config/environment.rb +18 -0
- data/lib/blue_eyes/generators/app/templates/config/initializers/database.rb.erb +16 -0
- data/lib/blue_eyes/generators/app/templates/config/initializers/redis.rb +9 -0
- data/lib/blue_eyes/generators/app/templates/config/redis.yml +14 -0
- data/lib/blue_eyes/generators/app/templates/config.ru.erb +7 -0
- data/lib/blue_eyes/generators/app/templates/public/.DS_Store +0 -0
- data/lib/blue_eyes/generators/app/templates/public/favicon.ico +0 -0
- data/lib/blue_eyes/generators/app/templates/public/images/.gitkeep +0 -0
- data/lib/blue_eyes/generators/app/templates/public/images/blue-eyes-small.png +0 -0
- data/lib/blue_eyes/generators/app/templates/public/images/blue-eyes.svg +24 -0
- data/lib/blue_eyes/generators/app/templates/public/javascripts/.gitkeep +0 -0
- data/lib/blue_eyes/generators/app/templates/public/stylesheets/main.css +115 -0
- data/lib/blue_eyes/generators/app/templates/spec/application_controller_spec.rb +17 -0
- data/lib/blue_eyes/generators/app/templates/spec/factories/.gitkeep +0 -0
- data/lib/blue_eyes/generators/app/templates/spec/spec_helper.rb +45 -0
- data/lib/blue_eyes/generators/controller/controller_generator.rb +42 -0
- data/lib/blue_eyes/generators/controller/templates/controller.rb.erb +39 -0
- data/lib/blue_eyes/generators/controller/templates/views/edit.html.erb +1 -0
- data/lib/blue_eyes/generators/controller/templates/views/index.html.erb +1 -0
- data/lib/blue_eyes/generators/controller/templates/views/new.html.erb +1 -0
- data/lib/blue_eyes/generators/controller/templates/views/show.html.erb +1 -0
- data/lib/blue_eyes/generators/model/migration.rb.erb +13 -0
- data/lib/blue_eyes/generators/model/model.rb.erb +5 -0
- data/lib/blue_eyes/generators/model/model_factory.rb.erb +8 -0
- data/lib/blue_eyes/generators/model/model_generator.rb +68 -0
- data/lib/blue_eyes/generators/model/model_spec.rb.erb +48 -0
- data/lib/blue_eyes/generators/scaffold/scaffold_generator.rb +25 -0
- data/lib/blue_eyes/version.rb +11 -0
- data/lib/blue_eyes.rb +13 -0
- data/test/blue_eyes/cli_test.rb +20 -0
- data/test/blue_eyes/extensions/string_test.rb +71 -0
- data/test/blue_eyes/generators/app_generator_test.rb +142 -0
- data/test/blue_eyes/generators/controller/controller_generator_test.rb +57 -0
- data/test/blue_eyes/generators/model/model_generator_test.rb +40 -0
- data/test/blue_eyes/generators/scaffold/scaffold_generator_test.rb +21 -0
- data/test/blue_eyes/version_test.rb +24 -0
- data/test/blue_eyes_test.rb +1 -0
- data/test/test_helper.rb +6 -0
- metadata +71 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eaecee473a7830ce36e1024a828640fc22aa22df2b122df9b401d296bd66894b
|
|
4
|
+
data.tar.gz: 371b13342ab1618cefb523b092d25ee05cc8a4fa158b211d419bd2288dc8fc99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f4f6240e30514f9c5d94007a48ff80938369bba2b77deb47eb93fc78d9d60c5f2070a87121f264ab26c42be55b17ddbd6439edafcf9400b5e4b32103950e097
|
|
7
|
+
data.tar.gz: 9a4615bd2dcdeb6d2bfa6ca1a80dea24c9f53471da86565c2468f273f99ab2a2557f93eb8ae01df170ba744b856a5064d62121de9d3f0a26d910f5968b9dabd2
|
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.4.6
|
data/.simplecov
ADDED
data/Gemfile
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org/'
|
|
4
|
+
|
|
5
|
+
ruby File.read('.ruby-version').strip
|
|
6
|
+
|
|
7
|
+
gemspec
|
|
8
|
+
|
|
9
|
+
group :development, :test do
|
|
10
|
+
gem 'fakefs', '~> 3.0'
|
|
11
|
+
gem 'guard', '~> 2.16'
|
|
12
|
+
gem 'guard-bundler', '~> 3.0'
|
|
13
|
+
gem 'guard-minitest', '~> 2.4'
|
|
14
|
+
gem 'guard-rubocop', '~> 1.5'
|
|
15
|
+
gem 'irb', '~> 1.14'
|
|
16
|
+
gem 'minitest', '~> 5.25'
|
|
17
|
+
gem 'pry', '~> 0.15'
|
|
18
|
+
gem 'rake', '~> 13.0'
|
|
19
|
+
gem 'rubocop', '~> 1.81'
|
|
20
|
+
gem 'rubocop-minitest', '~> 0.38'
|
|
21
|
+
gem 'rubocop-performance', '~> 1.26'
|
|
22
|
+
gem 'rubocop-rake', '~> 0.6'
|
|
23
|
+
gem 'simplecov', '~> 0.22'
|
|
24
|
+
end
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
blue-eyes (1.3.3)
|
|
5
|
+
active_model_serializers (~> 0.10.15)
|
|
6
|
+
activesupport (~> 7.0)
|
|
7
|
+
thor (~> 1.4)
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
actionpack (7.2.3)
|
|
13
|
+
actionview (= 7.2.3)
|
|
14
|
+
activesupport (= 7.2.3)
|
|
15
|
+
cgi
|
|
16
|
+
nokogiri (>= 1.8.5)
|
|
17
|
+
racc
|
|
18
|
+
rack (>= 2.2.4, < 3.3)
|
|
19
|
+
rack-session (>= 1.0.1)
|
|
20
|
+
rack-test (>= 0.6.3)
|
|
21
|
+
rails-dom-testing (~> 2.2)
|
|
22
|
+
rails-html-sanitizer (~> 1.6)
|
|
23
|
+
useragent (~> 0.16)
|
|
24
|
+
actionview (7.2.3)
|
|
25
|
+
activesupport (= 7.2.3)
|
|
26
|
+
builder (~> 3.1)
|
|
27
|
+
cgi
|
|
28
|
+
erubi (~> 1.11)
|
|
29
|
+
rails-dom-testing (~> 2.2)
|
|
30
|
+
rails-html-sanitizer (~> 1.6)
|
|
31
|
+
active_model_serializers (0.10.15)
|
|
32
|
+
actionpack (>= 4.1)
|
|
33
|
+
activemodel (>= 4.1)
|
|
34
|
+
case_transform (>= 0.2)
|
|
35
|
+
jsonapi-renderer (>= 0.1.1.beta1, < 0.3)
|
|
36
|
+
activemodel (7.2.3)
|
|
37
|
+
activesupport (= 7.2.3)
|
|
38
|
+
activesupport (7.2.3)
|
|
39
|
+
base64
|
|
40
|
+
benchmark (>= 0.3)
|
|
41
|
+
bigdecimal
|
|
42
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
43
|
+
connection_pool (>= 2.2.5)
|
|
44
|
+
drb
|
|
45
|
+
i18n (>= 1.6, < 2)
|
|
46
|
+
logger (>= 1.4.2)
|
|
47
|
+
minitest (>= 5.1)
|
|
48
|
+
securerandom (>= 0.3)
|
|
49
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
50
|
+
ast (2.4.3)
|
|
51
|
+
base64 (0.3.0)
|
|
52
|
+
benchmark (0.5.0)
|
|
53
|
+
bigdecimal (3.3.1)
|
|
54
|
+
builder (3.3.0)
|
|
55
|
+
case_transform (0.2)
|
|
56
|
+
activesupport
|
|
57
|
+
cgi (0.5.0)
|
|
58
|
+
coderay (1.1.3)
|
|
59
|
+
concurrent-ruby (1.3.5)
|
|
60
|
+
connection_pool (3.0.2)
|
|
61
|
+
crass (1.0.6)
|
|
62
|
+
date (3.5.0)
|
|
63
|
+
docile (1.4.1)
|
|
64
|
+
drb (2.2.3)
|
|
65
|
+
erb (6.0.0)
|
|
66
|
+
erubi (1.13.1)
|
|
67
|
+
fakefs (3.0.4)
|
|
68
|
+
ffi (1.17.2-aarch64-linux-gnu)
|
|
69
|
+
ffi (1.17.2-aarch64-linux-musl)
|
|
70
|
+
ffi (1.17.2-arm-linux-gnu)
|
|
71
|
+
ffi (1.17.2-arm-linux-musl)
|
|
72
|
+
ffi (1.17.2-arm64-darwin)
|
|
73
|
+
ffi (1.17.2-x86_64-darwin)
|
|
74
|
+
ffi (1.17.2-x86_64-linux-gnu)
|
|
75
|
+
ffi (1.17.2-x86_64-linux-musl)
|
|
76
|
+
formatador (1.2.3)
|
|
77
|
+
reline
|
|
78
|
+
guard (2.19.1)
|
|
79
|
+
formatador (>= 0.2.4)
|
|
80
|
+
listen (>= 2.7, < 4.0)
|
|
81
|
+
logger (~> 1.6)
|
|
82
|
+
lumberjack (>= 1.0.12, < 2.0)
|
|
83
|
+
nenv (~> 0.1)
|
|
84
|
+
notiffany (~> 0.0)
|
|
85
|
+
ostruct (~> 0.6)
|
|
86
|
+
pry (>= 0.13.0)
|
|
87
|
+
shellany (~> 0.0)
|
|
88
|
+
thor (>= 0.18.1)
|
|
89
|
+
guard-bundler (3.0.1)
|
|
90
|
+
bundler (>= 2.1, < 3)
|
|
91
|
+
guard (~> 2.2)
|
|
92
|
+
guard-compat (~> 1.1)
|
|
93
|
+
guard-compat (1.2.1)
|
|
94
|
+
guard-minitest (2.4.6)
|
|
95
|
+
guard-compat (~> 1.2)
|
|
96
|
+
minitest (>= 3.0)
|
|
97
|
+
guard-rubocop (1.5.0)
|
|
98
|
+
guard (~> 2.0)
|
|
99
|
+
rubocop (< 2.0)
|
|
100
|
+
i18n (1.14.7)
|
|
101
|
+
concurrent-ruby (~> 1.0)
|
|
102
|
+
io-console (0.8.1)
|
|
103
|
+
irb (1.15.3)
|
|
104
|
+
pp (>= 0.6.0)
|
|
105
|
+
rdoc (>= 4.0.0)
|
|
106
|
+
reline (>= 0.4.2)
|
|
107
|
+
json (2.17.1)
|
|
108
|
+
jsonapi-renderer (0.2.2)
|
|
109
|
+
language_server-protocol (3.17.0.5)
|
|
110
|
+
lint_roller (1.1.0)
|
|
111
|
+
listen (3.9.0)
|
|
112
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
113
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
|
114
|
+
logger (1.7.0)
|
|
115
|
+
loofah (2.24.1)
|
|
116
|
+
crass (~> 1.0.2)
|
|
117
|
+
nokogiri (>= 1.12.0)
|
|
118
|
+
lumberjack (1.4.2)
|
|
119
|
+
method_source (1.1.0)
|
|
120
|
+
minitest (5.26.2)
|
|
121
|
+
nenv (0.3.0)
|
|
122
|
+
nokogiri (1.18.10-aarch64-linux-gnu)
|
|
123
|
+
racc (~> 1.4)
|
|
124
|
+
nokogiri (1.18.10-aarch64-linux-musl)
|
|
125
|
+
racc (~> 1.4)
|
|
126
|
+
nokogiri (1.18.10-arm-linux-gnu)
|
|
127
|
+
racc (~> 1.4)
|
|
128
|
+
nokogiri (1.18.10-arm-linux-musl)
|
|
129
|
+
racc (~> 1.4)
|
|
130
|
+
nokogiri (1.18.10-arm64-darwin)
|
|
131
|
+
racc (~> 1.4)
|
|
132
|
+
nokogiri (1.18.10-x86_64-darwin)
|
|
133
|
+
racc (~> 1.4)
|
|
134
|
+
nokogiri (1.18.10-x86_64-linux-gnu)
|
|
135
|
+
racc (~> 1.4)
|
|
136
|
+
nokogiri (1.18.10-x86_64-linux-musl)
|
|
137
|
+
racc (~> 1.4)
|
|
138
|
+
notiffany (0.1.3)
|
|
139
|
+
nenv (~> 0.1)
|
|
140
|
+
shellany (~> 0.0)
|
|
141
|
+
ostruct (0.6.3)
|
|
142
|
+
parallel (1.27.0)
|
|
143
|
+
parser (3.3.10.0)
|
|
144
|
+
ast (~> 2.4.1)
|
|
145
|
+
racc
|
|
146
|
+
pp (0.6.3)
|
|
147
|
+
prettyprint
|
|
148
|
+
prettyprint (0.2.0)
|
|
149
|
+
prism (1.6.0)
|
|
150
|
+
pry (0.15.2)
|
|
151
|
+
coderay (~> 1.1)
|
|
152
|
+
method_source (~> 1.0)
|
|
153
|
+
psych (5.2.6)
|
|
154
|
+
date
|
|
155
|
+
stringio
|
|
156
|
+
racc (1.8.1)
|
|
157
|
+
rack (3.2.4)
|
|
158
|
+
rack-session (2.1.1)
|
|
159
|
+
base64 (>= 0.1.0)
|
|
160
|
+
rack (>= 3.0.0)
|
|
161
|
+
rack-test (2.2.0)
|
|
162
|
+
rack (>= 1.3)
|
|
163
|
+
rails-dom-testing (2.3.0)
|
|
164
|
+
activesupport (>= 5.0.0)
|
|
165
|
+
minitest
|
|
166
|
+
nokogiri (>= 1.6)
|
|
167
|
+
rails-html-sanitizer (1.6.2)
|
|
168
|
+
loofah (~> 2.21)
|
|
169
|
+
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
|
170
|
+
rainbow (3.1.1)
|
|
171
|
+
rake (13.3.1)
|
|
172
|
+
rb-fsevent (0.11.2)
|
|
173
|
+
rb-inotify (0.11.1)
|
|
174
|
+
ffi (~> 1.0)
|
|
175
|
+
rdoc (6.17.0)
|
|
176
|
+
erb
|
|
177
|
+
psych (>= 4.0.0)
|
|
178
|
+
tsort
|
|
179
|
+
regexp_parser (2.11.3)
|
|
180
|
+
reline (0.6.3)
|
|
181
|
+
io-console (~> 0.5)
|
|
182
|
+
rubocop (1.81.7)
|
|
183
|
+
json (~> 2.3)
|
|
184
|
+
language_server-protocol (~> 3.17.0.2)
|
|
185
|
+
lint_roller (~> 1.1.0)
|
|
186
|
+
parallel (~> 1.10)
|
|
187
|
+
parser (>= 3.3.0.2)
|
|
188
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
189
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
190
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
191
|
+
ruby-progressbar (~> 1.7)
|
|
192
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
193
|
+
rubocop-ast (1.48.0)
|
|
194
|
+
parser (>= 3.3.7.2)
|
|
195
|
+
prism (~> 1.4)
|
|
196
|
+
rubocop-minitest (0.38.2)
|
|
197
|
+
lint_roller (~> 1.1)
|
|
198
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
199
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
|
200
|
+
rubocop-performance (1.26.1)
|
|
201
|
+
lint_roller (~> 1.1)
|
|
202
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
203
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
204
|
+
rubocop-rake (0.7.1)
|
|
205
|
+
lint_roller (~> 1.1)
|
|
206
|
+
rubocop (>= 1.72.1)
|
|
207
|
+
ruby-progressbar (1.13.0)
|
|
208
|
+
securerandom (0.4.1)
|
|
209
|
+
shellany (0.0.1)
|
|
210
|
+
simplecov (0.22.0)
|
|
211
|
+
docile (~> 1.1)
|
|
212
|
+
simplecov-html (~> 0.11)
|
|
213
|
+
simplecov_json_formatter (~> 0.1)
|
|
214
|
+
simplecov-html (0.13.2)
|
|
215
|
+
simplecov_json_formatter (0.1.4)
|
|
216
|
+
stringio (3.1.9)
|
|
217
|
+
thor (1.4.0)
|
|
218
|
+
tsort (0.2.0)
|
|
219
|
+
tzinfo (2.0.6)
|
|
220
|
+
concurrent-ruby (~> 1.0)
|
|
221
|
+
unicode-display_width (3.2.0)
|
|
222
|
+
unicode-emoji (~> 4.1)
|
|
223
|
+
unicode-emoji (4.1.0)
|
|
224
|
+
useragent (0.16.11)
|
|
225
|
+
|
|
226
|
+
PLATFORMS
|
|
227
|
+
aarch64-linux-gnu
|
|
228
|
+
aarch64-linux-musl
|
|
229
|
+
arm-linux-gnu
|
|
230
|
+
arm-linux-musl
|
|
231
|
+
arm64-darwin
|
|
232
|
+
x86_64-darwin
|
|
233
|
+
x86_64-linux-gnu
|
|
234
|
+
x86_64-linux-musl
|
|
235
|
+
|
|
236
|
+
DEPENDENCIES
|
|
237
|
+
blue-eyes!
|
|
238
|
+
fakefs (~> 3.0)
|
|
239
|
+
guard (~> 2.16)
|
|
240
|
+
guard-bundler (~> 3.0)
|
|
241
|
+
guard-minitest (~> 2.4)
|
|
242
|
+
guard-rubocop (~> 1.5)
|
|
243
|
+
irb (~> 1.14)
|
|
244
|
+
minitest (~> 5.25)
|
|
245
|
+
pry (~> 0.15)
|
|
246
|
+
rake (~> 13.0)
|
|
247
|
+
rubocop (~> 1.81)
|
|
248
|
+
rubocop-minitest (~> 0.38)
|
|
249
|
+
rubocop-performance (~> 1.26)
|
|
250
|
+
rubocop-rake (~> 0.6)
|
|
251
|
+
simplecov (~> 0.22)
|
|
252
|
+
|
|
253
|
+
RUBY VERSION
|
|
254
|
+
ruby 3.4.6p54
|
|
255
|
+
|
|
256
|
+
BUNDLED WITH
|
|
257
|
+
2.7.2
|
data/Guardfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
guard :rubocop, cli: ['-A'] do
|
|
4
|
+
watch(/.+\.rb$/)
|
|
5
|
+
watch('Rakefile') { 'Rakefile' }
|
|
6
|
+
watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
guard :minitest do
|
|
10
|
+
watch(%r{^test/(.*)/?(.*)_test\.rb$})
|
|
11
|
+
watch(%r{^test/test_helper\.rb$}) { 'test' }
|
|
12
|
+
watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}#{m[2]}_test.rb" }
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
guard :bundler do
|
|
16
|
+
require 'guard/bundler'
|
|
17
|
+
require 'guard/bundler/verify'
|
|
18
|
+
helper = Guard::Bundler::Verify.new
|
|
19
|
+
|
|
20
|
+
files = ['Gemfile']
|
|
21
|
+
files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
|
|
22
|
+
|
|
23
|
+
# Assume files are symlinked from somewhere
|
|
24
|
+
files.each { |file| watch(helper.real_path(file)) }
|
|
25
|
+
end
|
data/LICENSE
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
License: MIT
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2016 Brian Emory (Corneal Ruby Gem)
|
|
4
|
+
Copyright (c) 2024 Ben Lamb (blue-eyes Ruby Gem)
|
|
5
|
+
Copyright (c) 2025 Stan Carver II (BlueEyes Ruby Gem)
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
8
|
+
a copy of this software and associated documentation files (the
|
|
9
|
+
"Software"), to deal in the Software without restriction, including
|
|
10
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
11
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
12
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
13
|
+
the following conditions:
|
|
14
|
+
|
|
15
|
+
The above copyright notice and this permission notice shall be
|
|
16
|
+
included in all copies or substantial portions of the Software.
|
|
17
|
+
|
|
18
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
19
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
20
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
21
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
22
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
23
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
24
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/rb/blue-eyes)
|
|
4
|
+
|
|
5
|
+
## Why BlueEyes Exists
|
|
6
|
+
|
|
7
|
+
BlueEye's original creator, Ben Lamb, was searching for a way to build a Sinatra skeleton similar to running how Rails creates applications using `rails new APP-NAME`.
|
|
8
|
+
[Corneal](http://thebrianemory.github.io/corneal) was the closest thing he could find and this gem is based largely off of it.
|
|
9
|
+
Corneal does for Sinatra what running Rails' generators would do for a Ruby on Rails application.
|
|
10
|
+
Over time, Brian's focus would shift to the Elixir language and Corneal development would languish.
|
|
11
|
+
Ben Lamb got the inspiration to continue development and forked Corneal with a new name *blue-eyes* as a shout-out to Sinatra.
|
|
12
|
+
Ben's contributions kept the gem operational with Ruby 2.
|
|
13
|
+
|
|
14
|
+
Fast-forward to 2025, [Stan Carver II](https://scarver2.github.io) maintains the *BlueEyes* gem to compliment to his ongoing work on [Frankie](https://github.com/scarver2/frankie), the essential Sinatra boilerplate repository.
|
|
15
|
+
His open-source contributions allows BlueEyes to fully support Ruby 3 and newer versions of Sinatra, Rails, and other gems.
|
|
16
|
+
BlueEyes now generates full test suites tools to aid with rapid development of microsites and APIs.
|
|
17
|
+
|
|
18
|
+
## How to Begin
|
|
19
|
+
|
|
20
|
+
`gem install blue-eyes` gem, run `blue-eyes new APP-NAME`, `cd` into your app's folder, then run `bundle install`.
|
|
21
|
+
You're all set to start developing your Sinatra application.
|
|
22
|
+
You can start up your server with `rackup` and verify everything is working. It is as simple as that!
|
|
23
|
+
|
|
24
|
+
### App Directory Structure
|
|
25
|
+
|
|
26
|
+
BlueEyes creates a file structure similar to Ruby on Rails.
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
├── app
|
|
30
|
+
│ ├── controllers
|
|
31
|
+
│ │ └── application_controller.rb
|
|
32
|
+
│ ├── models
|
|
33
|
+
│ └── views
|
|
34
|
+
│ ├── layout.erb
|
|
35
|
+
│ └── welcome.erb
|
|
36
|
+
├── bin
|
|
37
|
+
│ └── dev
|
|
38
|
+
├── config
|
|
39
|
+
│ ├── initializers
|
|
40
|
+
│ │ ├── database.rb
|
|
41
|
+
│ │ └── redis.rb
|
|
42
|
+
│ └── environment.rb
|
|
43
|
+
├── db
|
|
44
|
+
│ └── migrate
|
|
45
|
+
├── lib
|
|
46
|
+
├── public
|
|
47
|
+
│ ├── images
|
|
48
|
+
│ ├── javascripts
|
|
49
|
+
│ └── stylesheets
|
|
50
|
+
│ └── main.css
|
|
51
|
+
├─── spec
|
|
52
|
+
│ ├── application_controller_spec.rb
|
|
53
|
+
│ └── spec_helper.rb
|
|
54
|
+
├── .rubocop_todo.yml
|
|
55
|
+
├── .rubocop.yml
|
|
56
|
+
├── .simplecov
|
|
57
|
+
├── config.ru
|
|
58
|
+
├── Gemfile
|
|
59
|
+
├── Gemfile.lock
|
|
60
|
+
├── Guardfile
|
|
61
|
+
├── Procfile
|
|
62
|
+
├── Procfile.dev
|
|
63
|
+
├── Rakefile
|
|
64
|
+
└── README
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Installation
|
|
68
|
+
|
|
69
|
+
BlueEyes should be installed in the global gem space rather than in a Gemfile.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
gem install blue-eyes
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Commands
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
blue-eyes -v # Show BlueEyes version number
|
|
79
|
+
blue-eyes help [COMMAND] # Describe available commands or one specific command
|
|
80
|
+
blue-eyes new APP-NAME # Creates a new Sinatra application
|
|
81
|
+
blue-eyes model NAME # Generate a model
|
|
82
|
+
blue-eyes controller NAME # Generate a controller
|
|
83
|
+
blue-eyes scaffold NAME # Generate a model with its associated views and controllers
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Flags
|
|
87
|
+
|
|
88
|
+
The controller generator also have an optional views flag `--no-views` to create controllers without views.
|
|
89
|
+
|
|
90
|
+
## Using BlueEyes
|
|
91
|
+
|
|
92
|
+
To generate your app:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
blue-eyes new APP-NAME
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Once BlueEyes has generated your app, run `bundle install` from your app's directory:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
cd APP-NAME
|
|
102
|
+
bundle install
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
You can then start your server with the bundled `rackup` gem and visit http://localhost:9292 to verify your running web application.
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
bundle exec rackup
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
In similar Rails' fashion, you can generate a model and migration file:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
blue-eyes model NAME
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
You can also generate an entire Rails-style MVC structure complete with a migration file:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
blue-eyes scaffold NAME
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
The resulting structure will look like this:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
└─ app
|
|
127
|
+
│ ├── controllers
|
|
128
|
+
│ │ ├── application_controller.rb
|
|
129
|
+
│ ├── models
|
|
130
|
+
│ │ └── model_name.rb
|
|
131
|
+
│ └── views
|
|
132
|
+
│ └── model_names
|
|
133
|
+
│ ├──index.html.erb
|
|
134
|
+
│ ├──show.html.erb
|
|
135
|
+
│ ├──new.html.erb
|
|
136
|
+
│ └──edit.html.erb
|
|
137
|
+
└── db/migrate
|
|
138
|
+
└── timestamp_create_models.rb
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You can also add your model attributes when you generate the scaffold structure and have them added to your migration file:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
blue-eyes [model/scaffold] NAME name:string age:integer
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
```ruby
|
|
148
|
+
class CreateUsers < ActiveRecord::Migration
|
|
149
|
+
def change
|
|
150
|
+
create_table :users do |t|
|
|
151
|
+
t.string :name
|
|
152
|
+
t.age :integer
|
|
153
|
+
|
|
154
|
+
t.timestamps null: false
|
|
155
|
+
end
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
After creating a model or scaffold, you will need to run `bundle exec rake db:migrate` to update the database table.
|
|
161
|
+
|
|
162
|
+
You can run the test suite with `bundle exec rspec` to ensure your app is still operational:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
Run options: include {focus: true}
|
|
166
|
+
|
|
167
|
+
All examples were filtered out; ignoring {focus: true}
|
|
168
|
+
....
|
|
169
|
+
|
|
170
|
+
Finished in 0.04369 seconds (files took 2.31 seconds to load)
|
|
171
|
+
4 examples, 0 failures, 0 pending
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
You can run `bundle exec rubocop -A` to automatically fix any linting issues. It can uncover bugs too!
|
|
175
|
+
|
|
176
|
+
You can run `bundle exec guard` for continuous testing and linting while developing your application.
|
|
177
|
+
|
|
178
|
+
**Better yet**, you can execute `bin/dev` to start your server, run your tests, and lint your code all at once.
|
|
179
|
+
Any changes to your application will automatically reload your application, run your tests, and/or lint your code.
|
|
180
|
+
💙 Developer happiness acheived. 💙
|
|
181
|
+
|
|
182
|
+
# Important Files
|
|
183
|
+
|
|
184
|
+
[CONTRIBUTING](https://github.com/scarver2/blue-eyes/blob/main/CONTRIBUTING.md)
|
|
185
|
+
[LICENSE](https://github.com/scarver2/blue-eyes/blob/main/LICENSE)
|
|
186
|
+
[TODO](https://github.com/scarver2/blue-eyes/blob/main/TODO.md)
|
|
187
|
+
|
|
188
|
+
©2025 Stan Carver II
|
data/Rakefile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'rake/testtask'
|
|
4
|
+
require 'bundler/gem_tasks'
|
|
5
|
+
|
|
6
|
+
desc 'Open a Pry console'
|
|
7
|
+
task :console do
|
|
8
|
+
require 'blue-eyes'
|
|
9
|
+
require 'pry'
|
|
10
|
+
Pry.start
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
Rake::TestTask.new do |t|
|
|
14
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
task default: :test
|
data/lib/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'thor'
|
|
4
|
+
|
|
5
|
+
module BlueEyes
|
|
6
|
+
# BlueEyes CLI
|
|
7
|
+
class CLI < Thor
|
|
8
|
+
desc '-v', 'Show BlueEyes version number'
|
|
9
|
+
map %w[-v --version] => :version
|
|
10
|
+
# USAGE: blue-eyes -v
|
|
11
|
+
def version
|
|
12
|
+
say "BlueEyes #{BlueEyes::VERSION::STRING}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# register(class_name, subcommand_alias, usage_list_string, description_string)
|
|
16
|
+
register BlueEyes::Generators::AppGenerator, 'new', 'new APP_PATH', 'Creates a new Sinatra application'
|
|
17
|
+
register BlueEyes::Generators::ModelGenerator, 'model', 'model NAME', 'Generate a model'
|
|
18
|
+
register BlueEyes::Generators::ControllerGenerator, 'controller', 'controller NAME', 'Generate a controller'
|
|
19
|
+
register BlueEyes::Generators::ScaffoldGenerator, 'scaffold', 'scaffold NAME',
|
|
20
|
+
'Generate a model with its associated views and controllers'
|
|
21
|
+
|
|
22
|
+
def self.exit_on_failure
|
|
23
|
+
true
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module BlueEyes
|
|
4
|
+
module Extensions
|
|
5
|
+
# BlueEyes String Extensions
|
|
6
|
+
module String
|
|
7
|
+
def camel_case
|
|
8
|
+
return gsub(/^./, &:capitalize) unless match?(/[_-]/)
|
|
9
|
+
|
|
10
|
+
altered_self = downcase.capitalize
|
|
11
|
+
|
|
12
|
+
altered_self.scan(/[_-][a-zA-Z]/).each do |match|
|
|
13
|
+
altered_self.gsub!(match, match[1].upcase)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
altered_self
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def camel_case!
|
|
20
|
+
replace camel_case
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def directory_name
|
|
24
|
+
downcase.gsub(/[^a-z|\-_]/, '')
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def file_name
|
|
28
|
+
gsub(/[-| ]/, '_')
|
|
29
|
+
.gsub(/([A-Z]+|[A-Z][a-z])/) { |x| "_#{x}" }
|
|
30
|
+
.sub(/^_/, '')
|
|
31
|
+
.gsub(/_{2,}+/, '_')
|
|
32
|
+
.downcase
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def file_name!
|
|
36
|
+
replace file_name
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
String.include BlueEyes::Extensions::String
|
|
Binary file
|
|
Binary file
|