Closed gmcgibbon closed 5 years ago
except for the "configure" api change looks fine to me, can you update the README with updated perf numbers and instructions on how to use the new custom db?
Yeah I say we remove it
On Wed, 20 Feb 2019 at 8:48 am, Gannon McGibbon notifications@github.com wrote:
@gmcgibbon commented on this pull request.
In test/mini_mime_test.rb https://github.com/discourse/mini_mime/pull/24#discussion_r258244352:
@@ -10,6 +10,12 @@ def test_that_it_has_a_version_number
refute_nil ::MiniMime::VERSION
end
def test_configure
MiniMime.configure do |config|
See https://thoughtbot.com/blog/mygem-configure-block. Its a configuration pattern I see a lot in ruby gems (1 https://github.com/carrierwaveuploader/carrierwave#configuring-carrierwave, 2 https://docs.bugsnag.com/platforms/ruby/rails/configuration-options/, 3 https://github.com/doorkeeper-gem/doorkeeper#api-mode). While it hides the detail of referencing MiniMime::Configuration, it's not exactly necessary. You could just do MiniMime::Configuration.var = value instead. Shall I 🔥 it?
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/discourse/mini_mime/pull/24#discussion_r258244352, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAUXa0hBQIgrE5MlUo1R3nXUi1kfBiiks5vPHE7gaJpZM4bD59w .
Added docs, updated benchmark, and removed the configure method.
looks good to me! merging, thanks
Closes https://github.com/discourse/mini_mime/issues/23.
Adds
MiniMime::Configuration
for changing DB paths. This avoids having to instantiate multiple databases of the same kind and provides a simple API for switching out:I'm happy to change/rewrite the implementation if need be.
Benchmark before:
Benchmark after: