maquina 0.3.0 → 0.5.1

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.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -0
  3. data/Gemfile +1 -0
  4. data/Gemfile.lock +208 -202
  5. data/app/controllers/concerns/maquina/authenticate.rb +33 -13
  6. data/app/controllers/concerns/maquina/resourceful.rb +1 -1
  7. data/app/controllers/maquina/first_runs_controller.rb +43 -0
  8. data/app/controllers/maquina/sessions_controller.rb +22 -25
  9. data/app/helpers/maquina/application_helper.rb +3 -5
  10. data/app/models/concerns/maquina/searchable.rb +4 -0
  11. data/app/models/maquina/organization.rb +2 -0
  12. data/app/models/maquina/user.rb +2 -0
  13. data/app/views/layouts/maquina/sessions.html.erb +6 -4
  14. data/app/views/maquina/accept_invitations/new_view.rb +1 -1
  15. data/app/views/maquina/application/alert.rb +4 -4
  16. data/app/views/maquina/application/components/action_text_component.rb +1 -1
  17. data/app/views/maquina/application/components/checkbox_component.rb +1 -1
  18. data/app/views/maquina/application/components/date_component.rb +1 -1
  19. data/app/views/maquina/application/components/file_component.rb +1 -1
  20. data/app/views/maquina/application/components/input_component.rb +1 -1
  21. data/app/views/maquina/application/components/select_component.rb +1 -1
  22. data/app/views/maquina/application/components/text_area_component.rb +1 -1
  23. data/app/views/maquina/application/edit.rb +1 -1
  24. data/app/views/maquina/application/form.rb +1 -1
  25. data/app/views/maquina/application/index_header.rb +1 -1
  26. data/app/views/maquina/application/index_modal.rb +1 -1
  27. data/app/views/maquina/application/index_table.rb +1 -1
  28. data/app/views/maquina/application/new.rb +1 -1
  29. data/app/views/maquina/application/sessions_header.rb +5 -3
  30. data/app/views/maquina/application_view.rb +1 -1
  31. data/app/views/maquina/first_runs/form.rb +28 -0
  32. data/app/views/maquina/first_runs/show.html.erb +5 -0
  33. data/app/views/maquina/form.rb +44 -0
  34. data/app/views/maquina/navbar/menu.rb +1 -1
  35. data/app/views/maquina/navbar/menu_item_link.rb +1 -1
  36. data/app/views/maquina/navbar/mobile_button.rb +1 -1
  37. data/app/views/maquina/navbar/mobile_menu.rb +1 -1
  38. data/app/views/maquina/navbar/notification.rb +1 -1
  39. data/app/views/maquina/navbar/profile.rb +1 -1
  40. data/app/views/maquina/navbar/profile_button.rb +1 -1
  41. data/app/views/maquina/navbar/profile_menu.rb +1 -1
  42. data/app/views/maquina/navbar/profile_menu_item_link.rb +1 -1
  43. data/app/views/maquina/navbar/search.rb +1 -1
  44. data/app/views/maquina/navbar/title.rb +1 -1
  45. data/app/views/maquina/sessions/form.rb +3 -4
  46. data/app/views/maquina/sessions/new.html.erb +1 -4
  47. data/config/importmap.rb +7 -6
  48. data/config/locales/flash.es.yml +14 -5
  49. data/config/locales/forms.es.yml +13 -1
  50. data/config/locales/models.es.yml +1 -0
  51. data/config/locales/views.es.yml +8 -0
  52. data/config/routes.rb +1 -0
  53. data/lib/generators/maquina/install_stimulus_controllers/install_stimulus_controllers_generator.rb +23 -0
  54. data/lib/maquina/version.rb +1 -1
  55. data/lib/maquina.rb +2 -2
  56. metadata +38 -87
  57. data/app/views/maquina/sessions/create.turbo_stream.erb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f491a32a98067b380165fc5998e1f62f9eb40e68a5fdd0afcdd71c2614e0ccf5
4
- data.tar.gz: 1696eea4780235d2d8a4d5ec007761efe3cf2484b92f7a25d342755dac726ee1
3
+ metadata.gz: e51a9efb272de4b998c5f61912374dbebbc5b869f59032bbee8144ab281e7ab1
4
+ data.tar.gz: a7a2f654e839f0b354f9318956fd2591968946394ddbc269eaa44e1b10e1009b
5
5
  SHA512:
6
- metadata.gz: 3d54612c668ff636cc13f5fc5bf614a05f94b9bfe99e77eac2957007cf3c9773adf5cc161215e2c0b11b6e0209866dd2a3a6b37f393af5be2d080ea7c40ce428
7
- data.tar.gz: 74f3bea13f2dbb72ecdb92318276cfe24cb3b3cb6696710ed7a8569f37c2f51cea8cdf6b33e6795ada7a9f889f98a1938c69d956015f97696cfbe062027c1f77
6
+ metadata.gz: 94aed90ec94af63c1e55d155b3cebe623eeb5e4d1443cf6c0504292de215d88e7cb738bc9c6c7d3bcdae950926fc0c79b3658ab5d59e22fb5e4418743d21aa8e
7
+ data.tar.gz: 06d69def1b1e34e7b425d030850504cca5ca7363efcb2b4c3d298020a55f8ccd705fd5a9ccc2e7e4b3748b83ebae21d206423fbb5779034fa956f15bff4e9478
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.3.4
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
 
7
7
  gem "irb"
8
8
  gem "pg"
9
+ gem "pg_search"
9
10
  gem "puma"
10
11
  gem "propshaft"
11
12
  gem "tailwindcss-rails"
data/Gemfile.lock CHANGED
@@ -1,139 +1,150 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maquina (0.3.0)
5
- action_policy (~> 0.6.3)
6
- bcrypt (~> 3.1.7)
7
- importmap-rails (~> 1.2.0)
8
- money-rails (~> 1.15.0)
9
- pagy (~> 5.10, >= 5.10.1)
10
- pg_search (~> 2.3.0)
11
- phlex-rails (~> 1.0.0)
4
+ maquina (0.5.1)
5
+ action_policy (>= 0.6.0)
6
+ bcrypt (>= 3.1.7)
7
+ importmap-rails (>= 2.0.0)
8
+ money-rails (>= 1.15.0)
9
+ pagy (>= 6.2)
10
+ phlex-rails (>= 1.1.0)
12
11
  rails (>= 7.0.4)
13
- rotp (~> 6.2, >= 6.2.1)
14
- stimulus-rails (~> 1.2.0)
15
- tailwindcss-rails (~> 2.0.0)
16
- turbo-rails (~> 1.3.0)
12
+ rotp (>= 6.2.1)
13
+ stimulus-rails (>= 1.3.0)
14
+ tailwindcss-rails (>= 2.1.0)
15
+ turbo-rails (>= 2.0.0)
17
16
 
18
17
  GEM
19
18
  remote: https://rubygems.org/
20
19
  specs:
21
- action_policy (0.6.5)
22
- ruby-next-core (>= 0.14.0)
23
- actioncable (7.0.7.2)
24
- actionpack (= 7.0.7.2)
25
- activesupport (= 7.0.7.2)
20
+ action_policy (0.7.1)
21
+ ruby-next-core (>= 1.0)
22
+ actioncable (7.2.1)
23
+ actionpack (= 7.2.1)
24
+ activesupport (= 7.2.1)
26
25
  nio4r (~> 2.0)
27
26
  websocket-driver (>= 0.6.1)
28
- actionmailbox (7.0.7.2)
29
- actionpack (= 7.0.7.2)
30
- activejob (= 7.0.7.2)
31
- activerecord (= 7.0.7.2)
32
- activestorage (= 7.0.7.2)
33
- activesupport (= 7.0.7.2)
34
- mail (>= 2.7.1)
35
- net-imap
36
- net-pop
37
- net-smtp
38
- actionmailer (7.0.7.2)
39
- actionpack (= 7.0.7.2)
40
- actionview (= 7.0.7.2)
41
- activejob (= 7.0.7.2)
42
- activesupport (= 7.0.7.2)
43
- mail (~> 2.5, >= 2.5.4)
44
- net-imap
45
- net-pop
46
- net-smtp
47
- rails-dom-testing (~> 2.0)
48
- actionpack (7.0.7.2)
49
- actionview (= 7.0.7.2)
50
- activesupport (= 7.0.7.2)
51
- rack (~> 2.0, >= 2.2.4)
27
+ zeitwerk (~> 2.6)
28
+ actionmailbox (7.2.1)
29
+ actionpack (= 7.2.1)
30
+ activejob (= 7.2.1)
31
+ activerecord (= 7.2.1)
32
+ activestorage (= 7.2.1)
33
+ activesupport (= 7.2.1)
34
+ mail (>= 2.8.0)
35
+ actionmailer (7.2.1)
36
+ actionpack (= 7.2.1)
37
+ actionview (= 7.2.1)
38
+ activejob (= 7.2.1)
39
+ activesupport (= 7.2.1)
40
+ mail (>= 2.8.0)
41
+ rails-dom-testing (~> 2.2)
42
+ actionpack (7.2.1)
43
+ actionview (= 7.2.1)
44
+ activesupport (= 7.2.1)
45
+ nokogiri (>= 1.8.5)
46
+ racc
47
+ rack (>= 2.2.4, < 3.2)
48
+ rack-session (>= 1.0.1)
52
49
  rack-test (>= 0.6.3)
53
- rails-dom-testing (~> 2.0)
54
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
55
- actiontext (7.0.7.2)
56
- actionpack (= 7.0.7.2)
57
- activerecord (= 7.0.7.2)
58
- activestorage (= 7.0.7.2)
59
- activesupport (= 7.0.7.2)
50
+ rails-dom-testing (~> 2.2)
51
+ rails-html-sanitizer (~> 1.6)
52
+ useragent (~> 0.16)
53
+ actiontext (7.2.1)
54
+ actionpack (= 7.2.1)
55
+ activerecord (= 7.2.1)
56
+ activestorage (= 7.2.1)
57
+ activesupport (= 7.2.1)
60
58
  globalid (>= 0.6.0)
61
59
  nokogiri (>= 1.8.5)
62
- actionview (7.0.7.2)
63
- activesupport (= 7.0.7.2)
60
+ actionview (7.2.1)
61
+ activesupport (= 7.2.1)
64
62
  builder (~> 3.1)
65
- erubi (~> 1.4)
66
- rails-dom-testing (~> 2.0)
67
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
68
- activejob (7.0.7.2)
69
- activesupport (= 7.0.7.2)
63
+ erubi (~> 1.11)
64
+ rails-dom-testing (~> 2.2)
65
+ rails-html-sanitizer (~> 1.6)
66
+ activejob (7.2.1)
67
+ activesupport (= 7.2.1)
70
68
  globalid (>= 0.3.6)
71
- activemodel (7.0.7.2)
72
- activesupport (= 7.0.7.2)
73
- activerecord (7.0.7.2)
74
- activemodel (= 7.0.7.2)
75
- activesupport (= 7.0.7.2)
76
- activestorage (7.0.7.2)
77
- actionpack (= 7.0.7.2)
78
- activejob (= 7.0.7.2)
79
- activerecord (= 7.0.7.2)
80
- activesupport (= 7.0.7.2)
69
+ activemodel (7.2.1)
70
+ activesupport (= 7.2.1)
71
+ activerecord (7.2.1)
72
+ activemodel (= 7.2.1)
73
+ activesupport (= 7.2.1)
74
+ timeout (>= 0.4.0)
75
+ activestorage (7.2.1)
76
+ actionpack (= 7.2.1)
77
+ activejob (= 7.2.1)
78
+ activerecord (= 7.2.1)
79
+ activesupport (= 7.2.1)
81
80
  marcel (~> 1.0)
82
- mini_mime (>= 1.1.0)
83
- activesupport (7.0.7.2)
84
- concurrent-ruby (~> 1.0, >= 1.0.2)
81
+ activesupport (7.2.1)
82
+ base64
83
+ bigdecimal
84
+ concurrent-ruby (~> 1.0, >= 1.3.1)
85
+ connection_pool (>= 2.2.5)
86
+ drb
85
87
  i18n (>= 1.6, < 2)
88
+ logger (>= 1.4.2)
86
89
  minitest (>= 5.1)
87
- tzinfo (~> 2.0)
88
- addressable (2.8.5)
89
- public_suffix (>= 2.0.2, < 6.0)
90
+ securerandom (>= 0.3)
91
+ tzinfo (~> 2.0, >= 2.0.5)
92
+ addressable (2.8.7)
93
+ public_suffix (>= 2.0.2, < 7.0)
90
94
  ast (2.4.2)
91
95
  backport (1.2.0)
92
- base64 (0.1.1)
93
- bcrypt (3.1.19)
94
- benchmark (0.2.1)
95
- brakeman (6.0.1)
96
- builder (3.2.4)
96
+ base64 (0.2.0)
97
+ bcrypt (3.1.20)
98
+ benchmark (0.3.0)
99
+ bigdecimal (3.1.8)
100
+ brakeman (6.2.1)
101
+ racc
102
+ builder (3.3.0)
97
103
  bundle-audit (0.1.0)
98
104
  bundler-audit
99
- bundler-audit (0.9.1)
105
+ bundler-audit (0.9.2)
100
106
  bundler (>= 1.2.0, < 3)
101
107
  thor (~> 1.0)
102
- cgi (0.3.6)
103
- concurrent-ruby (1.2.2)
108
+ childprocess (5.1.0)
109
+ logger (~> 1.5)
110
+ concurrent-ruby (1.3.4)
111
+ connection_pool (2.4.1)
104
112
  crass (1.0.6)
105
- date (3.3.3)
106
- debug (1.8.0)
107
- irb (>= 1.5.0)
108
- reline (>= 0.3.1)
109
- diff-lcs (1.5.0)
113
+ date (3.3.4)
114
+ debug (1.9.2)
115
+ irb (~> 1.10)
116
+ reline (>= 0.3.8)
117
+ diff-lcs (1.5.1)
118
+ drb (2.2.1)
110
119
  e2mmap (0.1.0)
111
- erb (4.0.3)
112
- cgi (>= 0.3.3)
113
- erubi (1.12.0)
114
- globalid (1.1.0)
115
- activesupport (>= 5.0)
116
- i18n (1.14.1)
120
+ erubi (1.13.0)
121
+ globalid (1.2.1)
122
+ activesupport (>= 6.1)
123
+ i18n (1.14.5)
117
124
  concurrent-ruby (~> 1.0)
118
- importmap-rails (1.2.1)
125
+ importmap-rails (2.0.1)
119
126
  actionpack (>= 6.0.0)
127
+ activesupport (>= 6.0.0)
120
128
  railties (>= 6.0.0)
121
- io-console (0.6.0)
122
- irb (1.7.4)
123
- reline (>= 0.3.6)
124
- jaro_winkler (1.5.6)
125
- json (2.6.3)
129
+ io-console (0.7.2)
130
+ irb (1.14.0)
131
+ rdoc (>= 4.0.0)
132
+ reline (>= 0.4.2)
133
+ jaro_winkler (1.6.0)
134
+ json (2.7.2)
126
135
  kramdown (2.4.0)
127
136
  rexml
128
137
  kramdown-parser-gfm (1.1.0)
129
138
  kramdown (~> 2.0)
130
139
  language_server-protocol (3.17.0.3)
131
- launchy (2.5.2)
140
+ launchy (3.0.1)
132
141
  addressable (~> 2.8)
133
- letter_opener (1.8.1)
134
- launchy (>= 2.2, < 3)
142
+ childprocess (~> 5.0)
143
+ letter_opener (1.10.0)
144
+ launchy (>= 2.2, < 4)
135
145
  lint_roller (1.1.0)
136
- loofah (2.21.3)
146
+ logger (1.6.1)
147
+ loofah (2.22.0)
137
148
  crass (~> 1.0.2)
138
149
  nokogiri (>= 1.12.0)
139
150
  mail (2.8.1)
@@ -141,76 +152,76 @@ GEM
141
152
  net-imap
142
153
  net-pop
143
154
  net-smtp
144
- marcel (1.0.2)
145
- method_source (1.0.0)
155
+ marcel (1.0.4)
146
156
  mini_mime (1.1.5)
147
- minitest (5.19.0)
148
- monetize (1.12.0)
157
+ minitest (5.25.1)
158
+ monetize (1.13.0)
149
159
  money (~> 6.12)
150
- money (6.16.0)
160
+ money (6.19.0)
151
161
  i18n (>= 0.6.4, <= 2)
152
162
  money-rails (1.15.0)
153
163
  activesupport (>= 3.0)
154
164
  monetize (~> 1.9)
155
165
  money (~> 6.13)
156
166
  railties (>= 3.0)
157
- net-imap (0.3.7)
167
+ net-imap (0.4.16)
158
168
  date
159
169
  net-protocol
160
170
  net-pop (0.1.2)
161
171
  net-protocol
162
- net-protocol (0.2.1)
172
+ net-protocol (0.2.2)
163
173
  timeout
164
- net-smtp (0.3.3)
174
+ net-smtp (0.5.0)
165
175
  net-protocol
166
- nio4r (2.5.9)
167
- nokogiri (1.15.4-arm64-darwin)
176
+ nio4r (2.7.3)
177
+ nokogiri (1.16.7-arm64-darwin)
168
178
  racc (~> 1.4)
169
- pagy (5.10.1)
170
- activesupport
171
- parallel (1.23.0)
172
- parser (3.2.2.3)
179
+ pagy (9.0.8)
180
+ parallel (1.26.3)
181
+ parser (3.3.5.0)
173
182
  ast (~> 2.4.1)
174
183
  racc
175
- pg (1.5.3)
176
- pg_search (2.3.6)
177
- activerecord (>= 5.2)
178
- activesupport (>= 5.2)
179
- phlex (1.8.1)
180
- concurrent-ruby (~> 1.2)
181
- erb (>= 4)
182
- zeitwerk (~> 2.6)
183
- phlex-rails (1.0.0)
184
- phlex (~> 1.7)
185
- rails (>= 6.1, < 8)
186
- zeitwerk (~> 2.6)
187
- prettier_print (1.2.1)
188
- propshaft (0.7.0)
184
+ pg (1.5.8)
185
+ pg_search (2.3.7)
186
+ activerecord (>= 6.1)
187
+ activesupport (>= 6.1)
188
+ phlex (1.10.3)
189
+ phlex-rails (1.2.1)
190
+ phlex (~> 1.10.0)
191
+ railties (>= 6.1, < 8)
192
+ propshaft (0.9.1)
189
193
  actionpack (>= 7.0.0)
190
194
  activesupport (>= 7.0.0)
191
195
  rack
192
196
  railties (>= 7.0.0)
193
- public_suffix (5.0.3)
194
- puma (6.3.1)
197
+ psych (5.1.2)
198
+ stringio
199
+ public_suffix (6.0.1)
200
+ puma (6.4.2)
195
201
  nio4r (~> 2.0)
196
- racc (1.7.1)
197
- rack (2.2.8)
202
+ racc (1.8.1)
203
+ rack (3.1.7)
204
+ rack-session (2.0.0)
205
+ rack (>= 3.0.0)
198
206
  rack-test (2.1.0)
199
207
  rack (>= 1.3)
200
- rails (7.0.7.2)
201
- actioncable (= 7.0.7.2)
202
- actionmailbox (= 7.0.7.2)
203
- actionmailer (= 7.0.7.2)
204
- actionpack (= 7.0.7.2)
205
- actiontext (= 7.0.7.2)
206
- actionview (= 7.0.7.2)
207
- activejob (= 7.0.7.2)
208
- activemodel (= 7.0.7.2)
209
- activerecord (= 7.0.7.2)
210
- activestorage (= 7.0.7.2)
211
- activesupport (= 7.0.7.2)
208
+ rackup (2.1.0)
209
+ rack (>= 3)
210
+ webrick (~> 1.8)
211
+ rails (7.2.1)
212
+ actioncable (= 7.2.1)
213
+ actionmailbox (= 7.2.1)
214
+ actionmailer (= 7.2.1)
215
+ actionpack (= 7.2.1)
216
+ actiontext (= 7.2.1)
217
+ actionview (= 7.2.1)
218
+ activejob (= 7.2.1)
219
+ activemodel (= 7.2.1)
220
+ activerecord (= 7.2.1)
221
+ activestorage (= 7.2.1)
222
+ activesupport (= 7.2.1)
212
223
  bundler (>= 1.15.0)
213
- railties (= 7.0.7.2)
224
+ railties (= 7.2.1)
214
225
  rails-dom-testing (2.2.0)
215
226
  activesupport (>= 5.0.0)
216
227
  minitest
@@ -218,52 +229,51 @@ GEM
218
229
  rails-html-sanitizer (1.6.0)
219
230
  loofah (~> 2.21)
220
231
  nokogiri (~> 1.14)
221
- railties (7.0.7.2)
222
- actionpack (= 7.0.7.2)
223
- activesupport (= 7.0.7.2)
224
- method_source
232
+ railties (7.2.1)
233
+ actionpack (= 7.2.1)
234
+ activesupport (= 7.2.1)
235
+ irb (~> 1.13)
236
+ rackup (>= 1.0.0)
225
237
  rake (>= 12.2)
226
- thor (~> 1.0)
227
- zeitwerk (~> 2.5)
238
+ thor (~> 1.0, >= 1.2.2)
239
+ zeitwerk (~> 2.6)
228
240
  rainbow (3.1.1)
229
- rake (13.0.6)
241
+ rake (13.2.1)
230
242
  rbs (2.8.4)
231
- regexp_parser (2.8.1)
232
- reline (0.3.8)
243
+ rdoc (6.7.0)
244
+ psych (>= 4.0.0)
245
+ regexp_parser (2.9.2)
246
+ reline (0.5.10)
233
247
  io-console (~> 0.5)
234
248
  reverse_markdown (2.1.1)
235
249
  nokogiri
236
- rexml (3.2.6)
237
- rotp (6.2.2)
238
- rubocop (1.56.2)
239
- base64 (~> 0.1.1)
250
+ rexml (3.3.7)
251
+ rotp (6.3.0)
252
+ rubocop (1.65.1)
240
253
  json (~> 2.3)
241
254
  language_server-protocol (>= 3.17.0)
242
255
  parallel (~> 1.10)
243
- parser (>= 3.2.2.3)
256
+ parser (>= 3.3.0.2)
244
257
  rainbow (>= 2.2.2, < 4.0)
245
- regexp_parser (>= 1.8, < 3.0)
258
+ regexp_parser (>= 2.4, < 3.0)
246
259
  rexml (>= 3.2.5, < 4.0)
247
- rubocop-ast (>= 1.28.1, < 2.0)
260
+ rubocop-ast (>= 1.31.1, < 2.0)
248
261
  ruby-progressbar (~> 1.7)
249
262
  unicode-display_width (>= 2.4.0, < 3.0)
250
- rubocop-ast (1.29.0)
251
- parser (>= 3.2.1.0)
252
- rubocop-performance (1.19.0)
253
- rubocop (>= 1.7.0, < 2.0)
254
- rubocop-ast (>= 0.4.0)
255
- rubocop-rails (2.19.1)
263
+ rubocop-ast (1.32.3)
264
+ parser (>= 3.3.1.0)
265
+ rubocop-performance (1.21.1)
266
+ rubocop (>= 1.48.1, < 2.0)
267
+ rubocop-ast (>= 1.31.1, < 2.0)
268
+ rubocop-rails (2.26.0)
256
269
  activesupport (>= 4.2.0)
257
270
  rack (>= 1.1)
258
- rubocop (>= 1.33.0, < 2.0)
259
- ruby-lsp (0.9.2)
260
- language_server-protocol (~> 3.17.0)
261
- sorbet-runtime
262
- syntax_tree (>= 6.1.1, < 7)
263
- yarp (>= 0.9, < 0.10)
264
- ruby-next-core (0.15.3)
271
+ rubocop (>= 1.52.0, < 2.0)
272
+ rubocop-ast (>= 1.31.1, < 2.0)
273
+ ruby-next-core (1.0.3)
265
274
  ruby-progressbar (1.13.0)
266
- solargraph (0.49.0)
275
+ securerandom (0.3.1)
276
+ solargraph (0.50.0)
267
277
  backport (~> 1.2)
268
278
  benchmark
269
279
  bundler (~> 2.0)
@@ -279,50 +289,47 @@ GEM
279
289
  thor (~> 1.0)
280
290
  tilt (~> 2.0)
281
291
  yard (~> 0.9, >= 0.9.24)
282
- solargraph-rails (1.1.0)
283
- activesupport
284
- solargraph
285
- sorbet-runtime (0.5.10990)
286
- standard (1.31.0)
292
+ standard (1.40.0)
287
293
  language_server-protocol (~> 3.17.0.2)
288
294
  lint_roller (~> 1.0)
289
- rubocop (~> 1.56.0)
295
+ rubocop (~> 1.65.0)
290
296
  standard-custom (~> 1.0.0)
291
- standard-performance (~> 1.2)
297
+ standard-performance (~> 1.4)
292
298
  standard-custom (1.0.2)
293
299
  lint_roller (~> 1.0)
294
300
  rubocop (~> 1.50)
295
- standard-performance (1.2.0)
301
+ standard-performance (1.4.0)
296
302
  lint_roller (~> 1.1)
297
- rubocop-performance (~> 1.19.0)
298
- standard-rails (0.1.0)
303
+ rubocop-performance (~> 1.21.0)
304
+ standard-rails (1.2.0)
299
305
  lint_roller (~> 1.0)
300
- rubocop-rails (~> 2.19.0)
301
- stimulus-rails (1.2.2)
306
+ rubocop-rails (~> 2.26.0)
307
+ stimulus-rails (1.3.4)
302
308
  railties (>= 6.0.0)
303
- syntax_tree (6.1.1)
304
- prettier_print (>= 1.2.0)
305
- tailwindcss-rails (2.0.30-arm64-darwin)
306
- railties (>= 6.0.0)
307
- thor (1.2.2)
308
- tilt (2.2.0)
309
- timeout (0.4.0)
310
- turbo-rails (1.3.3)
309
+ stringio (3.1.1)
310
+ tailwindcss-rails (2.7.3-arm64-darwin)
311
+ railties (>= 7.0.0)
312
+ thor (1.3.2)
313
+ tilt (2.4.0)
314
+ timeout (0.4.1)
315
+ turbo-rails (2.0.6)
311
316
  actionpack (>= 6.0.0)
312
317
  activejob (>= 6.0.0)
313
318
  railties (>= 6.0.0)
314
319
  tzinfo (2.0.6)
315
320
  concurrent-ruby (~> 1.0)
316
- unicode-display_width (2.4.2)
321
+ unicode-display_width (2.5.0)
322
+ useragent (0.16.10)
323
+ webrick (1.8.1)
317
324
  websocket-driver (0.7.6)
318
325
  websocket-extensions (>= 0.1.0)
319
326
  websocket-extensions (0.1.5)
320
- yard (0.9.34)
321
- yarp (0.9.0)
322
- zeitwerk (2.6.11)
327
+ yard (0.9.37)
328
+ zeitwerk (2.6.18)
323
329
 
324
330
  PLATFORMS
325
331
  arm64-darwin-22
332
+ arm64-darwin-24
326
333
 
327
334
  DEPENDENCIES
328
335
  brakeman
@@ -332,15 +339,14 @@ DEPENDENCIES
332
339
  letter_opener
333
340
  maquina!
334
341
  pg
342
+ pg_search
335
343
  propshaft
336
344
  puma
337
- ruby-lsp
338
345
  solargraph
339
- solargraph-rails
340
346
  standard
341
347
  standard-rails
342
348
  tailwindcss-rails
343
349
  turbo-rails
344
350
 
345
351
  BUNDLED WITH
346
- 2.4.18
352
+ 2.5.1
@@ -5,32 +5,45 @@ module Maquina
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- helper_method :signed_in?, :current_user
8
+ before_action :require_authentication
9
+ helper_method :signed_in?, :current_user, :authenticated?
9
10
  end
10
11
 
11
- def authenticate!
12
- load_session
12
+ class_methods do
13
+ def allow_unauthenticated_access(...)
14
+ skip_before_action(:require_authentication, ...)
15
+ end
16
+ end
13
17
 
14
- redirect_to maquina.new_sessions_path if !signed_in?
18
+ def authenticated?
19
+ Maquina::Current.signed_in?
15
20
  end
21
+ alias_method :signed_in?, :authenticated?
16
22
 
17
- def authenticate
18
- load_session if Maquina::Current.active_session.blank?
23
+ def current_user
24
+ Maquina::Current.user
19
25
  end
20
26
 
21
- def signed_in?
22
- load_session if Maquina::Current.active_session.blank?
27
+ def after_authentication_url
28
+ session.delete(:return_to_after_authenticating) || root_url
29
+ end
23
30
 
24
- Maquina::Current.signed_in?
31
+ def require_authentication
32
+ load_session || request_authentication
25
33
  end
26
34
 
27
- def current_user
28
- load_session if Maquina::Current.active_session.blank?
35
+ private
29
36
 
30
- Maquina::Current.user
37
+ def request_authentication
38
+ session[:return_to_after_authenticating] = request.url
39
+
40
+ # TODO: Allow to configure sign in path
41
+ redirect_to maquina.new_sessions_path, format: :html, status: :see_other
31
42
  end
32
43
 
33
- private
44
+ def authenticate
45
+ load_session
46
+ end
34
47
 
35
48
  def load_session
36
49
  active_session_id = session["--active_session"]
@@ -48,5 +61,12 @@ module Maquina
48
61
 
49
62
  Maquina::Current.active_session = active_session
50
63
  end
64
+
65
+ def start_new_session_for(user)
66
+ ActiveSession.create(user: user, user_agent: request.user_agent, remote_addr: request.remote_ip).tap do |active_session|
67
+ session["--active_session"] = active_session.id
68
+ Maquina::Current.active_session = active_session
69
+ end
70
+ end
51
71
  end
52
72
  end
@@ -118,7 +118,7 @@ module Maquina
118
118
  respond_to do |format|
119
119
  if has_errors
120
120
  format.html { render object.persisted? ? :edit : :new }
121
- format.turbo_stream
121
+ # format.turbo_stream
122
122
  format.json { render json: {errors: object.errors.map { |error| {error.attribute => error.message} }} }
123
123
  else
124
124
  format.html { redirect_to collection_path, status: :see_other }