From 208b88126de1481094a77ce40610b842406d8875 Mon Sep 17 00:00:00 2001 From: Jean-Francis Bastien Date: Thu, 10 Apr 2025 09:17:26 -0400 Subject: [PATCH 1/4] WIP --- .ruby-version | 2 + Gemfile | 22 +- Gemfile.lock | 315 +- README.md | 6 + .../gravity_mailbox/mailbox/_mail.html.erb | 16 +- .../gravity_mailbox/mailbox/index.html.erb | 115 +- app/views/layouts/gravity_mailbox.html.erb | 12 +- gravity_mailbox.gemspec | 7 +- lib/gravity_mailbox/engine.rb | 6 +- .../gravity_mailbox/application.css | 8078 +++++++++++++++++ .../views/application_mailer/welcome.html.erb | 1 + .../views/application_mailer/welcome.text.erb | 1 + tailwind/application.css | 4 + tailwind/daisyui.js | 8 + 14 files changed, 8367 insertions(+), 226 deletions(-) create mode 100644 .ruby-version create mode 100644 public/stylesheets/gravity_mailbox/application.css create mode 100644 tailwind/application.css create mode 100644 tailwind/daisyui.js diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..e77b4d3 --- /dev/null +++ b/.ruby-version @@ -0,0 +1,2 @@ +3.3.7 + diff --git a/Gemfile b/Gemfile index 7d35961..c41f903 100644 --- a/Gemfile +++ b/Gemfile @@ -5,10 +5,18 @@ source 'https://rubygems.org' # Specify your gem's dependencies in gravity_mailbox.gemspec gemspec -gem 'combustion' -gem 'rails-controller-testing' -gem 'rake', '~> 13.0' -gem 'rspec' -gem 'rspec-rails' -gem 'rubocop' -gem 'rubocop-rspec' +group 'development' do + gem 'puma' + gem 'rake' + gem 'rubocop' + gem 'rubocop-rspec' + gem 'combustion' + gem 'tailwindcss-ruby' +end + +group 'test' do + gem 'rails-controller-testing' + gem 'rspec' + gem 'rspec-rails' +end + diff --git a/Gemfile.lock b/Gemfile.lock index e00e2c8..c79a336 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,205 +2,204 @@ PATH remote: . specs: gravity_mailbox (0.4.1) - rails (>= 6.0) + actionmailer (>= 7.0) + railties (>= 7.0) GEM remote: https://rubygems.org/ specs: - actioncable (6.1.7.3) - actionpack (= 6.1.7.3) - activesupport (= 6.1.7.3) - nio4r (~> 2.0) - websocket-driver (>= 0.6.1) - actionmailbox (6.1.7.3) - actionpack (= 6.1.7.3) - activejob (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) - mail (>= 2.7.1) - actionmailer (6.1.7.3) - actionpack (= 6.1.7.3) - actionview (= 6.1.7.3) - activejob (= 6.1.7.3) - activesupport (= 6.1.7.3) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (6.1.7.3) - actionview (= 6.1.7.3) - activesupport (= 6.1.7.3) - rack (~> 2.0, >= 2.0.9) - rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.1.7.3) - actionpack (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) + actionmailer (8.0.2) + actionpack (= 8.0.2) + actionview (= 8.0.2) + activejob (= 8.0.2) + activesupport (= 8.0.2) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (8.0.2) + actionview (= 8.0.2) + activesupport (= 8.0.2) nokogiri (>= 1.8.5) - actionview (6.1.7.3) - activesupport (= 6.1.7.3) + rack (>= 2.2.4) + rack-session (>= 1.0.1) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (8.0.2) + activesupport (= 8.0.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activejob (6.1.7.3) - activesupport (= 6.1.7.3) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (8.0.2) + activesupport (= 8.0.2) globalid (>= 0.3.6) - activemodel (6.1.7.3) - activesupport (= 6.1.7.3) - activerecord (6.1.7.3) - activemodel (= 6.1.7.3) - activesupport (= 6.1.7.3) - activestorage (6.1.7.3) - actionpack (= 6.1.7.3) - activejob (= 6.1.7.3) - activerecord (= 6.1.7.3) - activesupport (= 6.1.7.3) - marcel (~> 1.0) - mini_mime (>= 1.1.0) - activesupport (6.1.7.3) - concurrent-ruby (~> 1.0, >= 1.0.2) + activesupport (8.0.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - ast (2.4.2) - builder (3.2.4) - combustion (1.3.7) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + ast (2.4.3) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) + builder (3.3.0) + combustion (1.5.0) activesupport (>= 3.0.0) railties (>= 3.0.0) thor (>= 0.14.6) - concurrent-ruby (1.1.10) + concurrent-ruby (1.3.5) + connection_pool (2.5.0) crass (1.0.6) - date (3.3.3) - diff-lcs (1.5.0) - erubi (1.12.0) - globalid (1.1.0) - activesupport (>= 5.0) - i18n (1.12.0) + date (3.4.1) + diff-lcs (1.6.1) + drb (2.2.1) + erubi (1.13.1) + globalid (1.2.1) + activesupport (>= 6.1) + i18n (1.14.7) concurrent-ruby (~> 1.0) - json (2.6.2) - loofah (2.19.1) + io-console (0.8.0) + irb (1.15.1) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + json (2.10.2) + language_server-protocol (3.17.0.4) + lint_roller (1.1.0) + logger (1.7.0) + loofah (2.24.0) crass (~> 1.0.2) - nokogiri (>= 1.5.9) + nokogiri (>= 1.12.0) mail (2.8.1) mini_mime (>= 0.1.1) net-imap net-pop net-smtp - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.2) - mini_portile2 (2.8.2) - minitest (5.17.0) - net-imap (0.3.6) + mini_mime (1.1.5) + mini_portile2 (2.8.8) + minitest (5.25.5) + net-imap (0.5.6) date net-protocol net-pop (0.1.2) net-protocol - net-protocol (0.2.1) + net-protocol (0.2.2) timeout - net-smtp (0.3.3) + net-smtp (0.5.1) net-protocol - nio4r (2.5.9) - nokogiri (1.13.10) - mini_portile2 (~> 2.8.0) + nio4r (2.7.4) + nokogiri (1.18.7) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - parallel (1.22.1) - parser (3.1.2.1) + parallel (1.26.3) + parser (3.3.7.4) ast (~> 2.4.1) - racc (1.7.1) - rack (2.2.7) - rack-test (2.0.2) + racc + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + prism (1.4.0) + psych (5.2.3) + date + stringio + puma (6.6.0) + nio4r (~> 2.0) + racc (1.8.1) + rack (3.1.12) + rack-session (2.1.0) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) rack (>= 1.3) - rails (6.1.7.3) - actioncable (= 6.1.7.3) - actionmailbox (= 6.1.7.3) - actionmailer (= 6.1.7.3) - actionpack (= 6.1.7.3) - actiontext (= 6.1.7.3) - actionview (= 6.1.7.3) - activejob (= 6.1.7.3) - activemodel (= 6.1.7.3) - activerecord (= 6.1.7.3) - activestorage (= 6.1.7.3) - activesupport (= 6.1.7.3) - bundler (>= 1.15.0) - railties (= 6.1.7.3) - sprockets-rails (>= 2.0.0) + rackup (2.2.1) + rack (>= 3) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) activesupport (>= 5.0.1.rc1) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + rails-dom-testing (2.2.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.5.0) - loofah (~> 2.19, >= 2.19.1) - railties (6.1.7.3) - actionpack (= 6.1.7.3) - activesupport (= 6.1.7.3) - method_source + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + 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) + railties (8.0.2) + actionpack (= 8.0.2) + activesupport (= 8.0.2) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.0.6) - regexp_parser (2.6.0) - rexml (3.2.5) - rspec (3.12.0) - rspec-core (~> 3.12.0) - rspec-expectations (~> 3.12.0) - rspec-mocks (~> 3.12.0) - rspec-core (3.12.0) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.0) + rake (13.2.1) + rdoc (6.13.1) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + rspec (3.13.0) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.3) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (5.1.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.12.0) - rubocop (1.38.0) + rspec-support (~> 3.13.0) + rspec-rails (7.1.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.2) + rubocop (1.75.1) json (~> 2.3) + language_server-protocol (~> 3.17.0.2) + lint_roller (~> 1.1.0) parallel (~> 1.10) - parser (>= 3.1.2.1) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.23.0, < 2.0) + regexp_parser (>= 2.9.3, < 3.0) + rubocop-ast (>= 1.43.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.23.0) - parser (>= 3.1.1.0) - rubocop-rspec (2.17.1) - rubocop (~> 1.33) - ruby-progressbar (1.11.0) - sprockets (4.2.0) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - thor (1.2.2) - timeout (0.3.2) + unicode-display_width (>= 2.4.0, < 4.0) + rubocop-ast (1.43.0) + parser (>= 3.3.7.2) + prism (~> 1.4) + rubocop-rspec (3.5.0) + lint_roller (~> 1.1) + rubocop (~> 1.72, >= 1.72.1) + ruby-progressbar (1.13.0) + securerandom (0.4.1) + stringio (3.1.6) + tailwindcss-ruby (4.0.17) + thor (1.3.2) + timeout (0.4.3) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - unicode-display_width (2.3.0) - websocket-driver (0.7.5) - websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.5) - zeitwerk (2.6.8) + unicode-display_width (3.1.4) + unicode-emoji (~> 4.0, >= 4.0.4) + unicode-emoji (4.0.4) + uri (1.0.3) + useragent (0.16.11) + zeitwerk (2.7.2) PLATFORMS ruby @@ -208,12 +207,14 @@ PLATFORMS DEPENDENCIES combustion gravity_mailbox! + puma rails-controller-testing - rake (~> 13.0) + rake rspec rspec-rails rubocop rubocop-rspec + tailwindcss-ruby BUNDLED WITH - 2.2.3 + 2.5.22 diff --git a/README.md b/README.md index 7d826c3..1f19f95 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,12 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org). +### Build TailwindCSS + +```shell +bundle exec tailwindcss -w --optimize -i tailwind/application.css -o public/stylesheets/gravity_mailbox/application.css +``` + ### Standalone app Use `bundle exec rackup` to test locally the gem. Go to [http://localhost:9292](http://localhost:9292) diff --git a/app/views/gravity_mailbox/mailbox/_mail.html.erb b/app/views/gravity_mailbox/mailbox/_mail.html.erb index a8109b4..4f609bf 100644 --- a/app/views/gravity_mailbox/mailbox/_mail.html.erb +++ b/app/views/gravity_mailbox/mailbox/_mail.html.erb @@ -1,5 +1,7 @@ -
+
<%= mail.subject %> @@ -7,18 +9,14 @@