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..b2ef987 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 'combustion' + gem 'puma' + gem 'rake' + gem 'rerun' + gem 'rubocop' + gem 'rubocop-rspec' + 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..fbe0a24 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,205 +2,213 @@ 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) + ffi (1.17.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) + listen (3.9.0) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + 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) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + rdoc (6.13.1) + psych (>= 4.0.0) + regexp_parser (2.10.0) + reline (0.6.0) + io-console (~> 0.5) + rerun (0.14.0) + listen (~> 3.0) + 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 +216,15 @@ PLATFORMS DEPENDENCIES combustion gravity_mailbox! + puma rails-controller-testing - rake (~> 13.0) + rake + rerun rspec rspec-rails rubocop rubocop-rspec + tailwindcss-ruby BUNDLED WITH - 2.2.3 + 2.5.22 diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..7863054 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +web: bundle exec rerun --dir app,lib --pattern '**/*.*rb' -- bundle exec rackup +tailwind: bundle exec tailwindcss -w --optimize -i tailwind/application.css -o public/stylesheets/gravity_mailbox/application.css diff --git a/README.md b/README.md index 7d826c3..d924951 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To Use `bundle exec rackup` to test locally the gem. Go to [http://localhost:9292](http://localhost:9292) Use the button to send a test mail and to see those mail into GravityMailbox. +```shell +foreman start +``` + ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/petalmd/gravity_mailbox. diff --git a/app/views/gravity_mailbox/mailbox/_mail.html.erb b/app/views/gravity_mailbox/mailbox/_mail.html.erb index a8109b4..e333764 100644 --- a/app/views/gravity_mailbox/mailbox/_mail.html.erb +++ b/app/views/gravity_mailbox/mailbox/_mail.html.erb @@ -1,51 +1,46 @@ - -
-
-
- <%= mail.subject %> +
+
+
+ <%= mail.subject %>
-
- - <% mail.to.each do |email_to| %> - <%= content_tag(:p, email_to, class: ['has-text-weight-light'], style: "font-size: 0.85rem") %> - <% end %> -
- - <%= time_ago_in_words(mail.date) %> - +
+ <% mail.to.each do |email_to| %> +

<%= email_to %>

+ <% end %> +
+
+ + <%= time_ago_in_words(mail.date) %> ago +
diff --git a/app/views/gravity_mailbox/mailbox/index.html.erb b/app/views/gravity_mailbox/mailbox/index.html.erb index 9df9161..215a807 100644 --- a/app/views/gravity_mailbox/mailbox/index.html.erb +++ b/app/views/gravity_mailbox/mailbox/index.html.erb @@ -1,5 +1,5 @@ <% content_for :style do %> - body, iframe { + body, iframe { height: 100vh; } @@ -7,167 +7,72 @@ border: 0; width: 100%; } - - .navbar { - background-color: #007bff !important; - } - - .navbar-brand > h1 { - font-family: 'Righteous', cursive !important; - } - - .mail-list-column { - height: 100vh; - overflow: scroll; - min-width: 20em; - } - - .link-button { - background: none!important; - border: none; - padding: 0!important; - font-family: arial, sans-serif; - color: #000; - cursor: pointer; - width: 100%; - text-align: left; - } - - .mail-list-item { - background-color: #fff!important; - padding: 1rem; - box-shadow: inset 0 -1px 0 0 rgb(100 121 143 / 12%) !important; - } - - .mail-list-item.selected-mail { - background-color: #ffffff!important; - border-left: 8px solid #ed900c; - padding-left: calc(1rem - 8px); - } - - .mail-list-item:hover { - cursor: pointer !important; - border-left: 8px solid lightgrey; - padding-left: calc(1rem - 8px); - } - - .mail-list-item.selected-mail:hover { - border-left: 8px solid #ed900c; - } - - #iframe-mail-container { - background-color: whitesmoke !important; - } - - .dropdown-trigger:hover { - cursor: pointer !important; - } - - .dropdown-item:hover { - background-color: whitesmoke !important; - } <% end %> -
-
-