roda-project 0.1.1 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08210d041ee17e0cbb350d2a60269bd66231d0829a29d3789bc0f4391dcb1a92'
4
- data.tar.gz: 6393f6c0f3b56e4d54127e99748a68b8131cdccee2f09c09b366bcaaa5f3db35
3
+ metadata.gz: 25bc9c837d828281d16cc27a589316eeebcb26389a14a3bcb512d83072e532c2
4
+ data.tar.gz: 8aa90aeb23cae8f188bfc8355a46b8b7fc89bf697ba3a0f1a39b3199f3d7c038
5
5
  SHA512:
6
- metadata.gz: 3ff655e7a93c8a67c9eeb9bb4b9e621527a0e308584c929a72bad01cd3e5e88eb377a46b6e7af818649113183fdaf1b41ea3d19e91faca93e16e925b035672f4
7
- data.tar.gz: 17bd68c2ac92dd4ce1ab173e5470509851e3662e90eaea8c226c4f5462a2ef4b87fe26758d727f0e9d07f6fb859697b40c665d2423bcc01462be89747a40c554
6
+ metadata.gz: 3d146d6279989b6ee8cea4017f932931bd353623f9c0293022793a6e56c153f0e902fe05522b76696092b6e962aae44a57e34ab4835b53aa233d2e8308bb2983
7
+ data.tar.gz: 9d2e04b540e188cd4b986cc761c8e3319fa216f2dc7ef1c892e2358e771fee3f936a9189f4b998d809a63813d175a42ef6c9b31f79b250986f1a9cd1bf212950
@@ -51,19 +51,22 @@ module Roda
51
51
 
52
52
  def get_user_context
53
53
  retry_on_error { @context.project_name = read_line("Project name › ", "project") }
54
- retry_on_error { @context.base = read_line("(#{fullstack_id}) Fullstack (#{api_id}) API › ", fullstack_id).to_i }
54
+ retry_on_error { @context.base = read_line("(#{fullstack_id}) Fullstack (#{api_id}) API (#{minimal_id}) Minimal › ", fullstack_id).to_i }
55
55
  retry_on_error { @context.tests = read_line("(#{rspec_id}) RSpec (#{minitest_id}) Minitest › ", rspec_id).to_i }
56
- retry_on_error { @context.database = read_line("Database? (Y/n) › ", true) }
57
56
 
58
- if @context.database?
59
- retry_on_error {
60
- @context.database_type = read_line(
61
- "(#{sqlite_id}) SQlite (#{postgresql_id}) PostgreSQL (#{mysql_id}) MySQL › ",
62
- sqlite_id
63
- ).to_i
64
- }
65
-
66
- retry_on_error { @context.rodauth = read_line("Rodauth? (authentication) (Y/n) › ", true) }
57
+ unless @context.minimal?
58
+ retry_on_error { @context.database = read_line("Database? (Y/n) › ", true) }
59
+
60
+ if @context.database?
61
+ retry_on_error {
62
+ @context.database_type = read_line(
63
+ "(#{sqlite_id}) SQlite (#{postgresql_id}) PostgreSQL (#{mysql_id}) MySQL › ",
64
+ sqlite_id
65
+ ).to_i
66
+ }
67
+
68
+ retry_on_error { @context.rodauth = read_line("Rodauth? (authentication) (Y/n) › ", true) }
69
+ end
67
70
  end
68
71
  end
69
72
 
@@ -77,6 +80,16 @@ module Roda
77
80
 
78
81
  def create_base_project
79
82
  puts "* creating base project"
83
+ if @context.minimal?
84
+ TTY::File.copy_directory(
85
+ File.expand_path("../templates/base/minimal", __dir__),
86
+ "#{@dir}#{@context.project_name}",
87
+ context: @context
88
+ )
89
+
90
+ return
91
+ end
92
+
80
93
  TTY::File.copy_directory(
81
94
  File.expand_path("../templates/base/scaffold", __dir__),
82
95
  "#{@dir}#{@context.project_name}",
@@ -122,11 +135,12 @@ module Roda
122
135
 
123
136
  def add_test_files
124
137
  puts "* adding test files"
138
+ minimal_dir = @context.minimal? ? "minimal/" : ""
125
139
 
126
140
  if @context.rspec?
127
- tty_cp_r("tests/rspec", "spec")
141
+ tty_cp_r("tests/#{minimal_dir}rspec", "spec")
128
142
  else
129
- tty_cp_r("tests/minitest", "spec")
143
+ tty_cp_r("tests/#{minimal_dir}minitest", "spec")
130
144
  end
131
145
  end
132
146
  end
@@ -26,7 +26,7 @@ module Roda
26
26
  end
27
27
 
28
28
  def base=(val)
29
- if ![fullstack_id, api_id].include?(val)
29
+ if ![fullstack_id, api_id, minimal_id].include?(val)
30
30
  raise InvalidValue, "Invalid project option"
31
31
  end
32
32
 
@@ -102,6 +102,10 @@ module Roda
102
102
  base == api_id
103
103
  end
104
104
 
105
+ def minimal?
106
+ base == minimal_id
107
+ end
108
+
105
109
  def rodauth?
106
110
  rodauth == true
107
111
  end
@@ -3,10 +3,11 @@ module Roda
3
3
  module Helpers
4
4
  module Ids
5
5
  def fullstack_id = Roda::Project::FULLSTACK
6
+ def api_id = Roda::Project::API
7
+ def minimal_id = Roda::Project::MINIMAL
6
8
  def mysql_id = Roda::Project::MYSQL
7
9
  def sqlite_id = Roda::Project::SQLITE
8
10
  def postgresql_id = Roda::Project::POSTGRESQL
9
- def api_id = Roda::Project::API
10
11
  def rspec_id = Roda::Project::RSPEC
11
12
  def minitest_id = Roda::Project::MINITEST
12
13
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Roda
4
4
  module Project
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
data/lib/roda/project.rb CHANGED
@@ -17,9 +17,12 @@ module Roda
17
17
 
18
18
  FULLSTACK = 1
19
19
  API = 2
20
+ MINIMAL = 3
21
+
20
22
  SQLITE = 1
21
23
  POSTGRESQL = 2
22
24
  MYSQL = 3
25
+
23
26
  RSPEC = 1
24
27
  MINITEST = 2
25
28
 
@@ -0,0 +1,9 @@
1
+ Act as a Ruby specialist.
2
+
3
+ This is a web application written using the Roda web framework
4
+
5
+ ## Project guidelines
6
+
7
+ - **Never** deliver code without tests validating the code (execute with `rake test`)
8
+ - **Never** write long comments in the code
9
+ - **Always** use clean code
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Base
6
+ gem "roda"
7
+ gem "zeitwerk"
8
+
9
+ # Web Server
10
+ gem "puma"
11
+ # gem "falcon"
12
+ # gem 'iodine'
13
+ # gem 'thin'
14
+
15
+ # Performance
16
+ gem "oj"
17
+ # gem 'async'
18
+
19
+ # CLI
20
+ gem "rake"
21
+
22
+ # Security
23
+ # gem "rack-attack"
24
+
25
+ # Misc
26
+ gem "bcrypt"
27
+
28
+ group :development do
29
+ gem "guard-puma"
30
+ gem "rack-test"
31
+ gem "debug"
32
+ gem "base64"
33
+ gem "standard"<% if context.minitest? %>
34
+ gem "minitest"
35
+ gem "minitest-hooks"
36
+ <% else %>
37
+ gem "rspec"<% end %>
38
+ end
@@ -0,0 +1,325 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ ast (2.4.3)
5
+ base64 (0.3.0)
6
+ bcrypt (3.1.22)
7
+ bigdecimal (4.1.2)
8
+ coderay (1.1.3)
9
+ date (3.5.1)
10
+ debug (1.11.1)
11
+ irb (~> 1.10)
12
+ reline (>= 0.3.8)
13
+ diff-lcs (1.6.2)
14
+ em-websocket (0.5.3)
15
+ eventmachine (>= 0.12.9)
16
+ http_parser.rb (~> 0)
17
+ erb (6.0.4)
18
+ eventmachine (1.2.7)
19
+ ffi (1.17.4)
20
+ ffi (1.17.4-aarch64-linux-gnu)
21
+ ffi (1.17.4-aarch64-linux-musl)
22
+ ffi (1.17.4-arm-linux-gnu)
23
+ ffi (1.17.4-arm-linux-musl)
24
+ ffi (1.17.4-arm64-darwin)
25
+ ffi (1.17.4-x86-linux-gnu)
26
+ ffi (1.17.4-x86-linux-musl)
27
+ ffi (1.17.4-x86_64-darwin)
28
+ ffi (1.17.4-x86_64-linux-gnu)
29
+ ffi (1.17.4-x86_64-linux-musl)
30
+ formatador (1.2.3)
31
+ reline
32
+ guard (2.20.1)
33
+ formatador (>= 0.2.4)
34
+ listen (>= 2.7, < 4.0)
35
+ logger (~> 1.6)
36
+ lumberjack (>= 1.0.12, < 2.0)
37
+ nenv (~> 0.1)
38
+ notiffany (~> 0.0)
39
+ pry (>= 0.13.0)
40
+ shellany (~> 0.0)
41
+ thor (>= 0.18.1)
42
+ guard-compat (1.2.1)
43
+ guard-livereload (2.5.2)
44
+ em-websocket (~> 0.5)
45
+ guard (~> 2.8)
46
+ guard-compat (~> 1.0)
47
+ multi_json (~> 1.8)
48
+ guard-puma (0.9.2)
49
+ guard (~> 2.14)
50
+ guard-compat (~> 1.2)
51
+ puma (>= 4.0, < 8)
52
+ html_slice (0.2.6)
53
+ http_parser.rb (0.8.1)
54
+ io-console (0.8.2)
55
+ irb (1.18.0)
56
+ pp (>= 0.6.0)
57
+ prism (>= 1.3.0)
58
+ rdoc (>= 4.0.0)
59
+ reline (>= 0.4.2)
60
+ json (2.19.8)
61
+ language_server-protocol (3.17.0.5)
62
+ lint_roller (1.1.0)
63
+ listen (3.10.0)
64
+ logger
65
+ rb-fsevent (~> 0.10, >= 0.10.3)
66
+ rb-inotify (~> 0.9, >= 0.9.10)
67
+ logger (1.7.0)
68
+ lumberjack (1.4.2)
69
+ mail (2.9.0)
70
+ logger
71
+ mini_mime (>= 0.1.1)
72
+ net-imap
73
+ net-pop
74
+ net-smtp
75
+ method_source (1.1.0)
76
+ mini_mime (1.1.5)
77
+ multi_json (1.21.1)
78
+ nenv (0.3.0)
79
+ net-imap (0.6.4)
80
+ date
81
+ net-protocol
82
+ net-pop (0.1.2)
83
+ net-protocol
84
+ net-protocol (0.2.2)
85
+ timeout
86
+ net-smtp (0.5.1)
87
+ net-protocol
88
+ nio4r (2.7.5)
89
+ notiffany (0.1.3)
90
+ nenv (~> 0.1)
91
+ shellany (~> 0.0)
92
+ oj (3.17.1)
93
+ bigdecimal (>= 3.0)
94
+ ostruct (>= 0.2)
95
+ ostruct (0.6.3)
96
+ parallel (1.28.0)
97
+ parser (3.3.11.1)
98
+ ast (~> 2.4.1)
99
+ racc
100
+ pp (0.6.3)
101
+ prettyprint
102
+ prettyprint (0.2.0)
103
+ prism (1.9.0)
104
+ pry (0.16.0)
105
+ coderay (~> 1.1)
106
+ method_source (~> 1.0)
107
+ reline (>= 0.6.0)
108
+ psych (5.4.0)
109
+ date
110
+ stringio
111
+ puma (7.2.1)
112
+ nio4r (~> 2.0)
113
+ r18n-core (3.2.0)
114
+ racc (1.8.1)
115
+ rack (3.1.21)
116
+ rack-livereload (0.6.1)
117
+ rack (>= 3.0, < 3.2)
118
+ rack-test (2.2.0)
119
+ rack (>= 1.3)
120
+ rainbow (3.1.1)
121
+ rake (13.4.2)
122
+ rb-fsevent (0.11.2)
123
+ rb-inotify (0.11.1)
124
+ ffi (~> 1.0)
125
+ rdoc (7.2.0)
126
+ erb
127
+ psych (>= 4.0.0)
128
+ tsort
129
+ regexp_parser (2.12.0)
130
+ reline (0.6.3)
131
+ io-console (~> 0.5)
132
+ roda (3.104.0)
133
+ rack
134
+ roda-i18n (0.4.0)
135
+ r18n-core (~> 3.0)
136
+ roda (~> 3.7)
137
+ tilt
138
+ rspec (3.13.2)
139
+ rspec-core (~> 3.13.0)
140
+ rspec-expectations (~> 3.13.0)
141
+ rspec-mocks (~> 3.13.0)
142
+ rspec-core (3.13.6)
143
+ rspec-support (~> 3.13.0)
144
+ rspec-expectations (3.13.5)
145
+ diff-lcs (>= 1.2.0, < 2.0)
146
+ rspec-support (~> 3.13.0)
147
+ rspec-mocks (3.13.8)
148
+ diff-lcs (>= 1.2.0, < 2.0)
149
+ rspec-support (~> 3.13.0)
150
+ rspec-support (3.13.7)
151
+ rubocop (1.84.2)
152
+ json (~> 2.3)
153
+ language_server-protocol (~> 3.17.0.2)
154
+ lint_roller (~> 1.1.0)
155
+ parallel (~> 1.10)
156
+ parser (>= 3.3.0.2)
157
+ rainbow (>= 2.2.2, < 4.0)
158
+ regexp_parser (>= 2.9.3, < 3.0)
159
+ rubocop-ast (>= 1.49.0, < 2.0)
160
+ ruby-progressbar (~> 1.7)
161
+ unicode-display_width (>= 2.4.0, < 4.0)
162
+ rubocop-ast (1.49.1)
163
+ parser (>= 3.3.7.2)
164
+ prism (~> 1.7)
165
+ rubocop-performance (1.26.1)
166
+ lint_roller (~> 1.1)
167
+ rubocop (>= 1.75.0, < 2.0)
168
+ rubocop-ast (>= 1.47.1, < 2.0)
169
+ ruby-progressbar (1.13.0)
170
+ sequel (5.105.0)
171
+ bigdecimal
172
+ shellany (0.0.1)
173
+ standard (1.54.0)
174
+ language_server-protocol (~> 3.17.0.2)
175
+ lint_roller (~> 1.0)
176
+ rubocop (~> 1.84.0)
177
+ standard-custom (~> 1.0.0)
178
+ standard-performance (~> 1.8)
179
+ standard-custom (1.0.2)
180
+ lint_roller (~> 1.0)
181
+ rubocop (~> 1.50)
182
+ standard-performance (1.9.0)
183
+ lint_roller (~> 1.1)
184
+ rubocop-performance (~> 1.26.0)
185
+ stringio (3.2.0)
186
+ thor (1.5.0)
187
+ tilt (2.7.0)
188
+ timeout (0.6.1)
189
+ tsort (0.2.0)
190
+ unicode-display_width (3.2.0)
191
+ unicode-emoji (~> 4.1)
192
+ unicode-emoji (4.2.0)
193
+ zeitwerk (2.8.2)
194
+
195
+ PLATFORMS
196
+ aarch64-linux-gnu
197
+ aarch64-linux-musl
198
+ arm-linux-gnu
199
+ arm-linux-musl
200
+ arm64-darwin
201
+ ruby
202
+ x86-linux-gnu
203
+ x86-linux-musl
204
+ x86_64-darwin
205
+ x86_64-linux-gnu
206
+ x86_64-linux-musl
207
+
208
+ DEPENDENCIES
209
+ base64
210
+ bcrypt
211
+ debug
212
+ guard-livereload
213
+ guard-puma
214
+ html_slice
215
+ mail
216
+ oj
217
+ puma
218
+ rack-livereload
219
+ rack-test
220
+ rake
221
+ roda
222
+ roda-i18n
223
+ rspec
224
+ sequel
225
+ standard
226
+ zeitwerk
227
+
228
+ CHECKSUMS
229
+ ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
230
+ base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
231
+ bcrypt (3.1.22) sha256=1f0072e88c2d705d94aff7f2c5cb02eb3f1ec4b8368671e19112527489f29032
232
+ bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
233
+ coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b
234
+ date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0
235
+ debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
236
+ diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
237
+ em-websocket (0.5.3) sha256=f56a92bde4e6cb879256d58ee31f124181f68f8887bd14d53d5d9a292758c6a8
238
+ erb (6.0.4) sha256=38e3803694be357fe2bfe312487c74beaf9fb4e5beb3e22498952fe1645b95d9
239
+ eventmachine (1.2.7) sha256=994016e42aa041477ba9cff45cbe50de2047f25dd418eba003e84f0d16560972
240
+ ffi (1.17.4) sha256=bcd1642e06f0d16fc9e09ac6d49c3a7298b9789bcb58127302f934e437d60acf
241
+ ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
242
+ ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
243
+ ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
244
+ ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95
245
+ ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
246
+ ffi (1.17.4-x86-linux-gnu) sha256=38e150df5f4ca555e25beca4090823ae09657bceded154e3c52f8631c1ed72cf
247
+ ffi (1.17.4-x86-linux-musl) sha256=fbeec0fc7c795bcf86f623bb18d31ea1820f7bd580e1703a3d3740d527437809
248
+ ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
249
+ ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
250
+ ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
251
+ formatador (1.2.3) sha256=19fa898133c2c26cdbb5d09f6998c1e137ad9427a046663e55adfe18b950d894
252
+ guard (2.20.1) sha256=ab9cd7873854e6b76080c0589f781ff3e390e441bdda20165804df54f977015a
253
+ guard-compat (1.2.1) sha256=3ad21ab0070107f92edfd82610b5cdc2fb8e368851e72362ada9703443d646fe
254
+ guard-livereload (2.5.2) sha256=124dd33cb08a232e5b46971b427c69ae34c4ff56fa72ac98f85eecb5da23a779
255
+ guard-puma (0.9.2) sha256=a8a9f7938b063737c6ed68cbc029cc05d8183426d65f877266fc0c243fe690d9
256
+ html_slice (0.2.6) sha256=8c84d1887a97997cccd03e289c154432fed5bfde64e0144eebbd4d7d4baa9f3b
257
+ http_parser.rb (0.8.1) sha256=9ae8df145b39aa5398b2f90090d651c67bd8e2ebfe4507c966579f641e11097a
258
+ io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
259
+ irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
260
+ json (2.19.8) sha256=6354310fd76ef69b87d5bd1f38b40d730613baf90b6803d2d0a48f618d32dfaa
261
+ language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
262
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
263
+ listen (3.10.0) sha256=c6e182db62143aeccc2e1960033bebe7445309c7272061979bb098d03760c9d2
264
+ logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
265
+ lumberjack (1.4.2) sha256=40de5ae46321380c835031bcc1370f13bba304d29f2b5f5bb152061a5a191b95
266
+ mail (2.9.0) sha256=6fa6673ecd71c60c2d996260f9ee3dd387d4673b8169b502134659ece6d34941
267
+ method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5
268
+ mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef
269
+ multi_json (1.21.1) sha256=e6126a31808e3b4d19f483c775ceac34df190dffa62adfb63a165ee14ba68080
270
+ nenv (0.3.0) sha256=d9de6d8fb7072228463bf61843159419c969edb34b3cef51832b516ae7972765
271
+ net-imap (0.6.4) sha256=9a5598c67a3022c284d98430ef1d4948e7dbdb62596f61081ea8ca933270a02b
272
+ net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3
273
+ net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8
274
+ net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736
275
+ nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1
276
+ notiffany (0.1.3) sha256=d37669605b7f8dcb04e004e6373e2a780b98c776f8eb503ac9578557d7808738
277
+ oj (3.17.1) sha256=b00687f10bf68a32bfb633b87624174faf0989a5c96aff2f3f96f992717ce782
278
+ ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
279
+ parallel (1.28.0) sha256=33e6de1484baf2524792d178b0913fc8eb94c628d6cfe45599ad4458c638c970
280
+ parser (3.3.11.1) sha256=d17ace7aabe3e72c3cc94043714be27cc6f852f104d81aa284c2281aecc65d54
281
+ pp (0.6.3) sha256=2951d514450b93ccfeb1df7d021cae0da16e0a7f95ee1e2273719669d0ab9df6
282
+ prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193
283
+ prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
284
+ pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e
285
+ psych (5.4.0) sha256=14f72d69a611af663d7d70e4a7b67d9eb1f3ae9f8d916b478961d5a0075ba5b7
286
+ puma (7.2.1) sha256=d7bf0e9cabd532e0d401e142cd94e3ac531e993610e2d80e6fbf9c26961414b0
287
+ r18n-core (3.2.0) sha256=00c257d4b39253b79762c882159d526eb13745824bd1547a0e3d24e0535ac420
288
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
289
+ rack (3.1.21) sha256=285c5f228eef30dbd1dc147859a880b71bc44412fea575cc58c28797f2db9777
290
+ rack-livereload (0.6.1) sha256=34337d2bdbea44327b9f7bd99f2595b04f90d8b2cf5305648c0e4860f3a30539
291
+ rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463
292
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
293
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
294
+ rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
295
+ rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
296
+ rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192
297
+ regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb
298
+ reline (0.6.3) sha256=1198b04973565b36ec0f11542ab3f5cfeeec34823f4e54cebde90968092b1835
299
+ roda (3.104.0) sha256=1b1e64a4634a99c737b251b6f94cba7625c01755b0db4cb62280bebe49c898f7
300
+ roda-i18n (0.4.0) sha256=ddc0950067f7c6667c7bfcec660ea8371639ff6ff352af44f34b86e83decd011
301
+ rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
302
+ rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
303
+ rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
304
+ rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
305
+ rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
306
+ rubocop (1.84.2) sha256=5692cea54168f3dc8cb79a6fe95c5424b7ea893c707ad7a4307b0585e88dbf5f
307
+ rubocop-ast (1.49.1) sha256=4412f3ee70f6fe4546cc489548e0f6fcf76cafcfa80fa03af67098ffed755035
308
+ rubocop-performance (1.26.1) sha256=cd19b936ff196df85829d264b522fd4f98b6c89ad271fa52744a8c11b8f71834
309
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
310
+ sequel (5.105.0) sha256=4191d5e5d011b7229ff8a3401ca6beac047c4d35b1ec6703376513b4b25b2e67
311
+ shellany (0.0.1) sha256=0e127a9132698766d7e752e82cdac8250b6adbd09e6c0a7fbbb6f61964fedee7
312
+ standard (1.54.0) sha256=7a4b08f83d9893083c8f03bc486f0feeb6a84d48233b40829c03ef4767ea0100
313
+ standard-custom (1.0.2) sha256=424adc84179a074f1a2a309bb9cf7cd6bfdb2b6541f20c6bf9436c0ba22a652b
314
+ standard-performance (1.9.0) sha256=49483d31be448292951d80e5e67cdcb576c2502103c7b40aec6f1b6e9c88e3f2
315
+ stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
316
+ thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
317
+ tilt (2.7.0) sha256=0d5b9ba69f6a36490c64b0eee9f6e9aad517e20dcc848800a06eb116f08c6ab3
318
+ timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
319
+ tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
320
+ unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
321
+ unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
322
+ zeitwerk (2.8.2) sha256=7212a61311083c604184b1ea2574b9aa05cd14f855a0841c06985cabe9181d12
323
+
324
+ BUNDLED WITH
325
+ 4.0.6
@@ -0,0 +1,23 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exist?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard "puma" do
19
+ watch("Gemfile.lock")
20
+ watch(%r{^public/.*})
21
+ watch(%r{^services/.*})
22
+ watch(%r{^[^/]+\.rb$})
23
+ end
@@ -0,0 +1 @@
1
+ # TODO
@@ -0,0 +1,60 @@
1
+ # Rakefile
2
+
3
+ require "fileutils"
4
+
5
+ # List rake tasks
6
+ task :default do
7
+ system("rake -T")
8
+ end
9
+
10
+ # Console Task
11
+ desc "Open a console with application context (alias: rake c)"
12
+ task :console do
13
+ system("irb -r ./boot.rb")
14
+ end
15
+ task c: :console
16
+
17
+ # Lint Task
18
+ desc "Run lint"
19
+ task :lint do
20
+ system("bundle exec standardrb")
21
+ end
22
+
23
+ # Lint Fix Task
24
+ desc "Auto fix lint warnings"
25
+ task "lint:fix" do
26
+ system("bundle exec standardrb --fix")
27
+ end
28
+
29
+ # Test Task
30
+ desc "Run tests"
31
+ task :test do<% if context.rspec? %>
32
+ system("RACK_ENV=test bundle exec rspec")<% else %>
33
+ system("RACK_ENV=test bundle exec minitest spec/")<% end %>
34
+ end
35
+
36
+ # Development Server Task
37
+ desc "Exec development server"
38
+ task :dev do
39
+ system("RACK_ENV=development bundle exec puma --port 4000")
40
+ end
41
+
42
+ # Development Watch Task
43
+ desc "Exec development server watching for changes"
44
+ task "dev:watch" do
45
+ system("RACK_ENV=development bundle exec guard")
46
+ end
47
+
48
+ # Production Server Task
49
+ desc "Exec production server"
50
+ task :prod do
51
+ if ENV["DATABASE_URL"].nil?
52
+ puts("DATABASE_URL is empty")
53
+ exit 1
54
+ end
55
+ if ENV["SESSION_SECRET"].nil?
56
+ puts("SESSION_SECRET is empty")
57
+ exit 1
58
+ end
59
+ system("RUBYOPT=--yjit RUBY_YJIT_ENABLE=1 RACK_ENV=production bundle exec puma --port 4000")
60
+ end
@@ -0,0 +1,28 @@
1
+ class App < Roda
2
+ # Routing
3
+ plugin :all_verbs
4
+ plugin :not_found
5
+
6
+ # Request / Response
7
+ plugin :halt
8
+ plugin :json
9
+ plugin :exception_page
10
+
11
+ # Other
12
+ plugin :common_logger
13
+ plugin :json_parser
14
+
15
+ route do |r|
16
+ r.root do
17
+ { message: "Hello world" }
18
+ end
19
+ end
20
+
21
+ error do |e|
22
+ next exception_page(e, css_file: "/public/exception_page.css") if NOT_PRODUCTION
23
+ end
24
+
25
+ not_found do
26
+ "not found"
27
+ end
28
+ end
@@ -0,0 +1,28 @@
1
+ require "bundler/setup"
2
+
3
+ NOT_PRODUCTION = (ENV["RACK_ENV"] || "development") != "production"
4
+
5
+ Bundler.require
6
+
7
+ # require 'byebug' if ENV['RACK_ENV'] != 'production'
8
+
9
+ # Config file loads
10
+ loader = Zeitwerk::Loader.new
11
+ loader.collapse("#{__dir__}/services")
12
+
13
+ # [
14
+ # 'config',
15
+ # 'models',
16
+ # 'services',
17
+ # 'callbacks',
18
+ # 'actions'
19
+ # ].each do |path|
20
+ # loader.push_dir("#{__dir__}/app/#{path}")
21
+ # end
22
+ loader.setup
23
+
24
+ require "debug" if NOT_PRODUCTION
25
+
26
+ Oj.mimic_JSON
27
+
28
+ require_relative "app"
@@ -0,0 +1,7 @@
1
+ require_relative 'boot'
2
+ # Rack::Attack.throttle('signup/ip', limit: 3, period: 15.minutes) do |req|
3
+ # req.ip if req.path == '/signup'
4
+ # end
5
+
6
+ use Rack::Static, urls: ["/public"]
7
+ run App
@@ -0,0 +1,16 @@
1
+ body {
2
+ background-color: #191b1c;
3
+ color: white;
4
+ padding: 1em;
5
+ font-family: monospace;
6
+ }
7
+
8
+ a {
9
+ color: #ef4348;
10
+ }
11
+
12
+ .context {
13
+ background-color: #212121;
14
+ padding: 0.5em;
15
+ margin: 0.5em 0em 0.5em;
16
+ }
@@ -35,6 +35,7 @@ gem "rake"
35
35
  gem "html_slice"
36
36
  gem "mail"
37
37
  gem "bcrypt"
38
+ gem "logger"
38
39
 
39
40
  group :development do
40
41
  gem "guard-puma"
@@ -1,29 +1 @@
1
- # Rackr project scaffold
2
-
3
- ### Running
4
-
5
- 1. `$ bundle install`
6
- 2. `$ yarn`
7
- 3. `$ bin/dev`
8
-
9
- for watch and compile assets:
10
- 1. `$ bin/dev-assets`
11
-
12
- ### Migrations
13
-
14
- - `$ bin/db/migrate`
15
-
16
- ### Included
17
-
18
- gems:
19
- - `roda` for routes
20
- - `sequel` + `sqlite3` for database work
21
- - `rerun` for reload after changes
22
- - `rspec` for tests
23
- - `zeitwerk` for code load
24
-
25
- js:
26
- - `@hotwired/turbo`
27
-
28
- assets:
29
- - `esbuild` for bundle js assets
1
+ # TODO
@@ -0,0 +1,8 @@
1
+ require_relative "spec_helper"
2
+
3
+ describe "hello" do
4
+ it "test requests" do
5
+ get "/"
6
+ _(last_response.status).must_equal 200
7
+ end
8
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV["RACK_ENV"] = "test"
4
+
5
+ require_relative "../boot"
6
+ require 'rack/test'
7
+ require "minitest/autorun"
8
+ require 'minitest/hooks/default'
9
+
10
+ class Minitest::HooksSpec
11
+ include Rack::Test::Methods
12
+
13
+ def app
14
+ App.freeze.app
15
+ end
16
+ end
17
+
18
+ class Minitest::HooksSpec
19
+ def log
20
+ LOGGER.level = Logger::INFO
21
+ yield
22
+ ensure
23
+ LOGGER.level = Logger::FATAL
24
+ end
25
+ end
@@ -0,0 +1,8 @@
1
+ require_relative "spec_helper"
2
+
3
+ describe "hello" do
4
+ it "test requests" do
5
+ get "/"
6
+ expect(last_response.status).to eq(200)
7
+ end
8
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ ENV["RACK_ENV"] = "test"
4
+
5
+ require_relative "../boot"
6
+ require "rack/test"
7
+ require "rspec"
8
+
9
+ RSpec.configure do |config|
10
+ config.include Rack::Test::Methods
11
+
12
+ def app
13
+ App.freeze.app
14
+ end
15
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roda-project
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique F. Teixeira
@@ -70,6 +70,16 @@ files:
70
70
  - lib/roda/project/helpers/template.rb
71
71
  - lib/roda/project/version.rb
72
72
  - lib/roda/templates/base/app/app.rb.erb
73
+ - lib/roda/templates/base/minimal/AGENTS.md
74
+ - lib/roda/templates/base/minimal/Gemfile.erb
75
+ - lib/roda/templates/base/minimal/Gemfile.lock
76
+ - lib/roda/templates/base/minimal/Guardfile
77
+ - lib/roda/templates/base/minimal/README.md
78
+ - lib/roda/templates/base/minimal/Rakefile.erb
79
+ - lib/roda/templates/base/minimal/app.rb
80
+ - lib/roda/templates/base/minimal/boot.rb
81
+ - lib/roda/templates/base/minimal/config.ru
82
+ - lib/roda/templates/base/minimal/public/exception_page.css
73
83
  - lib/roda/templates/base/scaffold/AGENTS.md
74
84
  - lib/roda/templates/base/scaffold/Gemfile.erb
75
85
  - lib/roda/templates/base/scaffold/Guardfile
@@ -104,6 +114,10 @@ files:
104
114
  - lib/roda/templates/rodauth/app/models/account.rb
105
115
  - lib/roda/templates/rodauth/app/views/create-account.erb
106
116
  - lib/roda/templates/rodauth/db/migrations/001_add_rodauth.rb
117
+ - lib/roda/templates/tests/minimal/minitest/spec/app_spec.rb
118
+ - lib/roda/templates/tests/minimal/minitest/spec/spec_helper.rb.erb
119
+ - lib/roda/templates/tests/minimal/rspec/spec/app_spec.rb
120
+ - lib/roda/templates/tests/minimal/rspec/spec/spec_helper.rb
107
121
  - lib/roda/templates/tests/minitest/spec/app/app_spec.rb.erb
108
122
  - lib/roda/templates/tests/minitest/spec/app/routes/foo_spec.rb
109
123
  - lib/roda/templates/tests/minitest/spec/app/routes/test_branch_spec.rb