C'est l'heure d'assurer le suivi de quelques flacons!

Commit
fea9476a591559bd8fdcf17b64e5114c592a5b08
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
Changed files
.dockerignore
index 00000000..cd7190b4 000000..100644
@@ -0,0 +1,48 @@
1 Added: # See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
2 Added:
3 Added: # Ignore git directory.
4 Added: /.git/
5 Added: /.gitignore
6 Added:
7 Added: # Ignore bundler config.
8 Added: /.bundle
9 Added:
10 Added: # Ignore all environment files (except templates).
11 Added: /.env*
12 Added: !/.env*.erb
13 Added:
14 Added: # Ignore all default key files.
15 Added: /config/master.key
16 Added: /config/credentials/*.key
17 Added:
18 Added: # Ignore all logfiles and tempfiles.
19 Added: /log/*
20 Added: /tmp/*
21 Added: !/log/.keep
22 Added: !/tmp/.keep
23 Added:
24 Added: # Ignore pidfiles, but keep the directory.
25 Added: /tmp/pids/*
26 Added: !/tmp/pids/.keep
27 Added:
28 Added: # Ignore storage (uploaded files in development and any SQLite databases).
29 Added: /storage/*
30 Added: !/storage/.keep
31 Added: /tmp/storage/*
32 Added: !/tmp/storage/.keep
33 Added:
34 Added: # Ignore assets.
35 Added: /node_modules/
36 Added: /app/assets/builds/*
37 Added: !/app/assets/builds/.keep
38 Added: /public/assets
39 Added:
40 Added: # Ignore CI service files.
41 Added: /.github
42 Added:
43 Added: # Ignore development files
44 Added: /.devcontainer
45 Added:
46 Added: # Ignore Docker-related files
47 Added: /.dockerignore
48 Added: /Dockerfile*
.gitattributes
index 00000000..8dc43234 000000..100644
@@ -0,0 +1,9 @@
1 Added: # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2 Added:
3 Added: # Mark the database schema as having been generated.
4 Added: db/schema.rb linguist-generated
5 Added:
6 Added: # Mark any vendored files as having been vendored.
7 Added: vendor/* linguist-vendored
8 Added: config/credentials/*.yml.enc diff=rails_credentials
9 Added: config/credentials.yml.enc diff=rails_credentials
.gitignore
index 00000000..4aaf1022 000000..100644
@@ -0,0 +1,35 @@
1 Added: # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2 Added: #
3 Added: # Temporary files generated by your text editor or operating system
4 Added: # belong in git's global ignore instead:
5 Added: # `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
6 Added:
7 Added: # Ignore bundler config.
8 Added: /.bundle
9 Added:
10 Added: # Ignore all environment files (except templates).
11 Added: /.env*
12 Added: !/.env*.erb
13 Added:
14 Added: # Ignore all logfiles and tempfiles.
15 Added: /log/*
16 Added: /tmp/*
17 Added: !/log/.keep
18 Added: !/tmp/.keep
19 Added:
20 Added: # Ignore pidfiles, but keep the directory.
21 Added: /tmp/pids/*
22 Added: !/tmp/pids/
23 Added: !/tmp/pids/.keep
24 Added:
25 Added: # Ignore storage (uploaded files in development and any SQLite databases).
26 Added: /storage/*
27 Added: !/storage/.keep
28 Added: /tmp/storage/*
29 Added: !/tmp/storage/
30 Added: !/tmp/storage/.keep
31 Added:
32 Added: /public/assets
33 Added:
34 Added: # Ignore master key for decrypting credentials and more.
35 Added: /config/master.key
.rubocop.yml
index 00000000..f9d86d4a 000000..100644
@@ -0,0 +1,8 @@
1 Added: # Omakase Ruby styling for Rails
2 Added: inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3 Added:
4 Added: # Overwrite or add rules to create your own house style
5 Added: #
6 Added: # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7 Added: # Layout/SpaceInsideArrayLiteralBrackets:
8 Added: # Enabled: false
.ruby-version
index 00000000..f13c6f45 000000..100644
@@ -0,0 +1,1 @@
1 Added: ruby-3.3.5
Dockerfile
index 00000000..29b442ef 000000..100644
@@ -0,0 +1,69 @@
1 Added: # syntax = docker/dockerfile:1
2 Added:
3 Added: # This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand:
4 Added: # docker build -t my-app .
5 Added: # docker run -d -p 80:80 -p 443:443 --name my-app -e RAILS_MASTER_KEY=<value from config/master.key> my-app
6 Added:
7 Added: # Make sure RUBY_VERSION matches the Ruby version in .ruby-version
8 Added: ARG RUBY_VERSION=3.3.5
9 Added: FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
10 Added:
11 Added: # Rails app lives here
12 Added: WORKDIR /rails
13 Added:
14 Added: # Install base packages
15 Added: RUN apt-get update -qq && \
16 Added: apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \
17 Added: rm -rf /var/lib/apt/lists /var/cache/apt/archives
18 Added:
19 Added: # Set production environment
20 Added: ENV RAILS_ENV="production" \
21 Added: BUNDLE_DEPLOYMENT="1" \
22 Added: BUNDLE_PATH="/usr/local/bundle" \
23 Added: BUNDLE_WITHOUT="development"
24 Added:
25 Added: # Throw-away build stage to reduce size of final image
26 Added: FROM base AS build
27 Added:
28 Added: # Install packages needed to build gems
29 Added: RUN apt-get update -qq && \
30 Added: apt-get install --no-install-recommends -y build-essential git pkg-config && \
31 Added: rm -rf /var/lib/apt/lists /var/cache/apt/archives
32 Added:
33 Added: # Install application gems
34 Added: COPY Gemfile Gemfile.lock ./
35 Added: RUN bundle install && \
36 Added: rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
37 Added: bundle exec bootsnap precompile --gemfile
38 Added:
39 Added: # Copy application code
40 Added: COPY . .
41 Added:
42 Added: # Precompile bootsnap code for faster boot times
43 Added: RUN bundle exec bootsnap precompile app/ lib/
44 Added:
45 Added: # Precompiling assets for production without requiring secret RAILS_MASTER_KEY
46 Added: RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
47 Added:
48 Added:
49 Added:
50 Added:
51 Added: # Final stage for app image
52 Added: FROM base
53 Added:
54 Added: # Copy built artifacts: gems, application
55 Added: COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
56 Added: COPY --from=build /rails /rails
57 Added:
58 Added: # Run and own only the runtime files as a non-root user for security
59 Added: RUN groupadd --system --gid 1000 rails && \
60 Added: useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
61 Added: chown -R rails:rails db log storage tmp
62 Added: USER 1000:1000
63 Added:
64 Added: # Entrypoint prepares the database.
65 Added: ENTRYPOINT ["/rails/bin/docker-entrypoint"]
66 Added:
67 Added: # Start the server by default, this can be overwritten at runtime
68 Added: EXPOSE 3000
69 Added: CMD ["./bin/rails", "server"]
Gemfile
index 00000000..f7fc2f49 000000..100644
@@ -0,0 +1,57 @@
1 Added: source "https://rubygems.org"
2 Added:
3 Added: # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4 Added: gem "rails", "~> 7.2.1"
5 Added: # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
6 Added: gem "sprockets-rails"
7 Added: # Use sqlite3 as the database for Active Record
8 Added: gem "sqlite3", ">= 1.4"
9 Added: # Use the Puma web server [https://github.com/puma/puma]
10 Added: gem "puma", ">= 5.0"
11 Added: # Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
12 Added: gem "importmap-rails"
13 Added: # Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
14 Added: gem "turbo-rails"
15 Added: # Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
16 Added: gem "stimulus-rails"
17 Added: # Build JSON APIs with ease [https://github.com/rails/jbuilder]
18 Added: gem "jbuilder"
19 Added: # Use Redis adapter to run Action Cable in production
20 Added: # gem "redis", ">= 4.0.1"
21 Added:
22 Added: # Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
23 Added: # gem "kredis"
24 Added:
25 Added: # Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
26 Added: # gem "bcrypt", "~> 3.1.7"
27 Added:
28 Added: # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
29 Added: gem "tzinfo-data", platforms: %i[ windows jruby ]
30 Added:
31 Added: # Reduces boot times through caching; required in config/boot.rb
32 Added: gem "bootsnap", require: false
33 Added:
34 Added: # Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
35 Added: # gem "image_processing", "~> 1.2"
36 Added:
37 Added: group :development, :test do
38 Added: # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
39 Added: gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
40 Added:
41 Added: # Static analysis for security vulnerabilities [https://brakemanscanner.org/]
42 Added: gem "brakeman", require: false
43 Added:
44 Added: # Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
45 Added: gem "rubocop-rails-omakase", require: false
46 Added: end
47 Added:
48 Added: group :development do
49 Added: # Use console on exceptions pages [https://github.com/rails/web-console]
50 Added: gem "web-console"
51 Added: end
52 Added:
53 Added: group :test do
54 Added: # Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
55 Added: gem "capybara"
56 Added: gem "selenium-webdriver"
57 Added: end
Gemfile.lock
index 00000000..a3dc534e 000000..100644
@@ -0,0 +1,325 @@
1 Added: GEM
2 Added: remote: https://rubygems.org/
3 Added: specs:
4 Added: actioncable (7.2.1.1)
5 Added: actionpack (= 7.2.1.1)
6 Added: activesupport (= 7.2.1.1)
7 Added: nio4r (~> 2.0)
8 Added: websocket-driver (>= 0.6.1)
9 Added: zeitwerk (~> 2.6)
10 Added: actionmailbox (7.2.1.1)
11 Added: actionpack (= 7.2.1.1)
12 Added: activejob (= 7.2.1.1)
13 Added: activerecord (= 7.2.1.1)
14 Added: activestorage (= 7.2.1.1)
15 Added: activesupport (= 7.2.1.1)
16 Added: mail (>= 2.8.0)
17 Added: actionmailer (7.2.1.1)
18 Added: actionpack (= 7.2.1.1)
19 Added: actionview (= 7.2.1.1)
20 Added: activejob (= 7.2.1.1)
21 Added: activesupport (= 7.2.1.1)
22 Added: mail (>= 2.8.0)
23 Added: rails-dom-testing (~> 2.2)
24 Added: actionpack (7.2.1.1)
25 Added: actionview (= 7.2.1.1)
26 Added: activesupport (= 7.2.1.1)
27 Added: nokogiri (>= 1.8.5)
28 Added: racc
29 Added: rack (>= 2.2.4, < 3.2)
30 Added: rack-session (>= 1.0.1)
31 Added: rack-test (>= 0.6.3)
32 Added: rails-dom-testing (~> 2.2)
33 Added: rails-html-sanitizer (~> 1.6)
34 Added: useragent (~> 0.16)
35 Added: actiontext (7.2.1.1)
36 Added: actionpack (= 7.2.1.1)
37 Added: activerecord (= 7.2.1.1)
38 Added: activestorage (= 7.2.1.1)
39 Added: activesupport (= 7.2.1.1)
40 Added: globalid (>= 0.6.0)
41 Added: nokogiri (>= 1.8.5)
42 Added: actionview (7.2.1.1)
43 Added: activesupport (= 7.2.1.1)
44 Added: builder (~> 3.1)
45 Added: erubi (~> 1.11)
46 Added: rails-dom-testing (~> 2.2)
47 Added: rails-html-sanitizer (~> 1.6)
48 Added: activejob (7.2.1.1)
49 Added: activesupport (= 7.2.1.1)
50 Added: globalid (>= 0.3.6)
51 Added: activemodel (7.2.1.1)
52 Added: activesupport (= 7.2.1.1)
53 Added: activerecord (7.2.1.1)
54 Added: activemodel (= 7.2.1.1)
55 Added: activesupport (= 7.2.1.1)
56 Added: timeout (>= 0.4.0)
57 Added: activestorage (7.2.1.1)
58 Added: actionpack (= 7.2.1.1)
59 Added: activejob (= 7.2.1.1)
60 Added: activerecord (= 7.2.1.1)
61 Added: activesupport (= 7.2.1.1)
62 Added: marcel (~> 1.0)
63 Added: activesupport (7.2.1.1)
64 Added: base64
65 Added: bigdecimal
66 Added: concurrent-ruby (~> 1.0, >= 1.3.1)
67 Added: connection_pool (>= 2.2.5)
68 Added: drb
69 Added: i18n (>= 1.6, < 2)
70 Added: logger (>= 1.4.2)
71 Added: minitest (>= 5.1)
72 Added: securerandom (>= 0.3)
73 Added: tzinfo (~> 2.0, >= 2.0.5)
74 Added: addressable (2.8.7)
75 Added: public_suffix (>= 2.0.2, < 7.0)
76 Added: ast (2.4.2)
77 Added: base64 (0.2.0)
78 Added: bigdecimal (3.1.8)
79 Added: bindex (0.8.1)
80 Added: bootsnap (1.18.4)
81 Added: msgpack (~> 1.2)
82 Added: brakeman (6.2.2)
83 Added: racc
84 Added: builder (3.3.0)
85 Added: capybara (3.40.0)
86 Added: addressable
87 Added: matrix
88 Added: mini_mime (>= 0.1.3)
89 Added: nokogiri (~> 1.11)
90 Added: rack (>= 1.6.0)
91 Added: rack-test (>= 0.6.3)
92 Added: regexp_parser (>= 1.5, < 3.0)
93 Added: xpath (~> 3.2)
94 Added: concurrent-ruby (1.3.4)
95 Added: connection_pool (2.4.1)
96 Added: crass (1.0.6)
97 Added: date (3.3.4)
98 Added: debug (1.9.2)
99 Added: irb (~> 1.10)
100 Added: reline (>= 0.3.8)
101 Added: drb (2.2.1)
102 Added: erubi (1.13.0)
103 Added: globalid (1.2.1)
104 Added: activesupport (>= 6.1)
105 Added: i18n (1.14.6)
106 Added: concurrent-ruby (~> 1.0)
107 Added: importmap-rails (2.0.3)
108 Added: actionpack (>= 6.0.0)
109 Added: activesupport (>= 6.0.0)
110 Added: railties (>= 6.0.0)
111 Added: io-console (0.7.2)
112 Added: irb (1.14.1)
113 Added: rdoc (>= 4.0.0)
114 Added: reline (>= 0.4.2)
115 Added: jbuilder (2.13.0)
116 Added: actionview (>= 5.0.0)
117 Added: activesupport (>= 5.0.0)
118 Added: json (2.7.2)
119 Added: language_server-protocol (3.17.0.3)
120 Added: logger (1.6.1)
121 Added: loofah (2.22.0)
122 Added: crass (~> 1.0.2)
123 Added: nokogiri (>= 1.12.0)
124 Added: mail (2.8.1)
125 Added: mini_mime (>= 0.1.1)
126 Added: net-imap
127 Added: net-pop
128 Added: net-smtp
129 Added: marcel (1.0.4)
130 Added: matrix (0.4.2)
131 Added: mini_mime (1.1.5)
132 Added: minitest (5.25.1)
133 Added: msgpack (1.7.3)
134 Added: net-imap (0.5.0)
135 Added: date
136 Added: net-protocol
137 Added: net-pop (0.1.2)
138 Added: net-protocol
139 Added: net-protocol (0.2.2)
140 Added: timeout
141 Added: net-smtp (0.5.0)
142 Added: net-protocol
143 Added: nio4r (2.7.3)
144 Added: nokogiri (1.16.7-aarch64-linux)
145 Added: racc (~> 1.4)
146 Added: nokogiri (1.16.7-arm-linux)
147 Added: racc (~> 1.4)
148 Added: nokogiri (1.16.7-arm64-darwin)
149 Added: racc (~> 1.4)
150 Added: nokogiri (1.16.7-x86-linux)
151 Added: racc (~> 1.4)
152 Added: nokogiri (1.16.7-x86_64-darwin)
153 Added: racc (~> 1.4)
154 Added: nokogiri (1.16.7-x86_64-linux)
155 Added: racc (~> 1.4)
156 Added: parallel (1.26.3)
157 Added: parser (3.3.5.0)
158 Added: ast (~> 2.4.1)
159 Added: racc
160 Added: psych (5.1.2)
161 Added: stringio
162 Added: public_suffix (6.0.1)
163 Added: puma (6.4.3)
164 Added: nio4r (~> 2.0)
165 Added: racc (1.8.1)
166 Added: rack (3.1.8)
167 Added: rack-session (2.0.0)
168 Added: rack (>= 3.0.0)
169 Added: rack-test (2.1.0)
170 Added: rack (>= 1.3)
171 Added: rackup (2.1.0)
172 Added: rack (>= 3)
173 Added: webrick (~> 1.8)
174 Added: rails (7.2.1.1)
175 Added: actioncable (= 7.2.1.1)
176 Added: actionmailbox (= 7.2.1.1)
177 Added: actionmailer (= 7.2.1.1)
178 Added: actionpack (= 7.2.1.1)
179 Added: actiontext (= 7.2.1.1)
180 Added: actionview (= 7.2.1.1)
181 Added: activejob (= 7.2.1.1)
182 Added: activemodel (= 7.2.1.1)
183 Added: activerecord (= 7.2.1.1)
184 Added: activestorage (= 7.2.1.1)
185 Added: activesupport (= 7.2.1.1)
186 Added: bundler (>= 1.15.0)
187 Added: railties (= 7.2.1.1)
188 Added: rails-dom-testing (2.2.0)
189 Added: activesupport (>= 5.0.0)
190 Added: minitest
191 Added: nokogiri (>= 1.6)
192 Added: rails-html-sanitizer (1.6.0)
193 Added: loofah (~> 2.21)
194 Added: nokogiri (~> 1.14)
195 Added: railties (7.2.1.1)
196 Added: actionpack (= 7.2.1.1)
197 Added: activesupport (= 7.2.1.1)
198 Added: irb (~> 1.13)
199 Added: rackup (>= 1.0.0)
200 Added: rake (>= 12.2)
201 Added: thor (~> 1.0, >= 1.2.2)
202 Added: zeitwerk (~> 2.6)
203 Added: rainbow (3.1.1)
204 Added: rake (13.2.1)
205 Added: rdoc (6.7.0)
206 Added: psych (>= 4.0.0)
207 Added: regexp_parser (2.9.2)
208 Added: reline (0.5.10)
209 Added: io-console (~> 0.5)
210 Added: rexml (3.3.8)
211 Added: rubocop (1.67.0)
212 Added: json (~> 2.3)
213 Added: language_server-protocol (>= 3.17.0)
214 Added: parallel (~> 1.10)
215 Added: parser (>= 3.3.0.2)
216 Added: rainbow (>= 2.2.2, < 4.0)
217 Added: regexp_parser (>= 2.4, < 3.0)
218 Added: rubocop-ast (>= 1.32.2, < 2.0)
219 Added: ruby-progressbar (~> 1.7)
220 Added: unicode-display_width (>= 2.4.0, < 3.0)
221 Added: rubocop-ast (1.32.3)
222 Added: parser (>= 3.3.1.0)
223 Added: rubocop-minitest (0.36.0)
224 Added: rubocop (>= 1.61, < 2.0)
225 Added: rubocop-ast (>= 1.31.1, < 2.0)
226 Added: rubocop-performance (1.22.1)
227 Added: rubocop (>= 1.48.1, < 2.0)
228 Added: rubocop-ast (>= 1.31.1, < 2.0)
229 Added: rubocop-rails (2.26.2)
230 Added: activesupport (>= 4.2.0)
231 Added: rack (>= 1.1)
232 Added: rubocop (>= 1.52.0, < 2.0)
233 Added: rubocop-ast (>= 1.31.1, < 2.0)
234 Added: rubocop-rails-omakase (1.0.0)
235 Added: rubocop
236 Added: rubocop-minitest
237 Added: rubocop-performance
238 Added: rubocop-rails
239 Added: ruby-progressbar (1.13.0)
240 Added: rubyzip (2.3.2)
241 Added: securerandom (0.3.1)
242 Added: selenium-webdriver (4.25.0)
243 Added: base64 (~> 0.2)
244 Added: logger (~> 1.4)
245 Added: rexml (~> 3.2, >= 3.2.5)
246 Added: rubyzip (>= 1.2.2, < 3.0)
247 Added: websocket (~> 1.0)
248 Added: sprockets (4.2.1)
249 Added: concurrent-ruby (~> 1.0)
250 Added: rack (>= 2.2.4, < 4)
251 Added: sprockets-rails (3.5.2)
252 Added: actionpack (>= 6.1)
253 Added: activesupport (>= 6.1)
254 Added: sprockets (>= 3.0.0)
255 Added: sqlite3 (2.1.0-aarch64-linux-gnu)
256 Added: sqlite3 (2.1.0-aarch64-linux-musl)
257 Added: sqlite3 (2.1.0-arm-linux-gnu)
258 Added: sqlite3 (2.1.0-arm-linux-musl)
259 Added: sqlite3 (2.1.0-arm64-darwin)
260 Added: sqlite3 (2.1.0-x86-linux-gnu)
261 Added: sqlite3 (2.1.0-x86-linux-musl)
262 Added: sqlite3 (2.1.0-x86_64-darwin)
263 Added: sqlite3 (2.1.0-x86_64-linux-gnu)
264 Added: sqlite3 (2.1.0-x86_64-linux-musl)
265 Added: stimulus-rails (1.3.4)
266 Added: railties (>= 6.0.0)
267 Added: stringio (3.1.1)
268 Added: thor (1.3.2)
269 Added: timeout (0.4.1)
270 Added: turbo-rails (2.0.11)
271 Added: actionpack (>= 6.0.0)
272 Added: railties (>= 6.0.0)
273 Added: tzinfo (2.0.6)
274 Added: concurrent-ruby (~> 1.0)
275 Added: unicode-display_width (2.6.0)
276 Added: useragent (0.16.10)
277 Added: web-console (4.2.1)
278 Added: actionview (>= 6.0.0)
279 Added: activemodel (>= 6.0.0)
280 Added: bindex (>= 0.4.0)
281 Added: railties (>= 6.0.0)
282 Added: webrick (1.8.2)
283 Added: websocket (1.2.11)
284 Added: websocket-driver (0.7.6)
285 Added: websocket-extensions (>= 0.1.0)
286 Added: websocket-extensions (0.1.5)
287 Added: xpath (3.2.0)
288 Added: nokogiri (~> 1.8)
289 Added: zeitwerk (2.7.1)
290 Added:
291 Added: PLATFORMS
292 Added: aarch64-linux
293 Added: aarch64-linux-gnu
294 Added: aarch64-linux-musl
295 Added: arm-linux
296 Added: arm-linux-gnu
297 Added: arm-linux-musl
298 Added: arm64-darwin
299 Added: x86-linux
300 Added: x86-linux-gnu
301 Added: x86-linux-musl
302 Added: x86_64-darwin
303 Added: x86_64-linux-gnu
304 Added: x86_64-linux-musl
305 Added:
306 Added: DEPENDENCIES
307 Added: bootsnap
308 Added: brakeman
309 Added: capybara
310 Added: debug
311 Added: importmap-rails
312 Added: jbuilder
313 Added: puma (>= 5.0)
314 Added: rails (~> 7.2.1)
315 Added: rubocop-rails-omakase
316 Added: selenium-webdriver
317 Added: sprockets-rails
318 Added: sqlite3 (>= 1.4)
319 Added: stimulus-rails
320 Added: turbo-rails
321 Added: tzinfo-data
322 Added: web-console
323 Added:
324 Added: BUNDLED WITH
325 Added: 2.5.16
README.md
index 00000000..7db80e4c 000000..100644
@@ -0,0 +1,24 @@
1 Added: # README
2 Added:
3 Added: This README would normally document whatever steps are necessary to get the
4 Added: application up and running.
5 Added:
6 Added: Things you may want to cover:
7 Added:
8 Added: * Ruby version
9 Added:
10 Added: * System dependencies
11 Added:
12 Added: * Configuration
13 Added:
14 Added: * Database creation
15 Added:
16 Added: * Database initialization
17 Added:
18 Added: * How to run the test suite
19 Added:
20 Added: * Services (job queues, cache servers, search engines, etc.)
21 Added:
22 Added: * Deployment instructions
23 Added:
24 Added: * ...
Rakefile
index 00000000..9a5ea738 000000..100644
@@ -0,0 +1,6 @@
1 Added: # Add your own tasks in files placed in lib/tasks ending in .rake,
2 Added: # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3 Added:
4 Added: require_relative "config/application"
5 Added:
6 Added: Rails.application.load_tasks
app/assets/config/manifest.js
index 00000000..59181933 000000..100644
@@ -0,0 +1,2 @@
1 Added: //= link_tree ../images
2 Added: //= link_directory ../stylesheets .css
app/assets/images/.keep
index 00000000..e69de29b 000000..100644
app/assets/stylesheets/application.css
index 00000000..288b9ab7 000000..100644
@@ -0,0 +1,15 @@
1 Added: /*
2 Added: * This is a manifest file that'll be compiled into application.css, which will include all the files
3 Added: * listed below.
4 Added: *
5 Added: * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6 Added: * vendor/assets/stylesheets directory can be referenced here using a relative path.
7 Added: *
8 Added: * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9 Added: * compiled file so the styles you add here take precedence over styles defined in any other CSS
10 Added: * files in this directory. Styles in this file should be added after the last require_* statement.
11 Added: * It is generally better to create a new file per style scope.
12 Added: *
13 Added: *= require_tree .
14 Added: *= require_self
15 Added: */
app/channels/application_cable/channel.rb
index 00000000..d6726972 000000..100644
@@ -0,0 +1,4 @@
1 Added: module ApplicationCable
2 Added: class Channel < ActionCable::Channel::Base
3 Added: end
4 Added: end
app/channels/application_cable/connection.rb
index 00000000..0ff5442f 000000..100644
@@ -0,0 +1,4 @@
1 Added: module ApplicationCable
2 Added: class Connection < ActionCable::Connection::Base
3 Added: end
4 Added: end
app/controllers/application_controller.rb
index 00000000..0d95db22 000000..100644
@@ -0,0 +1,4 @@
1 Added: class ApplicationController < ActionController::Base
2 Added: # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3 Added: allow_browser versions: :modern
4 Added: end
app/controllers/concerns/.keep
index 00000000..e69de29b 000000..100644
app/controllers/wines_controller.rb
index 00000000..9129dee5 000000..100644
@@ -0,0 +1,49 @@
1 Added: class WinesController < ApplicationController
2 Added: def index
3 Added: @wines = Wine.all
4 Added: end
5 Added:
6 Added: def show
7 Added: @wine = Wine.find(params[:id])
8 Added: end
9 Added:
10 Added: def new
11 Added: @wine = Wine.new
12 Added: end
13 Added:
14 Added: def create
15 Added: @wine = Wine.new(wine_params)
16 Added:
17 Added: if @wine.save
18 Added: redirect_to @wine
19 Added: else
20 Added: render :new, status: :unprocessable_entity
21 Added: end
22 Added: end
23 Added:
24 Added: def edit
25 Added: @wine = Wine.find(params[:id])
26 Added: end
27 Added:
28 Added: def update
29 Added: @wine = Wine.find(params[:id])
30 Added:
31 Added: if @wine.update(wine_params)
32 Added: redirect_to @wine
33 Added: else
34 Added: render :edit, status: :unprocessable_entity
35 Added: end
36 Added: end
37 Added:
38 Added: def destroy
39 Added: @wine = Wine.find(params[:id])
40 Added: @wine.destroy
41 Added:
42 Added: redirect_to root_path, status: :see_other
43 Added: end
44 Added:
45 Added: private
46 Added: def wine_params
47 Added: params.require(:wine).permit(:name, :year, :variety, :notes)
48 Added: end
49 Added: end
app/helpers/application_helper.rb
index 00000000..de6be794 000000..100644
@@ -0,0 +1,2 @@
1 Added: module ApplicationHelper
2 Added: end
app/helpers/wines_helper.rb
index 00000000..bb7bcfca 000000..100644
@@ -0,0 +1,2 @@
1 Added: module WinesHelper
2 Added: end
app/jobs/application_job.rb
index 00000000..d394c3d1 000000..100644
@@ -0,0 +1,7 @@
1 Added: class ApplicationJob < ActiveJob::Base
2 Added: # Automatically retry jobs that encountered a deadlock
3 Added: # retry_on ActiveRecord::Deadlocked
4 Added:
5 Added: # Most jobs are safe to ignore if the underlying records are no longer available
6 Added: # discard_on ActiveJob::DeserializationError
7 Added: end
app/mailers/application_mailer.rb
index 00000000..3c34c814 000000..100644
@@ -0,0 +1,4 @@
1 Added: class ApplicationMailer < ActionMailer::Base
2 Added: default from: "from@example.com"
3 Added: layout "mailer"
4 Added: end
app/models/application_record.rb
index 00000000..b63caeb8 000000..100644
@@ -0,0 +1,3 @@
1 Added: class ApplicationRecord < ActiveRecord::Base
2 Added: primary_abstract_class
3 Added: end
app/models/concerns/.keep
index 00000000..e69de29b 000000..100644
app/models/wine.rb
index 00000000..a47022ee 000000..100644
@@ -0,0 +1,4 @@
1 Added: class Wine < ApplicationRecord
2 Added: validates :name, presence: true
3 Added: validates :year, presence: true
4 Added: end
app/views/layouts/application.html.erb
index 00000000..ef26703c 000000..100644
@@ -0,0 +1,22 @@
1 Added: <!DOCTYPE html>
2 Added: <html>
3 Added: <head>
4 Added: <title><%= content_for(:title) || "Flacon" %></title>
5 Added: <meta name="viewport" content="width=device-width,initial-scale=1">
6 Added: <meta name="apple-mobile-web-app-capable" content="yes">
7 Added: <%= csrf_meta_tags %>
8 Added: <%= csp_meta_tag %>
9 Added:
10 Added: <%= yield :head %>
11 Added:
12 Added: <link rel="manifest" href="/manifest.json">
13 Added: <link rel="icon" href="/icon.png" type="image/png">
14 Added: <link rel="icon" href="/icon.svg" type="image/svg+xml">
15 Added: <link rel="apple-touch-icon" href="/icon.png">
16 Added: <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
17 Added: </head>
18 Added:
19 Added: <body>
20 Added: <%= yield %>
21 Added: </body>
22 Added: </html>
app/views/layouts/mailer.html.erb
index 00000000..3aac9002 000000..100644
@@ -0,0 +1,13 @@
1 Added: <!DOCTYPE html>
2 Added: <html>
3 Added: <head>
4 Added: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5 Added: <style>
6 Added: /* Email styles need to be inline */
7 Added: </style>
8 Added: </head>
9 Added:
10 Added: <body>
11 Added: <%= yield %>
12 Added: </body>
13 Added: </html>
app/views/layouts/mailer.text.erb
index 00000000..37f0bddb 000000..100644
@@ -0,0 +1,1 @@
1 Added: <%= yield %>
app/views/pwa/manifest.json.erb
index 00000000..7a1a68ba 000000..100644
@@ -0,0 +1,22 @@
1 Added: {
2 Added: "name": "Flacon",
3 Added: "icons": [
4 Added: {
5 Added: "src": "/icon.png",
6 Added: "type": "image/png",
7 Added: "sizes": "512x512"
8 Added: },
9 Added: {
10 Added: "src": "/icon.png",
11 Added: "type": "image/png",
12 Added: "sizes": "512x512",
13 Added: "purpose": "maskable"
14 Added: }
15 Added: ],
16 Added: "start_url": "/",
17 Added: "display": "standalone",
18 Added: "scope": "/",
19 Added: "description": "Flacon.",
20 Added: "theme_color": "red",
21 Added: "background_color": "red"
22 Added: }
app/views/pwa/service-worker.js
index 00000000..b3a13fb7 000000..100644
@@ -0,0 +1,26 @@
1 Added: // Add a service worker for processing Web Push notifications:
2 Added: //
3 Added: // self.addEventListener("push", async (event) => {
4 Added: // const { title, options } = await event.data.json()
5 Added: // event.waitUntil(self.registration.showNotification(title, options))
6 Added: // })
7 Added: //
8 Added: // self.addEventListener("notificationclick", function(event) {
9 Added: // event.notification.close()
10 Added: // event.waitUntil(
11 Added: // clients.matchAll({ type: "window" }).then((clientList) => {
12 Added: // for (let i = 0; i < clientList.length; i++) {
13 Added: // let client = clientList[i]
14 Added: // let clientPath = (new URL(client.url)).pathname
15 Added: //
16 Added: // if (clientPath == event.notification.data.path && "focus" in client) {
17 Added: // return client.focus()
18 Added: // }
19 Added: // }
20 Added: //
21 Added: // if (clients.openWindow) {
22 Added: // return clients.openWindow(event.notification.data.path)
23 Added: // }
24 Added: // })
25 Added: // )
26 Added: // })
app/views/wines/_form.html.erb
index 00000000..fe676b23 000000..100644
@@ -0,0 +1,33 @@
1 Added: <!-- -*- mode: web; -*- -->
2 Added:
3 Added: <%= form_with model: wine do |form| %>
4 Added: <div>
5 Added: <%= form.label :name %><br>
6 Added: <%= form.text_field :name %>
7 Added: <% wine.errors.full_messages_for(:name).each do |message| %>
8 Added: <div><%= message %></div>
9 Added: <% end %>
10 Added: </div>
11 Added:
12 Added: <div>
13 Added: <%= form.label :year %><br>
14 Added: <%= form.text_field :year %>
15 Added: <% wine.errors.full_messages_for(:year).each do |message| %>
16 Added: <div><%= message %></div>
17 Added: <% end %>
18 Added: </div>
19 Added:
20 Added: <div>
21 Added: <%= form.label :variety %><br>
22 Added: <%= form.text_field :variety %>
23 Added: </div>
24 Added:
25 Added: <div>
26 Added: <%= form.label :notes %><br>
27 Added: <%= form.text_field :notes %>
28 Added: </div>
29 Added:
30 Added: <div>
31 Added: <%= form.submit %>
32 Added: </div>
33 Added: <% end %>
app/views/wines/edit.html.erb
index 00000000..a97c707d 000000..100644
@@ -0,0 +1,5 @@
1 Added: <!-- -*- mode: web; -*- -->
2 Added:
3 Added: <h1>Edit Wine</h1>
4 Added:
5 Added: <%= render "form", wine: @wine %>
app/views/wines/index.html.erb
index 00000000..0202ada7 000000..100644
@@ -0,0 +1,16 @@
1 Added: <!-- -*- mode: web; -*- -->
2 Added:
3 Added: <h1>Wines#index</h1>
4 Added: <h2>List of wines</h2>
5 Added:
6 Added: <%= link_to "Add Wine", new_wine_path %>
7 Added:
8 Added: <ul>
9 Added: <% @wines.each do |wine| %>
10 Added: <li>
11 Added: <%= link_to wine.name, wine %>,
12 Added: <%= wine.year %>,
13 Added: <%= wine.variety %>
14 Added: </li>
15 Added: <% end %>
16 Added: </ul>
app/views/wines/new.html.erb
index 00000000..eeb6fd6d 000000..100644
@@ -0,0 +1,5 @@
1 Added: <!-- -*- mode: web; -*- -->
2 Added:
3 Added: <h1>Add Wine</h1>
4 Added:
5 Added: <%= render "form", wine: @wine %>
app/views/wines/show.html.erb
index 00000000..cd8925de 000000..100644
@@ -0,0 +1,17 @@
1 Added: <!-- -*- mode: web; -*- -->
2 Added:
3 Added: <li><%= link_to "Back to homepage", root_path %></li>
4 Added:
5 Added: <h1><%= @wine.name %></h1>
6 Added: <h2><%= @wine.year %></h2>
7 Added: <p><%= @wine.notes %></p>
8 Added:
9 Added: <ul>
10 Added: <li><%= link_to "Edit", edit_wine_path(@wine) %></li>
11 Added: <li><%= link_to "Destroy",
12 Added: wine_path(@wine),
13 Added: data: {
14 Added: turbo_method: :delete,
15 Added: turbo_confirm: "Are you sure you want to delete #{@wine.name}?"
16 Added: } %></li>
17 Added: </ul>
bin/brakeman
index 00000000..ace1c9ba 000000..100755
@@ -0,0 +1,7 @@
1 Added: #!/usr/bin/env ruby
2 Added: require "rubygems"
3 Added: require "bundler/setup"
4 Added:
5 Added: ARGV.unshift("--ensure-latest")
6 Added:
7 Added: load Gem.bin_path("brakeman", "brakeman")
bin/docker-entrypoint
index 00000000..840d093a 000000..100755
@@ -0,0 +1,13 @@
1 Added: #!/bin/bash -e
2 Added:
3 Added: # Enable jemalloc for reduced memory usage and latency.
4 Added: if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
5 Added: export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
6 Added: fi
7 Added:
8 Added: # If running the rails server then create or migrate existing database
9 Added: if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
10 Added: ./bin/rails db:prepare
11 Added: fi
12 Added:
13 Added: exec "${@}"
bin/rails
index 00000000..efc03774 000000..100755
@@ -0,0 +1,4 @@
1 Added: #!/usr/bin/env ruby
2 Added: APP_PATH = File.expand_path("../config/application", __dir__)
3 Added: require_relative "../config/boot"
4 Added: require "rails/commands"
bin/rake
index 00000000..4fbf10b9 000000..100755
@@ -0,0 +1,4 @@
1 Added: #!/usr/bin/env ruby
2 Added: require_relative "../config/boot"
3 Added: require "rake"
4 Added: Rake.application.run
bin/rubocop
index 00000000..40330c0f 000000..100755
@@ -0,0 +1,8 @@
1 Added: #!/usr/bin/env ruby
2 Added: require "rubygems"
3 Added: require "bundler/setup"
4 Added:
5 Added: # explicit rubocop config increases performance slightly while avoiding config confusion.
6 Added: ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
7 Added:
8 Added: load Gem.bin_path("rubocop", "rubocop")
bin/setup
index 00000000..17b83c23 000000..100755
@@ -0,0 +1,37 @@
1 Added: #!/usr/bin/env ruby
2 Added: require "fileutils"
3 Added:
4 Added: APP_ROOT = File.expand_path("..", __dir__)
5 Added: APP_NAME = "flacon"
6 Added:
7 Added: def system!(*args)
8 Added: system(*args, exception: true)
9 Added: end
10 Added:
11 Added: FileUtils.chdir APP_ROOT do
12 Added: # This script is a way to set up or update your development environment automatically.
13 Added: # This script is idempotent, so that you can run it at any time and get an expectable outcome.
14 Added: # Add necessary setup steps to this file.
15 Added:
16 Added: puts "== Installing dependencies =="
17 Added: system! "gem install bundler --conservative"
18 Added: system("bundle check") || system!("bundle install")
19 Added:
20 Added: # puts "\n== Copying sample files =="
21 Added: # unless File.exist?("config/database.yml")
22 Added: # FileUtils.cp "config/database.yml.sample", "config/database.yml"
23 Added: # end
24 Added:
25 Added: puts "\n== Preparing database =="
26 Added: system! "bin/rails db:prepare"
27 Added:
28 Added: puts "\n== Removing old logs and tempfiles =="
29 Added: system! "bin/rails log:clear tmp:clear"
30 Added:
31 Added: puts "\n== Restarting application server =="
32 Added: system! "bin/rails restart"
33 Added:
34 Added: # puts "\n== Configuring puma-dev =="
35 Added: # system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36 Added: # system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
37 Added: end
config.ru
index 00000000..4a3c09a6 000000..100644
@@ -0,0 +1,6 @@
1 Added: # This file is used by Rack-based servers to start the application.
2 Added:
3 Added: require_relative "config/environment"
4 Added:
5 Added: run Rails.application
6 Added: Rails.application.load_server
config/application.rb
index 00000000..badadab7 000000..100644
@@ -0,0 +1,27 @@
1 Added: require_relative "boot"
2 Added:
3 Added: require "rails/all"
4 Added:
5 Added: # Require the gems listed in Gemfile, including any gems
6 Added: # you've limited to :test, :development, or :production.
7 Added: Bundler.require(*Rails.groups)
8 Added:
9 Added: module Flacon
10 Added: class Application < Rails::Application
11 Added: # Initialize configuration defaults for originally generated Rails version.
12 Added: config.load_defaults 7.2
13 Added:
14 Added: # Please, add to the `ignore` list any other `lib` subdirectories that do
15 Added: # not contain `.rb` files, or that should not be reloaded or eager loaded.
16 Added: # Common ones are `templates`, `generators`, or `middleware`, for example.
17 Added: config.autoload_lib(ignore: %w[assets tasks])
18 Added:
19 Added: # Configuration for the application, engines, and railties goes here.
20 Added: #
21 Added: # These settings can be overridden in specific environments using the files
22 Added: # in config/environments, which are processed later.
23 Added: #
24 Added: # config.time_zone = "Central Time (US & Canada)"
25 Added: # config.eager_load_paths << Rails.root.join("extras")
26 Added: end
27 Added: end
config/boot.rb
index 00000000..988a5ddc 000000..100644
@@ -0,0 +1,4 @@
1 Added: ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
2 Added:
3 Added: require "bundler/setup" # Set up gems listed in the Gemfile.
4 Added: require "bootsnap/setup" # Speed up boot time by caching expensive operations.
config/cable.yml
index 00000000..3154ec05 000000..100644
@@ -0,0 +1,10 @@
1 Added: development:
2 Added: adapter: async
3 Added:
4 Added: test:
5 Added: adapter: test
6 Added:
7 Added: production:
8 Added: adapter: redis
9 Added: url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
10 Added: channel_prefix: flacon_production
config/credentials.yml.enc
index 00000000..73199f2f 000000..100644
@@ -0,0 +1,1 @@
1 Added: KhN3Ieue96jo6tB7+ZHvb1A3AeiCbf5H01MsCT/hq7jXGQK8tN5Q5O17xk8cmrBT5ieca7C7SdwFkYsiTRS8LYj4EkfeKKu94Ul/yhuSnJpXOKsecE0xpOl4E3t3rIXHOTtr9oL8EoaGnchoagE520cCRkWA3RVa5X+2nxPtgUZ48/N4JNWxzeE+nmo9YX+b2eF/1cfowxn7CSi3s6/e/86DTgAeh2A4UgTljakxFoYRSJejHYvNdzXjqy7P71X7cmEl5UIxJt7POl58M3+cQJrA0bbrEubZYQIPQtDlgAZmtI3V0ZDC6fESRscmiEjfgFHBJ4jGCu+u/L4TKHqfLj80E03KFSLJOfl418WjxUMx7wB0SZezH5IbhZgtWgHxqraoTKjMBZGejq5o1h0O3pVrYwBb--Wk+54CbLm/lxWq1G--6RcfEkefUkMV/XiO+XGS5w==
config/database.yml
index 00000000..fbf675e5 000000..100644
@@ -0,0 +1,33 @@
1 Added: # SQLite. Versions 3.8.0 and up are supported.
2 Added: # gem install sqlite3
3 Added: #
4 Added: # Ensure the SQLite 3 gem is defined in your Gemfile
5 Added: # gem "sqlite3"
6 Added: #
7 Added: default: &default
8 Added: adapter: sqlite3
9 Added: pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10 Added: timeout: 5000
11 Added:
12 Added: development:
13 Added: <<: *default
14 Added: database: storage/development.sqlite3
15 Added:
16 Added: # Warning: The database defined as "test" will be erased and
17 Added: # re-generated from your development database when you run "rake".
18 Added: # Do not set this db to the same as development or production.
19 Added: test:
20 Added: <<: *default
21 Added: database: storage/test.sqlite3
22 Added:
23 Added:
24 Added: # SQLite3 write its data on the local filesystem, as such it requires
25 Added: # persistent disks. If you are deploying to a managed service, you should
26 Added: # make sure it provides disk persistence, as many don't.
27 Added: #
28 Added: # Similarly, if you deploy your application as a Docker container, you must
29 Added: # ensure the database is located in a persisted volume.
30 Added: production:
31 Added: <<: *default
32 Added: # database: path/to/persistent/storage/production.sqlite3
33 Added: database: storage/production.sqlite3
config/environment.rb
index 00000000..cac53157 000000..100644
@@ -0,0 +1,5 @@
1 Added: # Load the Rails application.
2 Added: require_relative "application"
3 Added:
4 Added: # Initialize the Rails application.
5 Added: Rails.application.initialize!
config/environments/development.rb
index 00000000..9b673600 000000..100644
@@ -0,0 +1,81 @@
1 Added: require "active_support/core_ext/integer/time"
2 Added:
3 Added: Rails.application.configure do
4 Added: # Settings specified here will take precedence over those in config/application.rb.
5 Added:
6 Added: # In the development environment your application's code is reloaded any time
7 Added: # it changes. This slows down response time but is perfect for development
8 Added: # since you don't have to restart the web server when you make code changes.
9 Added: config.enable_reloading = true
10 Added:
11 Added: # Do not eager load code on boot.
12 Added: config.eager_load = false
13 Added:
14 Added: # Show full error reports.
15 Added: config.consider_all_requests_local = true
16 Added:
17 Added: # Enable server timing.
18 Added: config.server_timing = true
19 Added:
20 Added: # Enable/disable caching. By default caching is disabled.
21 Added: # Run rails dev:cache to toggle caching.
22 Added: if Rails.root.join("tmp/caching-dev.txt").exist?
23 Added: config.action_controller.perform_caching = true
24 Added: config.action_controller.enable_fragment_cache_logging = true
25 Added:
26 Added: config.cache_store = :memory_store
27 Added: config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
28 Added: else
29 Added: config.action_controller.perform_caching = false
30 Added:
31 Added: config.cache_store = :null_store
32 Added: end
33 Added:
34 Added: # Store uploaded files on the local file system (see config/storage.yml for options).
35 Added: config.active_storage.service = :local
36 Added:
37 Added: # Don't care if the mailer can't send.
38 Added: config.action_mailer.raise_delivery_errors = false
39 Added:
40 Added: # Disable caching for Action Mailer templates even if Action Controller
41 Added: # caching is enabled.
42 Added: config.action_mailer.perform_caching = false
43 Added:
44 Added: config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
45 Added:
46 Added: # Print deprecation notices to the Rails logger.
47 Added: config.active_support.deprecation = :log
48 Added:
49 Added: # Raise exceptions for disallowed deprecations.
50 Added: config.active_support.disallowed_deprecation = :raise
51 Added:
52 Added: # Tell Active Support which deprecation messages to disallow.
53 Added: config.active_support.disallowed_deprecation_warnings = []
54 Added:
55 Added: # Raise an error on page load if there are pending migrations.
56 Added: config.active_record.migration_error = :page_load
57 Added:
58 Added: # Highlight code that triggered database queries in logs.
59 Added: config.active_record.verbose_query_logs = true
60 Added:
61 Added: # Highlight code that enqueued background job in logs.
62 Added: config.active_job.verbose_enqueue_logs = true
63 Added:
64 Added: # Suppress logger output for asset requests.
65 Added: config.assets.quiet = true
66 Added:
67 Added: # Raises error for missing translations.
68 Added: # config.i18n.raise_on_missing_translations = true
69 Added:
70 Added: # Annotate rendered view with file names.
71 Added: config.action_view.annotate_rendered_view_with_filenames = true
72 Added:
73 Added: # Uncomment if you wish to allow Action Cable access from any origin.
74 Added: # config.action_cable.disable_request_forgery_protection = true
75 Added:
76 Added: # Raise error when a before_action's only/except options reference missing actions.
77 Added: config.action_controller.raise_on_missing_callback_actions = true
78 Added:
79 Added: # Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
80 Added: # config.generators.apply_rubocop_autocorrect_after_generate!
81 Added: end
config/environments/production.rb
index 00000000..fcd58d7f 000000..100644
@@ -0,0 +1,102 @@
1 Added: require "active_support/core_ext/integer/time"
2 Added:
3 Added: Rails.application.configure do
4 Added: # Settings specified here will take precedence over those in config/application.rb.
5 Added:
6 Added: # Code is not reloaded between requests.
7 Added: config.enable_reloading = false
8 Added:
9 Added: # Eager load code on boot. This eager loads most of Rails and
10 Added: # your application in memory, allowing both threaded web servers
11 Added: # and those relying on copy on write to perform better.
12 Added: # Rake tasks automatically ignore this option for performance.
13 Added: config.eager_load = true
14 Added:
15 Added: # Full error reports are disabled and caching is turned on.
16 Added: config.consider_all_requests_local = false
17 Added: config.action_controller.perform_caching = true
18 Added:
19 Added: # Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
20 Added: # key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
21 Added: # config.require_master_key = true
22 Added:
23 Added: # Disable serving static files from `public/`, relying on NGINX/Apache to do so instead.
24 Added: # config.public_file_server.enabled = false
25 Added:
26 Added: # Compress CSS using a preprocessor.
27 Added: # config.assets.css_compressor = :sass
28 Added:
29 Added: # Do not fall back to assets pipeline if a precompiled asset is missed.
30 Added: config.assets.compile = false
31 Added:
32 Added: # Enable serving of images, stylesheets, and JavaScripts from an asset server.
33 Added: # config.asset_host = "http://assets.example.com"
34 Added:
35 Added: # Specifies the header that your server uses for sending files.
36 Added: # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
37 Added: # config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
38 Added:
39 Added: # Store uploaded files on the local file system (see config/storage.yml for options).
40 Added: config.active_storage.service = :local
41 Added:
42 Added: # Mount Action Cable outside main process or domain.
43 Added: # config.action_cable.mount_path = nil
44 Added: # config.action_cable.url = "wss://example.com/cable"
45 Added: # config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
46 Added:
47 Added: # Assume all access to the app is happening through a SSL-terminating reverse proxy.
48 Added: # Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
49 Added: # config.assume_ssl = true
50 Added:
51 Added: # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
52 Added: config.force_ssl = true
53 Added:
54 Added: # Skip http-to-https redirect for the default health check endpoint.
55 Added: # config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
56 Added:
57 Added: # Log to STDOUT by default
58 Added: config.logger = ActiveSupport::Logger.new(STDOUT)
59 Added: .tap { |logger| logger.formatter = ::Logger::Formatter.new }
60 Added: .then { |logger| ActiveSupport::TaggedLogging.new(logger) }
61 Added:
62 Added: # Prepend all log lines with the following tags.
63 Added: config.log_tags = [ :request_id ]
64 Added:
65 Added: # "info" includes generic and useful information about system operation, but avoids logging too much
66 Added: # information to avoid inadvertent exposure of personally identifiable information (PII). If you
67 Added: # want to log everything, set the level to "debug".
68 Added: config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
69 Added:
70 Added: # Use a different cache store in production.
71 Added: # config.cache_store = :mem_cache_store
72 Added:
73 Added: # Use a real queuing backend for Active Job (and separate queues per environment).
74 Added: # config.active_job.queue_adapter = :resque
75 Added: # config.active_job.queue_name_prefix = "flacon_production"
76 Added:
77 Added: # Disable caching for Action Mailer templates even if Action Controller
78 Added: # caching is enabled.
79 Added: config.action_mailer.perform_caching = false
80 Added:
81 Added: # Ignore bad email addresses and do not raise email delivery errors.
82 Added: # Set this to true and configure the email server for immediate delivery to raise delivery errors.
83 Added: # config.action_mailer.raise_delivery_errors = false
84 Added:
85 Added: # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
86 Added: # the I18n.default_locale when a translation cannot be found).
87 Added: config.i18n.fallbacks = true
88 Added:
89 Added: # Don't log any deprecations.
90 Added: config.active_support.report_deprecations = false
91 Added:
92 Added: # Do not dump schema after migrations.
93 Added: config.active_record.dump_schema_after_migration = false
94 Added:
95 Added: # Enable DNS rebinding protection and other `Host` header attacks.
96 Added: # config.hosts = [
97 Added: # "example.com", # Allow requests from example.com
98 Added: # /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
99 Added: # ]
100 Added: # Skip DNS rebinding protection for the default health check endpoint.
101 Added: # config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
102 Added: end
config/environments/test.rb
index 00000000..0c616a1b 000000..100644
@@ -0,0 +1,67 @@
1 Added: require "active_support/core_ext/integer/time"
2 Added:
3 Added: # The test environment is used exclusively to run your application's
4 Added: # test suite. You never need to work with it otherwise. Remember that
5 Added: # your test database is "scratch space" for the test suite and is wiped
6 Added: # and recreated between test runs. Don't rely on the data there!
7 Added:
8 Added: Rails.application.configure do
9 Added: # Settings specified here will take precedence over those in config/application.rb.
10 Added:
11 Added: # While tests run files are not watched, reloading is not necessary.
12 Added: config.enable_reloading = false
13 Added:
14 Added: # Eager loading loads your entire application. When running a single test locally,
15 Added: # this is usually not necessary, and can slow down your test suite. However, it's
16 Added: # recommended that you enable it in continuous integration systems to ensure eager
17 Added: # loading is working properly before deploying your code.
18 Added: config.eager_load = ENV["CI"].present?
19 Added:
20 Added: # Configure public file server for tests with Cache-Control for performance.
21 Added: config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{1.hour.to_i}" }
22 Added:
23 Added: # Show full error reports and disable caching.
24 Added: config.consider_all_requests_local = true
25 Added: config.action_controller.perform_caching = false
26 Added: config.cache_store = :null_store
27 Added:
28 Added: # Render exception templates for rescuable exceptions and raise for other exceptions.
29 Added: config.action_dispatch.show_exceptions = :rescuable
30 Added:
31 Added: # Disable request forgery protection in test environment.
32 Added: config.action_controller.allow_forgery_protection = false
33 Added:
34 Added: # Store uploaded files on the local file system in a temporary directory.
35 Added: config.active_storage.service = :test
36 Added:
37 Added: # Disable caching for Action Mailer templates even if Action Controller
38 Added: # caching is enabled.
39 Added: config.action_mailer.perform_caching = false
40 Added:
41 Added: # Tell Action Mailer not to deliver emails to the real world.
42 Added: # The :test delivery method accumulates sent emails in the
43 Added: # ActionMailer::Base.deliveries array.
44 Added: config.action_mailer.delivery_method = :test
45 Added:
46 Added: # Unlike controllers, the mailer instance doesn't have any context about the
47 Added: # incoming request so you'll need to provide the :host parameter yourself.
48 Added: config.action_mailer.default_url_options = { host: "www.example.com" }
49 Added:
50 Added: # Print deprecation notices to the stderr.
51 Added: config.active_support.deprecation = :stderr
52 Added:
53 Added: # Raise exceptions for disallowed deprecations.
54 Added: config.active_support.disallowed_deprecation = :raise
55 Added:
56 Added: # Tell Active Support which deprecation messages to disallow.
57 Added: config.active_support.disallowed_deprecation_warnings = []
58 Added:
59 Added: # Raises error for missing translations.
60 Added: # config.i18n.raise_on_missing_translations = true
61 Added:
62 Added: # Annotate rendered view with file names.
63 Added: # config.action_view.annotate_rendered_view_with_filenames = true
64 Added:
65 Added: # Raise error when a before_action's only/except options reference missing actions.
66 Added: config.action_controller.raise_on_missing_callback_actions = true
67 Added: end
config/initializers/assets.rb
index 00000000..bd5bcd2b 000000..100644
@@ -0,0 +1,12 @@
1 Added: # Be sure to restart your server when you modify this file.
2 Added:
3 Added: # Version of your assets, change this if you want to expire all your assets.
4 Added: Rails.application.config.assets.version = "1.0"
5 Added:
6 Added: # Add additional assets to the asset load path.
7 Added: # Rails.application.config.assets.paths << Emoji.images_path
8 Added:
9 Added: # Precompile additional assets.
10 Added: # application.js, application.css, and all non-JS/CSS in the app/assets
11 Added: # folder are already added.
12 Added: # Rails.application.config.assets.precompile += %w[ admin.js admin.css ]
config/initializers/content_security_policy.rb
index 00000000..b3076b38 000000..100644
@@ -0,0 +1,25 @@
1 Added: # Be sure to restart your server when you modify this file.
2 Added:
3 Added: # Define an application-wide content security policy.
4 Added: # See the Securing Rails Applications Guide for more information:
5 Added: # https://guides.rubyonrails.org/security.html#content-security-policy-header
6 Added:
7 Added: # Rails.application.configure do
8 Added: # config.content_security_policy do |policy|
9 Added: # policy.default_src :self, :https
10 Added: # policy.font_src :self, :https, :data
11 Added: # policy.img_src :self, :https, :data
12 Added: # policy.object_src :none
13 Added: # policy.script_src :self, :https
14 Added: # policy.style_src :self, :https
15 Added: # # Specify URI for violation reports
16 Added: # # policy.report_uri "/csp-violation-report-endpoint"
17 Added: # end
18 Added: #
19 Added: # # Generate session nonces for permitted importmap, inline scripts, and inline styles.
20 Added: # config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
21 Added: # config.content_security_policy_nonce_directives = %w(script-src style-src)
22 Added: #
23 Added: # # Report violations without enforcing the policy.
24 Added: # # config.content_security_policy_report_only = true
25 Added: # end
config/initializers/filter_parameter_logging.rb
index 00000000..c010b83d 000000..100644
@@ -0,0 +1,8 @@
1 Added: # Be sure to restart your server when you modify this file.
2 Added:
3 Added: # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file.
4 Added: # Use this to limit dissemination of sensitive information.
5 Added: # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
6 Added: Rails.application.config.filter_parameters += [
7 Added: :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
8 Added: ]
config/initializers/inflections.rb
index 00000000..3860f659 000000..100644
@@ -0,0 +1,16 @@
1 Added: # Be sure to restart your server when you modify this file.
2 Added:
3 Added: # Add new inflection rules using the following format. Inflections
4 Added: # are locale specific, and you may define rules for as many different
5 Added: # locales as you wish. All of these examples are active by default:
6 Added: # ActiveSupport::Inflector.inflections(:en) do |inflect|
7 Added: # inflect.plural /^(ox)$/i, "\\1en"
8 Added: # inflect.singular /^(ox)en/i, "\\1"
9 Added: # inflect.irregular "person", "people"
10 Added: # inflect.uncountable %w( fish sheep )
11 Added: # end
12 Added:
13 Added: # These inflection rules are supported but not enabled by default:
14 Added: # ActiveSupport::Inflector.inflections(:en) do |inflect|
15 Added: # inflect.acronym "RESTful"
16 Added: # end
config/initializers/permissions_policy.rb
index 00000000..7db3b957 000000..100644
@@ -0,0 +1,13 @@
1 Added: # Be sure to restart your server when you modify this file.
2 Added:
3 Added: # Define an application-wide HTTP permissions policy. For further
4 Added: # information see: https://developers.google.com/web/updates/2018/06/feature-policy
5 Added:
6 Added: # Rails.application.config.permissions_policy do |policy|
7 Added: # policy.camera :none
8 Added: # policy.gyroscope :none
9 Added: # policy.microphone :none
10 Added: # policy.usb :none
11 Added: # policy.fullscreen :self
12 Added: # policy.payment :self, "https://secure.example.com"
13 Added: # end
config/locales/en.yml
index 00000000..6c349ae5 000000..100644
@@ -0,0 +1,31 @@
1 Added: # Files in the config/locales directory are used for internationalization and
2 Added: # are automatically loaded by Rails. If you want to use locales other than
3 Added: # English, add the necessary files in this directory.
4 Added: #
5 Added: # To use the locales, use `I18n.t`:
6 Added: #
7 Added: # I18n.t "hello"
8 Added: #
9 Added: # In views, this is aliased to just `t`:
10 Added: #
11 Added: # <%= t("hello") %>
12 Added: #
13 Added: # To use a different locale, set it with `I18n.locale`:
14 Added: #
15 Added: # I18n.locale = :es
16 Added: #
17 Added: # This would use the information in config/locales/es.yml.
18 Added: #
19 Added: # To learn more about the API, please read the Rails Internationalization guide
20 Added: # at https://guides.rubyonrails.org/i18n.html.
21 Added: #
22 Added: # Be aware that YAML interprets the following case-insensitive strings as
23 Added: # booleans: `true`, `false`, `on`, `off`, `yes`, `no`. Therefore, these strings
24 Added: # must be quoted to be interpreted as strings. For example:
25 Added: #
26 Added: # en:
27 Added: # "yes": yup
28 Added: # enabled: "ON"
29 Added:
30 Added: en:
31 Added: hello: "Hello world"
config/puma.rb
index 00000000..03c166f4 000000..100644
@@ -0,0 +1,34 @@
1 Added: # This configuration file will be evaluated by Puma. The top-level methods that
2 Added: # are invoked here are part of Puma's configuration DSL. For more information
3 Added: # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
4 Added:
5 Added: # Puma starts a configurable number of processes (workers) and each process
6 Added: # serves each request in a thread from an internal thread pool.
7 Added: #
8 Added: # The ideal number of threads per worker depends both on how much time the
9 Added: # application spends waiting for IO operations and on how much you wish to
10 Added: # to prioritize throughput over latency.
11 Added: #
12 Added: # As a rule of thumb, increasing the number of threads will increase how much
13 Added: # traffic a given process can handle (throughput), but due to CRuby's
14 Added: # Global VM Lock (GVL) it has diminishing returns and will degrade the
15 Added: # response time (latency) of the application.
16 Added: #
17 Added: # The default is set to 3 threads as it's deemed a decent compromise between
18 Added: # throughput and latency for the average Rails application.
19 Added: #
20 Added: # Any libraries that use a connection pool or another resource pool should
21 Added: # be configured to provide at least as many connections as the number of
22 Added: # threads. This includes Active Record's `pool` parameter in `database.yml`.
23 Added: threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
24 Added: threads threads_count, threads_count
25 Added:
26 Added: # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
27 Added: port ENV.fetch("PORT", 3000)
28 Added:
29 Added: # Allow puma to be restarted by `bin/rails restart` command.
30 Added: plugin :tmp_restart
31 Added:
32 Added: # Specify the PID file. Defaults to tmp/pids/server.pid in development.
33 Added: # In other environments, only set the PID file if requested.
34 Added: pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
config/routes.rb
index 00000000..96bbb493 000000..100644
@@ -0,0 +1,18 @@
1 Added: Rails.application.routes.draw do
2 Added: root "wines#index"
3 Added:
4 Added: resources :wines
5 Added:
6 Added: # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
7 Added:
8 Added: # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500.
9 Added: # Can be used by load balancers and uptime monitors to verify that the app is live.
10 Added: get "up" => "rails/health#show", as: :rails_health_check
11 Added:
12 Added: # Render dynamic PWA files from app/views/pwa/*
13 Added: get "service-worker" => "rails/pwa#service_worker", as: :pwa_service_worker
14 Added: get "manifest" => "rails/pwa#manifest", as: :pwa_manifest
15 Added:
16 Added: # Defines the root path route ("/")
17 Added: # root "posts#index"
18 Added: end
config/storage.yml
index 00000000..4942ab66 000000..100644
@@ -0,0 +1,34 @@
1 Added: test:
2 Added: service: Disk
3 Added: root: <%= Rails.root.join("tmp/storage") %>
4 Added:
5 Added: local:
6 Added: service: Disk
7 Added: root: <%= Rails.root.join("storage") %>
8 Added:
9 Added: # Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
10 Added: # amazon:
11 Added: # service: S3
12 Added: # access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
13 Added: # secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
14 Added: # region: us-east-1
15 Added: # bucket: your_own_bucket-<%= Rails.env %>
16 Added:
17 Added: # Remember not to checkin your GCS keyfile to a repository
18 Added: # google:
19 Added: # service: GCS
20 Added: # project: your_project
21 Added: # credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
22 Added: # bucket: your_own_bucket-<%= Rails.env %>
23 Added:
24 Added: # Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
25 Added: # microsoft:
26 Added: # service: AzureStorage
27 Added: # storage_account_name: your_account_name
28 Added: # storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
29 Added: # container: your_container_name-<%= Rails.env %>
30 Added:
31 Added: # mirror:
32 Added: # service: Mirror
33 Added: # primary: local
34 Added: # mirrors: [ amazon, google, microsoft ]
db/migrate/20241020144326_create_wines.rb
index 00000000..d969b0aa 000000..100644
@@ -0,0 +1,15 @@
1 Added: class CreateWines < ActiveRecord::Migration[7.2]
2 Added: def change
3 Added: create_table :wines do |t|
4 Added: t.string :name
5 Added: t.integer :year
6 Added: t.string :variety
7 Added: t.string :region
8 Added: t.decimal :price
9 Added: t.integer :stock
10 Added: t.text :notes
11 Added:
12 Added: t.timestamps
13 Added: end
14 Added: end
15 Added: end
db/schema.rb
index 00000000..385641f3 000000..100644
@@ -0,0 +1,25 @@
1 Added: # This file is auto-generated from the current state of the database. Instead
2 Added: # of editing this file, please use the migrations feature of Active Record to
3 Added: # incrementally modify your database, and then regenerate this schema definition.
4 Added: #
5 Added: # This file is the source Rails uses to define your schema when running `bin/rails
6 Added: # db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7 Added: # be faster and is potentially less error prone than running all of your
8 Added: # migrations from scratch. Old migrations may fail to apply correctly if those
9 Added: # migrations use external dependencies or application code.
10 Added: #
11 Added: # It's strongly recommended that you check this file into your version control system.
12 Added:
13 Added: ActiveRecord::Schema[7.2].define(version: 2024_10_20_144326) do
14 Added: create_table "wines", force: :cascade do |t|
15 Added: t.string "name"
16 Added: t.integer "year"
17 Added: t.string "variety"
18 Added: t.string "region"
19 Added: t.decimal "price"
20 Added: t.integer "stock"
21 Added: t.text "notes"
22 Added: t.datetime "created_at", null: false
23 Added: t.datetime "updated_at", null: false
24 Added: end
25 Added: end
db/seeds.rb
index 00000000..4fbd6ed9 000000..100644
@@ -0,0 +1,9 @@
1 Added: # This file should ensure the existence of records required to run the application in every environment (production,
2 Added: # development, test). The code here should be idempotent so that it can be executed at any point in every environment.
3 Added: # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
4 Added: #
5 Added: # Example:
6 Added: #
7 Added: # ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
8 Added: # MovieGenre.find_or_create_by!(name: genre_name)
9 Added: # end
lib/assets/.keep
index 00000000..e69de29b 000000..100644
lib/tasks/.keep
index 00000000..e69de29b 000000..100644
log/.keep
index 00000000..e69de29b 000000..100644
public/404.html
index 00000000..2be3af26 000000..100644
@@ -0,0 +1,67 @@
1 Added: <!DOCTYPE html>
2 Added: <html>
3 Added: <head>
4 Added: <title>The page you were looking for doesn't exist (404)</title>
5 Added: <meta name="viewport" content="width=device-width,initial-scale=1">
6 Added: <style>
7 Added: .rails-default-error-page {
8 Added: background-color: #EFEFEF;
9 Added: color: #2E2F30;
10 Added: text-align: center;
11 Added: font-family: arial, sans-serif;
12 Added: margin: 0;
13 Added: }
14 Added:
15 Added: .rails-default-error-page div.dialog {
16 Added: width: 95%;
17 Added: max-width: 33em;
18 Added: margin: 4em auto 0;
19 Added: }
20 Added:
21 Added: .rails-default-error-page div.dialog > div {
22 Added: border: 1px solid #CCC;
23 Added: border-right-color: #999;
24 Added: border-left-color: #999;
25 Added: border-bottom-color: #BBB;
26 Added: border-top: #B00100 solid 4px;
27 Added: border-top-left-radius: 9px;
28 Added: border-top-right-radius: 9px;
29 Added: background-color: white;
30 Added: padding: 7px 12% 0;
31 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32 Added: }
33 Added:
34 Added: .rails-default-error-page h1 {
35 Added: font-size: 100%;
36 Added: color: #730E15;
37 Added: line-height: 1.5em;
38 Added: }
39 Added:
40 Added: .rails-default-error-page div.dialog > p {
41 Added: margin: 0 0 1em;
42 Added: padding: 1em;
43 Added: background-color: #F7F7F7;
44 Added: border: 1px solid #CCC;
45 Added: border-right-color: #999;
46 Added: border-left-color: #999;
47 Added: border-bottom-color: #999;
48 Added: border-bottom-left-radius: 4px;
49 Added: border-bottom-right-radius: 4px;
50 Added: border-top-color: #DADADA;
51 Added: color: #666;
52 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53 Added: }
54 Added: </style>
55 Added: </head>
56 Added:
57 Added: <body class="rails-default-error-page">
58 Added: <!-- This file lives in public/404.html -->
59 Added: <div class="dialog">
60 Added: <div>
61 Added: <h1>The page you were looking for doesn't exist.</h1>
62 Added: <p>You may have mistyped the address or the page may have moved.</p>
63 Added: </div>
64 Added: <p>If you are the application owner check the logs for more information.</p>
65 Added: </div>
66 Added: </body>
67 Added: </html>
public/406-unsupported-browser.html
index 00000000..7cf1e168 000000..100644
@@ -0,0 +1,66 @@
1 Added: <!DOCTYPE html>
2 Added: <html>
3 Added: <head>
4 Added: <title>Your browser is not supported (406)</title>
5 Added: <meta name="viewport" content="width=device-width,initial-scale=1">
6 Added: <style>
7 Added: .rails-default-error-page {
8 Added: background-color: #EFEFEF;
9 Added: color: #2E2F30;
10 Added: text-align: center;
11 Added: font-family: arial, sans-serif;
12 Added: margin: 0;
13 Added: }
14 Added:
15 Added: .rails-default-error-page div.dialog {
16 Added: width: 95%;
17 Added: max-width: 33em;
18 Added: margin: 4em auto 0;
19 Added: }
20 Added:
21 Added: .rails-default-error-page div.dialog > div {
22 Added: border: 1px solid #CCC;
23 Added: border-right-color: #999;
24 Added: border-left-color: #999;
25 Added: border-bottom-color: #BBB;
26 Added: border-top: #B00100 solid 4px;
27 Added: border-top-left-radius: 9px;
28 Added: border-top-right-radius: 9px;
29 Added: background-color: white;
30 Added: padding: 7px 12% 0;
31 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32 Added: }
33 Added:
34 Added: .rails-default-error-page h1 {
35 Added: font-size: 100%;
36 Added: color: #730E15;
37 Added: line-height: 1.5em;
38 Added: }
39 Added:
40 Added: .rails-default-error-page div.dialog > p {
41 Added: margin: 0 0 1em;
42 Added: padding: 1em;
43 Added: background-color: #F7F7F7;
44 Added: border: 1px solid #CCC;
45 Added: border-right-color: #999;
46 Added: border-left-color: #999;
47 Added: border-bottom-color: #999;
48 Added: border-bottom-left-radius: 4px;
49 Added: border-bottom-right-radius: 4px;
50 Added: border-top-color: #DADADA;
51 Added: color: #666;
52 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53 Added: }
54 Added: </style>
55 Added: </head>
56 Added:
57 Added: <body class="rails-default-error-page">
58 Added: <!-- This file lives in public/406-unsupported-browser.html -->
59 Added: <div class="dialog">
60 Added: <div>
61 Added: <h1>Your browser is not supported.</h1>
62 Added: <p>Please upgrade your browser to continue.</p>
63 Added: </div>
64 Added: </div>
65 Added: </body>
66 Added: </html>
public/422.html
index 00000000..c08eac0d 000000..100644
@@ -0,0 +1,67 @@
1 Added: <!DOCTYPE html>
2 Added: <html>
3 Added: <head>
4 Added: <title>The change you wanted was rejected (422)</title>
5 Added: <meta name="viewport" content="width=device-width,initial-scale=1">
6 Added: <style>
7 Added: .rails-default-error-page {
8 Added: background-color: #EFEFEF;
9 Added: color: #2E2F30;
10 Added: text-align: center;
11 Added: font-family: arial, sans-serif;
12 Added: margin: 0;
13 Added: }
14 Added:
15 Added: .rails-default-error-page div.dialog {
16 Added: width: 95%;
17 Added: max-width: 33em;
18 Added: margin: 4em auto 0;
19 Added: }
20 Added:
21 Added: .rails-default-error-page div.dialog > div {
22 Added: border: 1px solid #CCC;
23 Added: border-right-color: #999;
24 Added: border-left-color: #999;
25 Added: border-bottom-color: #BBB;
26 Added: border-top: #B00100 solid 4px;
27 Added: border-top-left-radius: 9px;
28 Added: border-top-right-radius: 9px;
29 Added: background-color: white;
30 Added: padding: 7px 12% 0;
31 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32 Added: }
33 Added:
34 Added: .rails-default-error-page h1 {
35 Added: font-size: 100%;
36 Added: color: #730E15;
37 Added: line-height: 1.5em;
38 Added: }
39 Added:
40 Added: .rails-default-error-page div.dialog > p {
41 Added: margin: 0 0 1em;
42 Added: padding: 1em;
43 Added: background-color: #F7F7F7;
44 Added: border: 1px solid #CCC;
45 Added: border-right-color: #999;
46 Added: border-left-color: #999;
47 Added: border-bottom-color: #999;
48 Added: border-bottom-left-radius: 4px;
49 Added: border-bottom-right-radius: 4px;
50 Added: border-top-color: #DADADA;
51 Added: color: #666;
52 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53 Added: }
54 Added: </style>
55 Added: </head>
56 Added:
57 Added: <body class="rails-default-error-page">
58 Added: <!-- This file lives in public/422.html -->
59 Added: <div class="dialog">
60 Added: <div>
61 Added: <h1>The change you wanted was rejected.</h1>
62 Added: <p>Maybe you tried to change something you didn't have access to.</p>
63 Added: </div>
64 Added: <p>If you are the application owner check the logs for more information.</p>
65 Added: </div>
66 Added: </body>
67 Added: </html>
public/500.html
index 00000000..78a030af 000000..100644
@@ -0,0 +1,66 @@
1 Added: <!DOCTYPE html>
2 Added: <html>
3 Added: <head>
4 Added: <title>We're sorry, but something went wrong (500)</title>
5 Added: <meta name="viewport" content="width=device-width,initial-scale=1">
6 Added: <style>
7 Added: .rails-default-error-page {
8 Added: background-color: #EFEFEF;
9 Added: color: #2E2F30;
10 Added: text-align: center;
11 Added: font-family: arial, sans-serif;
12 Added: margin: 0;
13 Added: }
14 Added:
15 Added: .rails-default-error-page div.dialog {
16 Added: width: 95%;
17 Added: max-width: 33em;
18 Added: margin: 4em auto 0;
19 Added: }
20 Added:
21 Added: .rails-default-error-page div.dialog > div {
22 Added: border: 1px solid #CCC;
23 Added: border-right-color: #999;
24 Added: border-left-color: #999;
25 Added: border-bottom-color: #BBB;
26 Added: border-top: #B00100 solid 4px;
27 Added: border-top-left-radius: 9px;
28 Added: border-top-right-radius: 9px;
29 Added: background-color: white;
30 Added: padding: 7px 12% 0;
31 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32 Added: }
33 Added:
34 Added: .rails-default-error-page h1 {
35 Added: font-size: 100%;
36 Added: color: #730E15;
37 Added: line-height: 1.5em;
38 Added: }
39 Added:
40 Added: .rails-default-error-page div.dialog > p {
41 Added: margin: 0 0 1em;
42 Added: padding: 1em;
43 Added: background-color: #F7F7F7;
44 Added: border: 1px solid #CCC;
45 Added: border-right-color: #999;
46 Added: border-left-color: #999;
47 Added: border-bottom-color: #999;
48 Added: border-bottom-left-radius: 4px;
49 Added: border-bottom-right-radius: 4px;
50 Added: border-top-color: #DADADA;
51 Added: color: #666;
52 Added: box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53 Added: }
54 Added: </style>
55 Added: </head>
56 Added:
57 Added: <body class="rails-default-error-page">
58 Added: <!-- This file lives in public/500.html -->
59 Added: <div class="dialog">
60 Added: <div>
61 Added: <h1>We're sorry, but something went wrong.</h1>
62 Added: </div>
63 Added: <p>If you are the application owner check the logs for more information.</p>
64 Added: </div>
65 Added: </body>
66 Added: </html>
public/icon.png
index 00000000..f3b5abcb 000000..100644

Binary files differ

public/icon.svg
index 00000000..78307ccd 000000..100644
@@ -0,0 +1,3 @@
1 Added: <svg width="100" height="100" xmlns="http://www.w3.org/2000/svg">
2 Added: <rect width="100%" height="100%" fill="red"/>
3 Added: </svg>
public/robots.txt
index 00000000..c19f78ab 000000..100644
@@ -0,0 +1,1 @@
1 Added: # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
storage/.keep
index 00000000..e69de29b 000000..100644
test/application_system_test_case.rb
index 00000000..cee29fd2 000000..100644
@@ -0,0 +1,5 @@
1 Added: require "test_helper"
2 Added:
3 Added: class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4 Added: driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
5 Added: end
test/channels/application_cable/connection_test.rb
index 00000000..6340bf9c 000000..100644
@@ -0,0 +1,13 @@
1 Added: require "test_helper"
2 Added:
3 Added: module ApplicationCable
4 Added: class ConnectionTest < ActionCable::Connection::TestCase
5 Added: # test "connects with cookies" do
6 Added: # cookies.signed[:user_id] = 42
7 Added: #
8 Added: # connect
9 Added: #
10 Added: # assert_equal connection.user_id, "42"
11 Added: # end
12 Added: end
13 Added: end
test/controllers/.keep
index 00000000..e69de29b 000000..100644
test/controllers/wines_controller_test.rb
index 00000000..09451bec 000000..100644
@@ -0,0 +1,8 @@
1 Added: require "test_helper"
2 Added:
3 Added: class WinesControllerTest < ActionDispatch::IntegrationTest
4 Added: test "should get index" do
5 Added: get wines_index_url
6 Added: assert_response :success
7 Added: end
8 Added: end
test/fixtures/files/.keep
index 00000000..e69de29b 000000..100644
test/fixtures/wines.yml
index 00000000..93bad81f 000000..100644
@@ -0,0 +1,19 @@
1 Added: # Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2 Added:
3 Added: one:
4 Added: name: MyString
5 Added: year: 1
6 Added: variety: MyString
7 Added: region: MyString
8 Added: price: 9.99
9 Added: stock: 1
10 Added: notes: MyText
11 Added:
12 Added: two:
13 Added: name: MyString
14 Added: year: 1
15 Added: variety: MyString
16 Added: region: MyString
17 Added: price: 9.99
18 Added: stock: 1
19 Added: notes: MyText
test/helpers/.keep
index 00000000..e69de29b 000000..100644
test/integration/.keep
index 00000000..e69de29b 000000..100644
test/mailers/.keep
index 00000000..e69de29b 000000..100644
test/models/.keep
index 00000000..e69de29b 000000..100644
test/models/wine_test.rb
index 00000000..fd6b6882 000000..100644
@@ -0,0 +1,7 @@
1 Added: require "test_helper"
2 Added:
3 Added: class WineTest < ActiveSupport::TestCase
4 Added: # test "the truth" do
5 Added: # assert true
6 Added: # end
7 Added: end
test/system/.keep
index 00000000..e69de29b 000000..100644
test/test_helper.rb
index 00000000..0c22470e 000000..100644
@@ -0,0 +1,15 @@
1 Added: ENV["RAILS_ENV"] ||= "test"
2 Added: require_relative "../config/environment"
3 Added: require "rails/test_help"
4 Added:
5 Added: module ActiveSupport
6 Added: class TestCase
7 Added: # Run tests in parallel with specified workers
8 Added: parallelize(workers: :number_of_processors)
9 Added:
10 Added: # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
11 Added: fixtures :all
12 Added:
13 Added: # Add more helper methods to be used by all tests here...
14 Added: end
15 Added: end
tmp/.keep
index 00000000..e69de29b 000000..100644
tmp/pids/.keep
index 00000000..e69de29b 000000..100644
tmp/storage/.keep
index 00000000..e69de29b 000000..100644