Commit 0f78e70
Changed files (5)
bin/test
@@ -5,4 +5,4 @@ set -e
cd "$(dirname "$0")/.."
-bundle exec rake spec
+bundle exec rspec $@
lib/minbox/publisher.rb
@@ -1,7 +1,5 @@
# frozen_string_literal: true
-require "redis"
-
module Minbox
class LogPublisher
def initialize(logger = Minbox.logger)
@@ -13,16 +11,6 @@ module Minbox
end
end
- class RedisPublisher
- def initialize(redis = Redis.new)
- @redis = redis
- end
-
- def publish(mail)
- @redis.publish("minbox", mail.to_s)
- end
- end
-
class FilePublisher
attr_reader :dir
@@ -39,7 +27,6 @@ module Minbox
class Publisher
REGISTERED_PUBLISHERS = {
stdout: LogPublisher,
- redis: RedisPublisher,
file: FilePublisher,
}.freeze
Gemfile.lock
@@ -2,76 +2,102 @@ PATH
remote: .
specs:
minbox (0.1.6)
+ base64 (~> 0.3)
concurrent-ruby (~> 1.1)
hashie (~> 3.6)
listen (~> 3.1)
+ logger (~> 1.0)
mail (~> 2.7)
- redis (~> 4.1)
- thor (~> 0.20)
+ net-smtp (~> 0.1)
+ openssl (~> 3.0)
+ thor (~> 1.0)
GEM
remote: https://rubygems.org/
specs:
- ast (2.4.0)
- bundler-audit (0.6.1)
+ ast (2.4.3)
+ base64 (0.3.0)
+ bundler-audit (0.9.2)
bundler (>= 1.2.0, < 3)
- thor (~> 0.18)
- concurrent-ruby (1.1.5)
- diff-lcs (1.3)
- faker (1.9.3)
+ thor (~> 1.0)
+ concurrent-ruby (1.3.5)
+ date (3.4.1)
+ diff-lcs (1.6.2)
+ faker (1.9.6)
i18n (>= 0.7)
- ffi (1.10.0)
+ ffi (1.17.2)
+ ffi (1.17.2-x86_64-linux-gnu)
hashie (3.6.0)
- i18n (1.6.0)
+ i18n (1.14.7)
concurrent-ruby (~> 1.0)
- jaro_winkler (1.5.2)
- listen (3.1.5)
- rb-fsevent (~> 0.9, >= 0.9.4)
- rb-inotify (~> 0.9, >= 0.9.7)
- ruby_dep (~> 1.2)
- mail (2.7.1)
+ listen (3.9.0)
+ rb-fsevent (~> 0.10, >= 0.10.3)
+ rb-inotify (~> 0.9, >= 0.9.10)
+ logger (1.7.0)
+ mail (2.8.1)
mini_mime (>= 0.1.1)
- mini_mime (1.0.1)
- parallel (1.17.0)
- parser (2.6.2.1)
- ast (~> 2.4.0)
- psych (3.1.0)
- rainbow (3.0.0)
- rake (13.0.3)
- rb-fsevent (0.10.3)
- rb-inotify (0.10.0)
+ net-imap
+ net-pop
+ net-smtp
+ mini_mime (1.1.5)
+ net-imap (0.5.10)
+ date
+ net-protocol
+ net-pop (0.1.2)
+ net-protocol
+ net-protocol (0.2.2)
+ timeout
+ net-smtp (0.5.1)
+ net-protocol
+ openssl (3.3.0)
+ parallel (1.27.0)
+ parser (3.3.9.0)
+ ast (~> 2.4.1)
+ racc
+ prism (1.5.1)
+ racc (1.8.1)
+ rainbow (3.1.1)
+ rake (13.3.0)
+ rb-fsevent (0.11.2)
+ rb-inotify (0.11.1)
ffi (~> 1.0)
- redis (4.1.0)
- rspec (3.8.0)
- rspec-core (~> 3.8.0)
- rspec-expectations (~> 3.8.0)
- rspec-mocks (~> 3.8.0)
- rspec-core (3.8.0)
- rspec-support (~> 3.8.0)
- rspec-expectations (3.8.2)
+ regexp_parser (2.11.3)
+ rexml (3.4.4)
+ rspec (3.13.1)
+ rspec-core (~> 3.13.0)
+ rspec-expectations (~> 3.13.0)
+ rspec-mocks (~> 3.13.0)
+ rspec-core (3.13.5)
+ rspec-support (~> 3.13.0)
+ rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.8.0)
- rspec-mocks (3.8.0)
+ rspec-support (~> 3.13.0)
+ rspec-mocks (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
- rspec-support (~> 3.8.0)
- rspec-support (3.8.0)
- rubocop (0.67.2)
- jaro_winkler (~> 1.5.1)
+ rspec-support (~> 3.13.0)
+ rspec-support (3.13.6)
+ rubocop (0.93.1)
parallel (~> 1.10)
- parser (>= 2.5, != 2.5.1.1)
- psych (>= 3.1.0)
+ parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
+ regexp_parser (>= 1.8)
+ rexml
+ rubocop-ast (>= 0.6.0)
ruby-progressbar (~> 1.7)
- unicode-display_width (>= 1.4.0, < 1.6)
- rubocop-rspec (1.32.0)
- rubocop (>= 0.60.0)
- ruby-progressbar (1.10.0)
- ruby_dep (1.5.0)
- thor (0.20.3)
- unicode-display_width (1.5.0)
+ unicode-display_width (>= 1.4.0, < 2.0)
+ rubocop-ast (1.47.1)
+ parser (>= 3.3.7.2)
+ prism (~> 1.4)
+ rubocop-rspec (1.44.1)
+ rubocop (~> 0.87)
+ rubocop-ast (>= 0.7.1)
+ ruby-progressbar (1.13.0)
+ thor (1.4.0)
+ timeout (0.4.3)
+ unicode-display_width (1.8.0)
PLATFORMS
- ruby
+ x86_64-linux
DEPENDENCIES
bundler (~> 2.0)
@@ -84,4 +110,4 @@ DEPENDENCIES
rubocop-rspec (~> 1.22)
BUNDLED WITH
- 2.0.1
+ 2.7.2
minbox.gemspec
@@ -35,12 +35,15 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
+ spec.add_dependency "base64", "~> 0.3"
spec.add_dependency "concurrent-ruby", "~> 1.1"
spec.add_dependency "hashie", "~> 3.6"
spec.add_dependency "listen", "~> 3.1"
+ spec.add_dependency "logger", "~> 1.0"
spec.add_dependency "mail", "~> 2.7"
- spec.add_dependency "redis", "~> 4.1"
- spec.add_dependency "thor", "~> 0.20"
+ spec.add_dependency "net-smtp", "~> 0.1"
+ spec.add_dependency "openssl", "~> 3.0"
+ spec.add_dependency "thor", "~> 1.0"
spec.add_development_dependency "bundler", "~> 2.0"
spec.add_development_dependency "bundler-audit", "~> 0.6"
spec.add_development_dependency "faker", "~> 1.9"
README.md
@@ -4,17 +4,13 @@ A minimal SMTP server written in ruby. `Minbox` offers a command line
interface and is useful for end-to-end test suites or as a standalone SMTP server
for development.
-`Minbox` is capable of publishing email messages to `stdout`, the `file`
-system or to `redis`.
+`Minbox` is capable of publishing email messages to `stdout`, or the `file`
+system.
The `file` system publisher will write all emails to `./tmp` of the
directory where you run minbox from. Each file is named with the format
of `<timestamp>.eml`.
-The `redis` publisher will publish all emails to a channel named
-`minbox`. Use the `REDIS_URL` environment variable to control the redis
-client configuration. See [this](https://github.com/redis/redis-rb/blob/df07a4c90413ed5dda7bc8fe928b00aaad5462fa/lib/redis/client.rb#L9) for more information.
-
## Installation
Add this line to your application's Gemfile:
@@ -52,10 +48,10 @@ D, [2019-03-12T17:08:19.679380 #36618] DEBUG -- : Server started!
You can use the `--output` option to configure the different types of
publishers to publish to. The following example will publish emails to
-`stdout`, `file` system, and `redis`.
+`stdout`, and `file` system.
```bash
-モ minbox server localhost 8080 --output=stdout file redis
+モ minbox server localhost 8080 --output=stdout file
D, [2019-03-12T17:16:03.564426 #36907] DEBUG -- : Starting server on port 8080...
D, [2019-03-12T17:16:03.565964 #36907] DEBUG -- : Server started!
```