michel 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/dynamic-security.yml +19 -0
  3. data/.github/workflows/main.yml +92 -0
  4. data/.gitignore +14 -0
  5. data/.rspec +3 -0
  6. data/.ruby-version +1 -0
  7. data/.standard.yml +5 -0
  8. data/CHANGELOG.md +5 -0
  9. data/CODE_OF_CONDUCT.md +6 -0
  10. data/CONTRIBUTING.md +38 -0
  11. data/Gemfile +17 -0
  12. data/Gemfile.lock +325 -0
  13. data/LICENSE +19 -0
  14. data/README.md +76 -0
  15. data/RELEASING.md +43 -0
  16. data/Rakefile +10 -0
  17. data/SECURITY.md +2 -0
  18. data/bin/console +11 -0
  19. data/bin/setup +8 -0
  20. data/lib/generators/michel/install/install_generator.rb +13 -0
  21. data/lib/generators/michel/install/templates/michel.rb +5 -0
  22. data/lib/generators/michel/view/templates/belongs_to_associations.erb +6 -0
  23. data/lib/generators/michel/view/templates/has_many_associations.erb +2 -0
  24. data/lib/generators/michel/view/templates/index_migration.erb +15 -0
  25. data/lib/generators/michel/view/templates/view.erb +95 -0
  26. data/lib/generators/michel/view/templates/view_migration.rb +8 -0
  27. data/lib/generators/michel/view/view_generator.rb +59 -0
  28. data/lib/michel/version.rb +5 -0
  29. data/lib/michel.rb +60 -0
  30. data/michel.gemspec +33 -0
  31. data/sig/michel.rbs +4 -0
  32. data/spec/example-app/.ruby-version +1 -0
  33. data/spec/example-app/Rakefile +6 -0
  34. data/spec/example-app/app/controllers/application_controller.rb +2 -0
  35. data/spec/example-app/app/controllers/concerns/.keep +0 -0
  36. data/spec/example-app/app/models/application_record.rb +3 -0
  37. data/spec/example-app/app/models/appointment.rb +3 -0
  38. data/spec/example-app/app/models/concerns/.keep +0 -0
  39. data/spec/example-app/app/models/physician.rb +4 -0
  40. data/spec/example-app/app/models/physician_availability.rb +3 -0
  41. data/spec/example-app/bin/bundle +109 -0
  42. data/spec/example-app/bin/dev +2 -0
  43. data/spec/example-app/bin/rails +4 -0
  44. data/spec/example-app/bin/rake +4 -0
  45. data/spec/example-app/bin/setup +34 -0
  46. data/spec/example-app/config/application.rb +44 -0
  47. data/spec/example-app/config/boot.rb +3 -0
  48. data/spec/example-app/config/credentials.yml.enc +1 -0
  49. data/spec/example-app/config/database.yml +85 -0
  50. data/spec/example-app/config/environment.rb +5 -0
  51. data/spec/example-app/config/environments/development.rb +49 -0
  52. data/spec/example-app/config/environments/production.rb +64 -0
  53. data/spec/example-app/config/environments/test.rb +42 -0
  54. data/spec/example-app/config/initializers/cors.rb +16 -0
  55. data/spec/example-app/config/initializers/filter_parameter_logging.rb +8 -0
  56. data/spec/example-app/config/initializers/inflections.rb +16 -0
  57. data/spec/example-app/config/locales/en.yml +31 -0
  58. data/spec/example-app/config/puma.rb +38 -0
  59. data/spec/example-app/config/routes.rb +10 -0
  60. data/spec/example-app/config.ru +6 -0
  61. data/spec/example-app/db/migrate/20250829205200_create_physicians.rb +8 -0
  62. data/spec/example-app/db/migrate/20250829205205_create_appointments.rb +10 -0
  63. data/spec/example-app/db/migrate/20250829205257_create_availabilities.rb +12 -0
  64. data/spec/example-app/db/schema.rb +42 -0
  65. data/spec/example-app/db/seeds.rb +9 -0
  66. data/spec/example-app/lib/tasks/.keep +0 -0
  67. data/spec/example-app/log/.keep +0 -0
  68. data/spec/example-app/public/robots.txt +1 -0
  69. data/spec/example-app/script/.keep +0 -0
  70. data/spec/example-app/tmp/.keep +0 -0
  71. data/spec/example-app/tmp/pids/.keep +0 -0
  72. data/spec/example-app/vendor/.keep +0 -0
  73. data/spec/generators/michel/install/install_generator_spec.rb +18 -0
  74. data/spec/generators/michel/view/view_generator_spec.rb +63 -0
  75. data/spec/lib/michel_spec.rb +60 -0
  76. data/spec/spec_helper.rb +27 -0
  77. metadata +158 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e3377d5257bd7ad52f252b0c27cd463b93ef3c5f2df0c886b3da63d247849c72
4
+ data.tar.gz: 45b6662ff6f2bb740db51b2ae964f9b67b6b1b3b46ecb6da73b202cbd8b0f7f1
5
+ SHA512:
6
+ metadata.gz: 55245d9919ed8f65329383cec02dae191c70948e43d11c06628969afbb2b2fcf6775f3309048cdff57547e920cfb7107f311b54436e91b66baaeaef811d381ba
7
+ data.tar.gz: 95bd0b7e09a5c664ff8ca269f2c1f2d1a99e7f8147c837776b0b7f4b20f8f56ee52f1913321f59ea8cb0e774729a5e75d0fc7324ef4d6b775b0ad3f0c9747f3b
@@ -0,0 +1,19 @@
1
+ name: update-security
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - SECURITY.md
7
+ branches:
8
+ - main
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ update-security:
13
+ permissions:
14
+ contents: write
15
+ pull-requests: write
16
+ pages: write
17
+ uses: thoughtbot/templates/.github/workflows/dynamic-security.yaml@main
18
+ secrets:
19
+ token: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,92 @@
1
+ name: Verify
2
+
3
+ on: [pull_request, workflow_call]
4
+
5
+ jobs:
6
+ checks:
7
+ name: Checks
8
+ runs-on: ubuntu-latest
9
+
10
+ services:
11
+ postgres:
12
+ image: postgres:latest
13
+ ports:
14
+ - 5432:5432
15
+ env:
16
+ POSTGRES_USER: postgres
17
+ POSTGRES_PASSWORD: postgres
18
+ options: >-
19
+ --health-cmd pg_isready
20
+ --health-interval 10s
21
+ --health-timeout 5s
22
+ --health-retries 5
23
+
24
+ steps:
25
+ - name: Checkout code
26
+ uses: actions/checkout@v4
27
+
28
+ - name: Set up Ruby and install gems
29
+ uses: ruby/setup-ruby@v1
30
+ with:
31
+ bundler-cache: true
32
+
33
+ - name: Run Security Checks
34
+ run: bundle exec bundle-audit check --update
35
+
36
+ - name: Print Versions
37
+ run: |
38
+ psql --version
39
+ pg_dump --version
40
+
41
+ - name: Run Linter Checks
42
+ run: |
43
+ bundle exec rake standard
44
+
45
+ tests:
46
+ name: Tests
47
+ runs-on: ubuntu-latest
48
+
49
+ services:
50
+ postgres:
51
+ image: postgres:latest
52
+ ports:
53
+ - 5432:5432
54
+ env:
55
+ POSTGRES_USER: postgres
56
+ POSTGRES_PASSWORD: postgres
57
+ options: >-
58
+ --health-cmd pg_isready
59
+ --health-interval 10s
60
+ --health-timeout 5s
61
+ --health-retries 5
62
+
63
+ steps:
64
+ - name: Checkout code
65
+ uses: actions/checkout@v4
66
+
67
+ - name: Set up Ruby and install gems
68
+ uses: ruby/setup-ruby@v1
69
+ with:
70
+ bundler-cache: true
71
+ - name: Set up App
72
+ env:
73
+ PGHOST: localhost
74
+ PGUSER: postgres
75
+ PGPASSWORD: postgres
76
+ RAILS_ENV: test
77
+ working-directory: ./spec/example-app
78
+ run: |
79
+ bundle install
80
+ bin/rails db:setup
81
+ bin/rails db:test:prepare
82
+
83
+ - name: Run Tests
84
+ env:
85
+ APPLICATION_HOST: test
86
+ PGHOST: localhost
87
+ PGUSER: postgres
88
+ PGPASSWORD: postgres
89
+ RAILS_ENV: test
90
+ working-directory: ./
91
+ run: |
92
+ bundle exec rake spec
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /spec/example-app/log/
10
+
11
+ # rspec failure tracking
12
+ .rspec_status
13
+ spec/example-app/config/master.key
14
+ spec/example-app/tmp
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.2
data/.standard.yml ADDED
@@ -0,0 +1,5 @@
1
+ ignore:
2
+ - 'lib/generators/michel/view/templates/view_migration.rb':
3
+ - Layout/InitialIndentation
4
+ - Layout/TrailingEmptyLines
5
+ - Layout/TrailingWhitespace
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 - 2026-01-28
4
+
5
+ Initial release
@@ -0,0 +1,6 @@
1
+ # Code of conduct
2
+
3
+ By participating in this project, you agree to abide by the
4
+ [thoughtbot code of conduct][1].
5
+
6
+ [1]: https://thoughtbot.com/open-source-code-of-conduct
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,38 @@
1
+ # Contributing
2
+
3
+ We love contributions from everyone.
4
+ By participating in this project,
5
+ you agree to abide by the thoughtbot [code of conduct].
6
+
7
+ [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
8
+
9
+ We expect everyone to follow the code of conduct
10
+ anywhere in thoughtbot's project codebases,
11
+ issue trackers, chatrooms, and mailing lists.
12
+
13
+ ## Contributing Code
14
+
15
+
16
+ Fork the repo.
17
+
18
+ `bundle install`
19
+
20
+ Make sure the tests pass:
21
+
22
+ `bundle exec rspec`
23
+
24
+ Make your change, with new passing tests. Follow the [style guide][style].
25
+
26
+ [style]: https://github.com/thoughtbot/guides/tree/master/style
27
+
28
+ Mention how your changes affect the project to other developers and users in the
29
+ `CHANGELOG.md` file.
30
+
31
+ Push to your fork. Write a [good commit message][commit]. Submit a pull request.
32
+
33
+ [commit]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
34
+
35
+ Others will give constructive feedback.
36
+ This is a time for discussion and improvements,
37
+ and making the necessary changes will be required before we can
38
+ merge the contribution.
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in michel.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+ gem "standardrb"
10
+
11
+ gem "rails", "~> 8.0.2", ">= 8.0.2.1"
12
+ gem "pg", "~> 1.1"
13
+ gem "bundler-audit", ">= 0.7.0", require: false
14
+ gem "database_cleaner"
15
+ gem "ammeter"
16
+ gem "debug"
17
+ gem "scenic"
data/Gemfile.lock ADDED
@@ -0,0 +1,325 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ michel (0.1.0)
5
+ activerecord (>= 7.0.0)
6
+ pg (~> 1.0)
7
+ scenic (~> 1.9)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (8.0.2.1)
13
+ actionpack (= 8.0.2.1)
14
+ activesupport (= 8.0.2.1)
15
+ nio4r (~> 2.0)
16
+ websocket-driver (>= 0.6.1)
17
+ zeitwerk (~> 2.6)
18
+ actionmailbox (8.0.2.1)
19
+ actionpack (= 8.0.2.1)
20
+ activejob (= 8.0.2.1)
21
+ activerecord (= 8.0.2.1)
22
+ activestorage (= 8.0.2.1)
23
+ activesupport (= 8.0.2.1)
24
+ mail (>= 2.8.0)
25
+ actionmailer (8.0.2.1)
26
+ actionpack (= 8.0.2.1)
27
+ actionview (= 8.0.2.1)
28
+ activejob (= 8.0.2.1)
29
+ activesupport (= 8.0.2.1)
30
+ mail (>= 2.8.0)
31
+ rails-dom-testing (~> 2.2)
32
+ actionpack (8.0.2.1)
33
+ actionview (= 8.0.2.1)
34
+ activesupport (= 8.0.2.1)
35
+ nokogiri (>= 1.8.5)
36
+ rack (>= 2.2.4)
37
+ rack-session (>= 1.0.1)
38
+ rack-test (>= 0.6.3)
39
+ rails-dom-testing (~> 2.2)
40
+ rails-html-sanitizer (~> 1.6)
41
+ useragent (~> 0.16)
42
+ actiontext (8.0.2.1)
43
+ actionpack (= 8.0.2.1)
44
+ activerecord (= 8.0.2.1)
45
+ activestorage (= 8.0.2.1)
46
+ activesupport (= 8.0.2.1)
47
+ globalid (>= 0.6.0)
48
+ nokogiri (>= 1.8.5)
49
+ actionview (8.0.2.1)
50
+ activesupport (= 8.0.2.1)
51
+ builder (~> 3.1)
52
+ erubi (~> 1.11)
53
+ rails-dom-testing (~> 2.2)
54
+ rails-html-sanitizer (~> 1.6)
55
+ activejob (8.0.2.1)
56
+ activesupport (= 8.0.2.1)
57
+ globalid (>= 0.3.6)
58
+ activemodel (8.0.2.1)
59
+ activesupport (= 8.0.2.1)
60
+ activerecord (8.0.2.1)
61
+ activemodel (= 8.0.2.1)
62
+ activesupport (= 8.0.2.1)
63
+ timeout (>= 0.4.0)
64
+ activestorage (8.0.2.1)
65
+ actionpack (= 8.0.2.1)
66
+ activejob (= 8.0.2.1)
67
+ activerecord (= 8.0.2.1)
68
+ activesupport (= 8.0.2.1)
69
+ marcel (~> 1.0)
70
+ activesupport (8.0.2.1)
71
+ base64
72
+ benchmark (>= 0.3)
73
+ bigdecimal
74
+ concurrent-ruby (~> 1.0, >= 1.3.1)
75
+ connection_pool (>= 2.2.5)
76
+ drb
77
+ i18n (>= 1.6, < 2)
78
+ logger (>= 1.4.2)
79
+ minitest (>= 5.1)
80
+ securerandom (>= 0.3)
81
+ tzinfo (~> 2.0, >= 2.0.5)
82
+ uri (>= 0.13.1)
83
+ ammeter (1.1.7)
84
+ activesupport (>= 3.0)
85
+ railties (>= 3.0)
86
+ rspec-rails (>= 2.2)
87
+ ast (2.4.3)
88
+ base64 (0.3.0)
89
+ benchmark (0.5.0)
90
+ bigdecimal (4.0.1)
91
+ builder (3.3.0)
92
+ bundler-audit (0.9.3)
93
+ bundler (>= 1.2.0)
94
+ thor (~> 1.0)
95
+ concurrent-ruby (1.3.6)
96
+ connection_pool (3.0.2)
97
+ crass (1.0.6)
98
+ database_cleaner (2.1.0)
99
+ database_cleaner-active_record (>= 2, < 3)
100
+ database_cleaner-active_record (2.2.2)
101
+ activerecord (>= 5.a)
102
+ database_cleaner-core (~> 2.0)
103
+ database_cleaner-core (2.0.1)
104
+ date (3.5.1)
105
+ debug (1.11.1)
106
+ irb (~> 1.10)
107
+ reline (>= 0.3.8)
108
+ diff-lcs (1.6.2)
109
+ drb (2.2.3)
110
+ erb (6.0.1)
111
+ erubi (1.13.1)
112
+ globalid (1.3.0)
113
+ activesupport (>= 6.1)
114
+ i18n (1.14.8)
115
+ concurrent-ruby (~> 1.0)
116
+ io-console (0.8.2)
117
+ irb (1.16.0)
118
+ pp (>= 0.6.0)
119
+ rdoc (>= 4.0.0)
120
+ reline (>= 0.4.2)
121
+ json (2.13.2)
122
+ language_server-protocol (3.17.0.5)
123
+ lint_roller (1.1.0)
124
+ logger (1.7.0)
125
+ loofah (2.25.0)
126
+ crass (~> 1.0.2)
127
+ nokogiri (>= 1.12.0)
128
+ mail (2.9.0)
129
+ logger
130
+ mini_mime (>= 0.1.1)
131
+ net-imap
132
+ net-pop
133
+ net-smtp
134
+ marcel (1.1.0)
135
+ mini_mime (1.1.5)
136
+ minitest (6.0.1)
137
+ prism (~> 1.5)
138
+ net-imap (0.6.2)
139
+ date
140
+ net-protocol
141
+ net-pop (0.1.2)
142
+ net-protocol
143
+ net-protocol (0.2.2)
144
+ timeout
145
+ net-smtp (0.5.1)
146
+ net-protocol
147
+ nio4r (2.7.5)
148
+ nokogiri (1.19.0-aarch64-linux-gnu)
149
+ racc (~> 1.4)
150
+ nokogiri (1.19.0-aarch64-linux-musl)
151
+ racc (~> 1.4)
152
+ nokogiri (1.19.0-arm-linux-gnu)
153
+ racc (~> 1.4)
154
+ nokogiri (1.19.0-arm-linux-musl)
155
+ racc (~> 1.4)
156
+ nokogiri (1.19.0-arm64-darwin)
157
+ racc (~> 1.4)
158
+ nokogiri (1.19.0-x86_64-darwin)
159
+ racc (~> 1.4)
160
+ nokogiri (1.19.0-x86_64-linux-gnu)
161
+ racc (~> 1.4)
162
+ nokogiri (1.19.0-x86_64-linux-musl)
163
+ racc (~> 1.4)
164
+ parallel (1.27.0)
165
+ parser (3.3.9.0)
166
+ ast (~> 2.4.1)
167
+ racc
168
+ pg (1.6.1)
169
+ pg (1.6.1-aarch64-linux)
170
+ pg (1.6.1-aarch64-linux-musl)
171
+ pg (1.6.1-arm64-darwin)
172
+ pg (1.6.1-x86_64-darwin)
173
+ pg (1.6.1-x86_64-linux)
174
+ pg (1.6.1-x86_64-linux-musl)
175
+ pp (0.6.3)
176
+ prettyprint
177
+ prettyprint (0.2.0)
178
+ prism (1.7.0)
179
+ psych (5.3.1)
180
+ date
181
+ stringio
182
+ racc (1.8.1)
183
+ rack (3.2.4)
184
+ rack-session (2.1.1)
185
+ base64 (>= 0.1.0)
186
+ rack (>= 3.0.0)
187
+ rack-test (2.2.0)
188
+ rack (>= 1.3)
189
+ rackup (2.3.1)
190
+ rack (>= 3)
191
+ rails (8.0.2.1)
192
+ actioncable (= 8.0.2.1)
193
+ actionmailbox (= 8.0.2.1)
194
+ actionmailer (= 8.0.2.1)
195
+ actionpack (= 8.0.2.1)
196
+ actiontext (= 8.0.2.1)
197
+ actionview (= 8.0.2.1)
198
+ activejob (= 8.0.2.1)
199
+ activemodel (= 8.0.2.1)
200
+ activerecord (= 8.0.2.1)
201
+ activestorage (= 8.0.2.1)
202
+ activesupport (= 8.0.2.1)
203
+ bundler (>= 1.15.0)
204
+ railties (= 8.0.2.1)
205
+ rails-dom-testing (2.3.0)
206
+ activesupport (>= 5.0.0)
207
+ minitest
208
+ nokogiri (>= 1.6)
209
+ rails-html-sanitizer (1.6.2)
210
+ loofah (~> 2.21)
211
+ 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)
212
+ railties (8.0.2.1)
213
+ actionpack (= 8.0.2.1)
214
+ activesupport (= 8.0.2.1)
215
+ irb (~> 1.13)
216
+ rackup (>= 1.0.0)
217
+ rake (>= 12.2)
218
+ thor (~> 1.0, >= 1.2.2)
219
+ zeitwerk (~> 2.6)
220
+ rainbow (3.1.1)
221
+ rake (13.3.1)
222
+ rdoc (7.0.3)
223
+ erb
224
+ psych (>= 4.0.0)
225
+ tsort
226
+ regexp_parser (2.11.2)
227
+ reline (0.6.3)
228
+ io-console (~> 0.5)
229
+ rspec-core (3.13.5)
230
+ rspec-support (~> 3.13.0)
231
+ rspec-expectations (3.13.5)
232
+ diff-lcs (>= 1.2.0, < 2.0)
233
+ rspec-support (~> 3.13.0)
234
+ rspec-mocks (3.13.5)
235
+ diff-lcs (>= 1.2.0, < 2.0)
236
+ rspec-support (~> 3.13.0)
237
+ rspec-rails (8.0.2)
238
+ actionpack (>= 7.2)
239
+ activesupport (>= 7.2)
240
+ railties (>= 7.2)
241
+ rspec-core (~> 3.13)
242
+ rspec-expectations (~> 3.13)
243
+ rspec-mocks (~> 3.13)
244
+ rspec-support (~> 3.13)
245
+ rspec-support (3.13.6)
246
+ rubocop (1.75.8)
247
+ json (~> 2.3)
248
+ language_server-protocol (~> 3.17.0.2)
249
+ lint_roller (~> 1.1.0)
250
+ parallel (~> 1.10)
251
+ parser (>= 3.3.0.2)
252
+ rainbow (>= 2.2.2, < 4.0)
253
+ regexp_parser (>= 2.9.3, < 3.0)
254
+ rubocop-ast (>= 1.44.0, < 2.0)
255
+ ruby-progressbar (~> 1.7)
256
+ unicode-display_width (>= 2.4.0, < 4.0)
257
+ rubocop-ast (1.46.0)
258
+ parser (>= 3.3.7.2)
259
+ prism (~> 1.4)
260
+ rubocop-performance (1.25.0)
261
+ lint_roller (~> 1.1)
262
+ rubocop (>= 1.75.0, < 2.0)
263
+ rubocop-ast (>= 1.38.0, < 2.0)
264
+ ruby-progressbar (1.13.0)
265
+ scenic (1.9.0)
266
+ activerecord (>= 4.0.0)
267
+ railties (>= 4.0.0)
268
+ securerandom (0.4.1)
269
+ standard (1.50.0)
270
+ language_server-protocol (~> 3.17.0.2)
271
+ lint_roller (~> 1.0)
272
+ rubocop (~> 1.75.5)
273
+ standard-custom (~> 1.0.0)
274
+ standard-performance (~> 1.8)
275
+ standard-custom (1.0.2)
276
+ lint_roller (~> 1.0)
277
+ rubocop (~> 1.50)
278
+ standard-performance (1.8.0)
279
+ lint_roller (~> 1.1)
280
+ rubocop-performance (~> 1.25.0)
281
+ standardrb (1.0.1)
282
+ standard
283
+ stringio (3.2.0)
284
+ thor (1.5.0)
285
+ timeout (0.6.0)
286
+ tsort (0.2.0)
287
+ tzinfo (2.0.6)
288
+ concurrent-ruby (~> 1.0)
289
+ unicode-display_width (3.1.5)
290
+ unicode-emoji (~> 4.0, >= 4.0.4)
291
+ unicode-emoji (4.0.4)
292
+ uri (1.1.1)
293
+ useragent (0.16.11)
294
+ websocket-driver (0.8.0)
295
+ base64
296
+ websocket-extensions (>= 0.1.0)
297
+ websocket-extensions (0.1.5)
298
+ zeitwerk (2.7.4)
299
+
300
+ PLATFORMS
301
+ aarch64-linux
302
+ aarch64-linux-gnu
303
+ aarch64-linux-musl
304
+ arm-linux-gnu
305
+ arm-linux-musl
306
+ arm64-darwin
307
+ x86_64-darwin
308
+ x86_64-linux
309
+ x86_64-linux-gnu
310
+ x86_64-linux-musl
311
+
312
+ DEPENDENCIES
313
+ ammeter
314
+ bundler-audit (>= 0.7.0)
315
+ database_cleaner
316
+ debug
317
+ michel!
318
+ pg (~> 1.1)
319
+ rails (~> 8.0.2, >= 8.0.2.1)
320
+ rake (~> 13.0)
321
+ scenic
322
+ standardrb
323
+
324
+ BUNDLED WITH
325
+ 2.6.4
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) Sally Hall and thoughtbot, inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # Michel
2
+
3
+ Find available time slots quickly with a materialized view.
4
+
5
+ ## Usage
6
+
7
+ ### Install Michel
8
+ In order to run the migrations, you must also install Scenic. Add to your gemfile:
9
+
10
+ ```
11
+ gem "michel"
12
+ gem "scenic"
13
+ ```
14
+
15
+ Run `bundle install`, then `rails generate michel:install`
16
+
17
+ ### Configure
18
+ Configure the class names in `config/initializers/michel.rb`
19
+
20
+ Michel expects three classes to exist in the application:
21
+ * Resource Class
22
+ * The resource that is occupied by a booking, ex: Physician, Room, Instructor.
23
+ * This resource is assumed to be available for only one booking at a time. A resource has many bookings and many availabilities.
24
+
25
+ * Booking Class
26
+ * The event that is scheduled for a resource, ex: Appointment.
27
+ * The resource is unavailable for the duration of the booking.
28
+ * It is required to have the following attributes:
29
+ * `start_time` - a DateTime indicating the start time of the booking.
30
+ * `duration` - an integer representing the number of minutes the booking lasts.
31
+ * a reference to the id of the resource class
32
+ * The booking class is also used to block off unavailable times. It is recommended that you have a booking type to distinguish between appointments and other events.
33
+ * Availability Class
34
+ * The weekly schedule during which a resource is available for a booking
35
+ * It is required to have the following attributes:
36
+ * `timezone` - a string representing the time zone in which the availability is configured, ex: 'UTC'
37
+ * `weekday` - an integer representing the weekday, starting with Monday = 1
38
+ * `start_time` - a string representing the beginning time of the availability in the configured timezone in 24-hour format, ex: '09:00'
39
+ * `end_time` - a string representing the end time of the availability in the configured timezone in 24-hour format, ex: '017:00'
40
+ * a reference to the id of the resource class
41
+ * There should be one availability record for each continuous block of available time during a week. For example, if a resource is available from 9-5, M-Th, with a 1 hour break from 12-1, that is represented by eight availabilities: one for each day from 9-12 and another for each day from 1-5.
42
+
43
+
44
+ ### Run the generator
45
+ To generate the database view and necessary supporting code, run `rails generate michel:view`. This will:
46
+
47
+ 1. Generate a migration to add an index to the booking class table on the resource id and start_time.
48
+ 2. Generate a Scenic model for available time slots.
49
+ 3. Generate a sql file with the view to back the scenic model.
50
+ 4. Insert associations between the existing classes and the generated `AvailableTimeSlot` class.
51
+
52
+ Once the generator is finished, run `rails db:migrate` to run the generated migrations.
53
+
54
+ ### Start Scheduling.
55
+ To find available time slots, search for matching `AvailableTimeSlots`. Each slot has a `start_time` and an `end_time` and belongs to an `availability` and a `resource`.
56
+
57
+ To refresh the materialized view, run `AvailableTimeSlot.refresh`. The view should be refreshed when a booking is created, updated, or deleted, or when availability changes.
58
+
59
+ ## Contributing
60
+
61
+ See the [CONTRIBUTING] document.
62
+ Thank you, [contributors]!
63
+
64
+ [CONTRIBUTING]: CONTRIBUTING.md
65
+ [contributors]: https://github.com/thoughtbot/michel/graphs/contributors
66
+
67
+ ## License
68
+
69
+ Michel is Copyright (c) thoughtbot, inc.
70
+ It is free software, and may be redistributed
71
+ under the terms specified in the [LICENSE] file.
72
+
73
+ [LICENSE]: /LICENSE
74
+
75
+ <!-- START /templates/footer.md -->
76
+ <!-- END /templates/footer.md -->
data/RELEASING.md ADDED
@@ -0,0 +1,43 @@
1
+ # Releasing
2
+
3
+ ## 1. Update version file accordingly
4
+
5
+ Include an RC (release candidate) number if appropriate, e.g. 2.0.0.rc.
6
+
7
+ ## 2. Update `CHANGELOG.md` to reflect the changes since last release
8
+
9
+ You can copy [GitHub automatically generated release notes] for this step.
10
+
11
+ ## 3. Commit changes
12
+
13
+ There shouldn't be code changes, and thus CI doesn't need to run. Add "[ci skip]" to the commit message.
14
+
15
+ ## 4. Tag the release: `git tag -s vVERSION`
16
+
17
+ We recommend the [_quick guide on how to sign a release_] from git ready.
18
+
19
+ ## 5. Push changes
20
+
21
+ Push the changes with `git push --tags`
22
+
23
+ ## 6. Build and publish
24
+
25
+ ```bash
26
+ gem build project-name.gemspec
27
+ gem push project-name-*.gem
28
+ ```
29
+
30
+ If the project is hosted on RubyGems, consider using [RubyGems Trusted Publication] to automatically
31
+ push the release using a GitHub action.
32
+
33
+ ## 7. Add a new GitHub release using the recent `CHANGELOG.md` as the content
34
+
35
+ Sample URL: https://github.com/thoughtbot/project-name/releases/new?tag=vVERSION
36
+
37
+ ## 8. Announce the new release
38
+
39
+ Make sure to say "thank you" to the contributors who helped shape this version!
40
+
41
+ [RubyGems Trusted Publication]: https://github.com/rubygems/release-gem
42
+ [_quick guide on how to sign a release_]: https://gitready.com/advanced/2014/11/02/gpg-sign-releases.html
43
+ [GitHub automatically generated release notes]: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#about-automatically-generated-release-notes
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "standard/rake"
9
+
10
+ task default: %i[spec standard]