gravity_mailbox 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.github/workflows/main.yml +18 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.rubocop.yml +8 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +127 -0
- data/LICENSE.txt +21 -0
- data/README.md +48 -0
- data/Rakefile +12 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/gravity_mailbox.gemspec +36 -0
- data/lib/gravity_mailbox/mailbox_controller.rb +46 -0
- data/lib/gravity_mailbox/rails_cache_delivery_method.rb +35 -0
- data/lib/gravity_mailbox/railtie.rb +23 -0
- data/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/_mail.html.erb +5 -0
- data/lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb +26 -0
- data/lib/gravity_mailbox/templates/layouts/application.html.erb +14 -0
- data/lib/gravity_mailbox/version.rb +5 -0
- data/lib/gravity_mailbox.rb +8 -0
- metadata +96 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 72867c424724e7388ae25f6eb519d509cfaf7bc6deb90de35eaa766bd6350e40
|
|
4
|
+
data.tar.gz: 4d0a7c8ca000e49aed8a878e5bcc402896ae61a97981acf71fcbdbac29d59bad
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 7b24028b7fc05777f0e727f0f4677c990226c255d705caba4a5bcf108e41ae969628faa0545e2f05c6feaab23452691bf016bab6903eff102463e2e7c5a7be53
|
|
7
|
+
data.tar.gz: 8824afef7b5bf9618186afc88371da4d3b3d275bed3d574795aa667745f3ae7fd9bd71d18deee7b86860991e370357f627f5963b5d8e969803296ab951a0801e
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Ruby
|
|
2
|
+
|
|
3
|
+
on: [push,pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- uses: actions/checkout@v2
|
|
10
|
+
- name: Set up Ruby
|
|
11
|
+
uses: ruby/setup-ruby@v1
|
|
12
|
+
with:
|
|
13
|
+
ruby-version: 2.6.6
|
|
14
|
+
- name: Run the default task
|
|
15
|
+
run: |
|
|
16
|
+
gem install bundler -v 2.2.3
|
|
17
|
+
bundle install
|
|
18
|
+
bundle exec rake
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
gravity_mailbox (0.1.0)
|
|
5
|
+
actionmailer (>= 5.2)
|
|
6
|
+
railties (>= 5.2)
|
|
7
|
+
|
|
8
|
+
GEM
|
|
9
|
+
remote: https://rubygems.org/
|
|
10
|
+
specs:
|
|
11
|
+
actionmailer (6.0.5.1)
|
|
12
|
+
actionpack (= 6.0.5.1)
|
|
13
|
+
actionview (= 6.0.5.1)
|
|
14
|
+
activejob (= 6.0.5.1)
|
|
15
|
+
mail (~> 2.5, >= 2.5.4)
|
|
16
|
+
rails-dom-testing (~> 2.0)
|
|
17
|
+
actionpack (6.0.5.1)
|
|
18
|
+
actionview (= 6.0.5.1)
|
|
19
|
+
activesupport (= 6.0.5.1)
|
|
20
|
+
rack (~> 2.0, >= 2.0.8)
|
|
21
|
+
rack-test (>= 0.6.3)
|
|
22
|
+
rails-dom-testing (~> 2.0)
|
|
23
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
|
24
|
+
actionview (6.0.5.1)
|
|
25
|
+
activesupport (= 6.0.5.1)
|
|
26
|
+
builder (~> 3.1)
|
|
27
|
+
erubi (~> 1.4)
|
|
28
|
+
rails-dom-testing (~> 2.0)
|
|
29
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
|
30
|
+
activejob (6.0.5.1)
|
|
31
|
+
activesupport (= 6.0.5.1)
|
|
32
|
+
globalid (>= 0.3.6)
|
|
33
|
+
activesupport (6.0.5.1)
|
|
34
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
35
|
+
i18n (>= 0.7, < 2)
|
|
36
|
+
minitest (~> 5.1)
|
|
37
|
+
tzinfo (~> 1.1)
|
|
38
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
|
39
|
+
ast (2.4.2)
|
|
40
|
+
builder (3.2.4)
|
|
41
|
+
concurrent-ruby (1.1.10)
|
|
42
|
+
crass (1.0.6)
|
|
43
|
+
diff-lcs (1.5.0)
|
|
44
|
+
erubi (1.11.0)
|
|
45
|
+
globalid (1.0.0)
|
|
46
|
+
activesupport (>= 5.0)
|
|
47
|
+
i18n (1.12.0)
|
|
48
|
+
concurrent-ruby (~> 1.0)
|
|
49
|
+
json (2.6.2)
|
|
50
|
+
loofah (2.19.0)
|
|
51
|
+
crass (~> 1.0.2)
|
|
52
|
+
nokogiri (>= 1.5.9)
|
|
53
|
+
mail (2.7.1)
|
|
54
|
+
mini_mime (>= 0.1.1)
|
|
55
|
+
method_source (1.0.0)
|
|
56
|
+
mini_mime (1.1.2)
|
|
57
|
+
mini_portile2 (2.8.0)
|
|
58
|
+
minitest (5.16.3)
|
|
59
|
+
nokogiri (1.13.9)
|
|
60
|
+
mini_portile2 (~> 2.8.0)
|
|
61
|
+
racc (~> 1.4)
|
|
62
|
+
parallel (1.22.1)
|
|
63
|
+
parser (3.1.2.1)
|
|
64
|
+
ast (~> 2.4.1)
|
|
65
|
+
racc (1.6.0)
|
|
66
|
+
rack (2.2.4)
|
|
67
|
+
rack-test (2.0.2)
|
|
68
|
+
rack (>= 1.3)
|
|
69
|
+
rails-dom-testing (2.0.3)
|
|
70
|
+
activesupport (>= 4.2.0)
|
|
71
|
+
nokogiri (>= 1.6)
|
|
72
|
+
rails-html-sanitizer (1.4.3)
|
|
73
|
+
loofah (~> 2.3)
|
|
74
|
+
railties (6.0.5.1)
|
|
75
|
+
actionpack (= 6.0.5.1)
|
|
76
|
+
activesupport (= 6.0.5.1)
|
|
77
|
+
method_source
|
|
78
|
+
rake (>= 0.8.7)
|
|
79
|
+
thor (>= 0.20.3, < 2.0)
|
|
80
|
+
rainbow (3.1.1)
|
|
81
|
+
rake (13.0.6)
|
|
82
|
+
regexp_parser (2.6.0)
|
|
83
|
+
rexml (3.2.5)
|
|
84
|
+
rspec (3.12.0)
|
|
85
|
+
rspec-core (~> 3.12.0)
|
|
86
|
+
rspec-expectations (~> 3.12.0)
|
|
87
|
+
rspec-mocks (~> 3.12.0)
|
|
88
|
+
rspec-core (3.12.0)
|
|
89
|
+
rspec-support (~> 3.12.0)
|
|
90
|
+
rspec-expectations (3.12.0)
|
|
91
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
92
|
+
rspec-support (~> 3.12.0)
|
|
93
|
+
rspec-mocks (3.12.0)
|
|
94
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
95
|
+
rspec-support (~> 3.12.0)
|
|
96
|
+
rspec-support (3.12.0)
|
|
97
|
+
rubocop (1.38.0)
|
|
98
|
+
json (~> 2.3)
|
|
99
|
+
parallel (~> 1.10)
|
|
100
|
+
parser (>= 3.1.2.1)
|
|
101
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
102
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
103
|
+
rexml (>= 3.2.5, < 4.0)
|
|
104
|
+
rubocop-ast (>= 1.23.0, < 2.0)
|
|
105
|
+
ruby-progressbar (~> 1.7)
|
|
106
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
107
|
+
rubocop-ast (1.23.0)
|
|
108
|
+
parser (>= 3.1.1.0)
|
|
109
|
+
ruby-progressbar (1.11.0)
|
|
110
|
+
thor (1.2.1)
|
|
111
|
+
thread_safe (0.3.6)
|
|
112
|
+
tzinfo (1.2.10)
|
|
113
|
+
thread_safe (~> 0.1)
|
|
114
|
+
unicode-display_width (2.3.0)
|
|
115
|
+
zeitwerk (2.6.6)
|
|
116
|
+
|
|
117
|
+
PLATFORMS
|
|
118
|
+
-darwin-21
|
|
119
|
+
|
|
120
|
+
DEPENDENCIES
|
|
121
|
+
gravity_mailbox!
|
|
122
|
+
rake (~> 13.0)
|
|
123
|
+
rspec
|
|
124
|
+
rubocop
|
|
125
|
+
|
|
126
|
+
BUNDLED WITH
|
|
127
|
+
2.2.3
|
data/LICENSE.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Jean-Francis Bastien
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# GravityMailbox
|
|
2
|
+
|
|
3
|
+
Development tools that aim to make it simple to visualize mail sent by your Rails app directly through your Rails app.
|
|
4
|
+
It works in development and also in a staging environment by using the `Rails.cache` to store the mails.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
Add this line to your application's Gemfile:
|
|
9
|
+
|
|
10
|
+
```ruby
|
|
11
|
+
gem 'gravity_mailbox'
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
And then execute:
|
|
15
|
+
|
|
16
|
+
$ bundle install
|
|
17
|
+
|
|
18
|
+
Or install it yourself as:
|
|
19
|
+
|
|
20
|
+
$ gem install gravity_mailbox
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
* Config ActionMailer to use the RailsCacheDeliveryMethod.
|
|
25
|
+
|
|
26
|
+
```ruby
|
|
27
|
+
config.action_mailer.delivery_method = :gravity_mailbox_rails_cache
|
|
28
|
+
config.action_mailer.perform_deliveries = true
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
* Send mails
|
|
32
|
+
* Go to http://localhost:3000/gravity_mailbox to see the mails.
|
|
33
|
+
|
|
34
|
+
<img width="520" alt="image" src="https://user-images.githubusercontent.com/7858787/201705867-74888ae2-fa6d-4678-a911-134ae5527100.png">
|
|
35
|
+
|
|
36
|
+
## Development
|
|
37
|
+
|
|
38
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
39
|
+
|
|
40
|
+
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).
|
|
41
|
+
|
|
42
|
+
## Contributing
|
|
43
|
+
|
|
44
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/petalmd/gravity_mailbox.
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
require 'bundler/setup'
|
|
5
|
+
require 'gravity_mailbox'
|
|
6
|
+
|
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
+
|
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
+
# require "pry"
|
|
12
|
+
# Pry.start
|
|
13
|
+
|
|
14
|
+
require 'irb'
|
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/gravity_mailbox/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'gravity_mailbox'
|
|
7
|
+
spec.version = GravityMailbox::VERSION
|
|
8
|
+
spec.authors = ['Jean-Francis Bastien']
|
|
9
|
+
spec.email = ['jfbastien@petalmd.com']
|
|
10
|
+
|
|
11
|
+
spec.summary = 'Write a short summary, because RubyGems requires one.'
|
|
12
|
+
spec.description = 'Write a longer description or delete this line.'
|
|
13
|
+
spec.homepage = 'https://github.com/petalmd/gravity_mailbox'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
|
|
16
|
+
|
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
18
|
+
spec.metadata['source_code_uri'] = 'https://github.com/petalmd/gravity_mailbox'
|
|
19
|
+
spec.metadata['changelog_uri'] = 'https://github.com/petalmd/gravity_mailbox/blob/main/CHANGELOG.md'
|
|
20
|
+
|
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
|
22
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
23
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
24
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
|
25
|
+
end
|
|
26
|
+
spec.bindir = 'exe'
|
|
27
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
|
28
|
+
spec.require_paths = ['lib']
|
|
29
|
+
|
|
30
|
+
# Uncomment to register a new dependency of your gem
|
|
31
|
+
spec.add_dependency 'actionmailer', '>= 5.2'
|
|
32
|
+
spec.add_dependency 'railties', '>= 5.2'
|
|
33
|
+
# For more information and examples about making a new gem, checkout our
|
|
34
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
|
35
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
36
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GravityMailbox
|
|
4
|
+
class MailboxController < ActionController::Base
|
|
5
|
+
self.view_paths = File.expand_path('templates', __dir__)
|
|
6
|
+
|
|
7
|
+
layout 'application'
|
|
8
|
+
|
|
9
|
+
before_action :set_mails, only: %i[index]
|
|
10
|
+
|
|
11
|
+
def index
|
|
12
|
+
@part = find_preferred_part(request.format, Mime[:html], Mime[:text]) if @mail
|
|
13
|
+
return unless params[:part]
|
|
14
|
+
|
|
15
|
+
response.content_type = 'text/html'
|
|
16
|
+
render plain: email_body
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def delete_all
|
|
20
|
+
RailsCacheDeliveryMethod.delete_all
|
|
21
|
+
redirect_to '/gravity_mailbox'
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
private
|
|
25
|
+
|
|
26
|
+
def find_preferred_part(*formats)
|
|
27
|
+
formats.each do |format|
|
|
28
|
+
part = @mail.find_first_mime_type(format)
|
|
29
|
+
return part if part
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
return unless formats.any? { |f| @mail.mime_type == f }
|
|
33
|
+
|
|
34
|
+
@mail
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def email_body
|
|
38
|
+
@mail.part[1].body.decoded
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def set_mails
|
|
42
|
+
@mails = RailsCacheDeliveryMethod.mails
|
|
43
|
+
@mail = @mails.detect { |m| m.message_id == params[:id] } if params[:id]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module GravityMailbox
|
|
4
|
+
class RailsCacheDeliveryMethod
|
|
5
|
+
KEY_PREFIX = 'gravity_mailbox/'
|
|
6
|
+
MAILS_LIST_KEY = "#{KEY_PREFIX}list"
|
|
7
|
+
|
|
8
|
+
def initialize(options)
|
|
9
|
+
@options = options
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def deliver!(mail)
|
|
13
|
+
key = "#{KEY_PREFIX}#{mail.message_id}"
|
|
14
|
+
Rails.cache.write(key, mail.encoded, expires_in: 1.week) # TODO: setting for expiration
|
|
15
|
+
actual_list = self.class.mail_keys
|
|
16
|
+
Rails.cache.write(MAILS_LIST_KEY, actual_list << key)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def self.mails
|
|
20
|
+
return [] if mail_keys.empty?
|
|
21
|
+
|
|
22
|
+
Rails.cache.read_multi(*mail_keys).values.map do |mail|
|
|
23
|
+
Mail.new(mail)
|
|
24
|
+
end.sort_by(&:date).reverse
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.delete_all
|
|
28
|
+
Rails.cache.delete_matched("#{KEY_PREFIX}*")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.mail_keys
|
|
32
|
+
Rails.cache.read(MAILS_LIST_KEY) || []
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'mailbox_controller'
|
|
4
|
+
|
|
5
|
+
module GravityMailbox
|
|
6
|
+
class Railtie < ::Rails::Railtie # :nodoc:
|
|
7
|
+
initializer 'gravity_mailbox.add_delivery_method' do
|
|
8
|
+
ActiveSupport.on_load :action_mailer do
|
|
9
|
+
ActionMailer::Base.add_delivery_method(
|
|
10
|
+
:gravity_mailbox_rails_cache,
|
|
11
|
+
RailsCacheDeliveryMethod
|
|
12
|
+
)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
config.after_initialize do |app|
|
|
17
|
+
app.routes.prepend do
|
|
18
|
+
get '/gravity_mailbox' => 'gravity_mailbox/mailbox#index', internal: true
|
|
19
|
+
post '/gravity_mailbox/delete_all' => 'gravity_mailbox/mailbox#delete_all', internal: true
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<div class="box <%= mail.message_id == params[:id] ? 'has-background-success-light' : '' %>">
|
|
2
|
+
<strong>Subject: </strong><%= link_to mail.subject, "?id=#{mail.message_id}" %> <br>
|
|
3
|
+
<strong>To: </strong><%= mail.to.join(', ') %><br>
|
|
4
|
+
<strong>Date: </strong><%= I18n.l(mail.date, format: :long) %><br>
|
|
5
|
+
</div>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<% content_for :style do %>
|
|
2
|
+
body, iframe {
|
|
3
|
+
height: 100vh;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
iframe {
|
|
7
|
+
border: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
}
|
|
10
|
+
<% end %>
|
|
11
|
+
|
|
12
|
+
<div class="columns mb-0 mt-0">
|
|
13
|
+
<div class="column is-one-quarter" style="max-height: 100vh; overflow: scroll">
|
|
14
|
+
<div class="section" style="padding: 1em;">
|
|
15
|
+
<%= button_to 'Delete all', '/gravity_mailbox/delete_all', class: ['button', 'is-danger'], method: :post %>
|
|
16
|
+
</div>
|
|
17
|
+
<% @mails.each do |mail| %>
|
|
18
|
+
<%= render partial: 'mail', locals: { mail: mail } %>
|
|
19
|
+
<% end %>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="column pb-0 pt-0">
|
|
22
|
+
<% if @mail %>
|
|
23
|
+
<iframe seamless name="messageBody" src="?part=true&id=<%= params[:id] %>"></iframe>
|
|
24
|
+
<% end %>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="viewport" content="width=device-width" />
|
|
5
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
|
|
6
|
+
|
|
7
|
+
<style>
|
|
8
|
+
<%= yield :style %>
|
|
9
|
+
</style>
|
|
10
|
+
</head>
|
|
11
|
+
<body>
|
|
12
|
+
<%= yield %>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
metadata
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: gravity_mailbox
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Jean-Francis Bastien
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: exe
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2022-11-15 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: actionmailer
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ">="
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '5.2'
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ">="
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '5.2'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: railties
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '5.2'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '5.2'
|
|
41
|
+
description: Write a longer description or delete this line.
|
|
42
|
+
email:
|
|
43
|
+
- jfbastien@petalmd.com
|
|
44
|
+
executables: []
|
|
45
|
+
extensions: []
|
|
46
|
+
extra_rdoc_files: []
|
|
47
|
+
files:
|
|
48
|
+
- ".github/workflows/main.yml"
|
|
49
|
+
- ".gitignore"
|
|
50
|
+
- ".rspec"
|
|
51
|
+
- ".rubocop.yml"
|
|
52
|
+
- CHANGELOG.md
|
|
53
|
+
- Gemfile
|
|
54
|
+
- Gemfile.lock
|
|
55
|
+
- LICENSE.txt
|
|
56
|
+
- README.md
|
|
57
|
+
- Rakefile
|
|
58
|
+
- bin/console
|
|
59
|
+
- bin/setup
|
|
60
|
+
- gravity_mailbox.gemspec
|
|
61
|
+
- lib/gravity_mailbox.rb
|
|
62
|
+
- lib/gravity_mailbox/mailbox_controller.rb
|
|
63
|
+
- lib/gravity_mailbox/rails_cache_delivery_method.rb
|
|
64
|
+
- lib/gravity_mailbox/railtie.rb
|
|
65
|
+
- lib/gravity_mailbox/templates/gravity_mailbox/mailbox/_mail.html.erb
|
|
66
|
+
- lib/gravity_mailbox/templates/gravity_mailbox/mailbox/index.html.erb
|
|
67
|
+
- lib/gravity_mailbox/templates/layouts/application.html.erb
|
|
68
|
+
- lib/gravity_mailbox/version.rb
|
|
69
|
+
homepage: https://github.com/petalmd/gravity_mailbox
|
|
70
|
+
licenses:
|
|
71
|
+
- MIT
|
|
72
|
+
metadata:
|
|
73
|
+
homepage_uri: https://github.com/petalmd/gravity_mailbox
|
|
74
|
+
source_code_uri: https://github.com/petalmd/gravity_mailbox
|
|
75
|
+
changelog_uri: https://github.com/petalmd/gravity_mailbox/blob/main/CHANGELOG.md
|
|
76
|
+
rubygems_mfa_required: 'true'
|
|
77
|
+
post_install_message:
|
|
78
|
+
rdoc_options: []
|
|
79
|
+
require_paths:
|
|
80
|
+
- lib
|
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
|
+
requirements:
|
|
83
|
+
- - ">="
|
|
84
|
+
- !ruby/object:Gem::Version
|
|
85
|
+
version: 2.6.0
|
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
|
+
requirements:
|
|
88
|
+
- - ">="
|
|
89
|
+
- !ruby/object:Gem::Version
|
|
90
|
+
version: '0'
|
|
91
|
+
requirements: []
|
|
92
|
+
rubygems_version: 3.0.3
|
|
93
|
+
signing_key:
|
|
94
|
+
specification_version: 4
|
|
95
|
+
summary: Write a short summary, because RubyGems requires one.
|
|
96
|
+
test_files: []
|