README.md in letter_opener-web-0.1.0 vs README.md in letter_opener-web-0.1.1
- old
+ new
@@ -1,7 +1,8 @@
# LetterOpener::Web
+[![Gem Version](https://badge.fury.io/rb/letter_opener-web.svg)](http://badge.fury.io/rb/letter_opener-web)
[![Build Status](https://travis-ci.org/tyabe/letter_opener-web.svg)](https://travis-ci.org/tyabe/letter_opener-web)
A Sinatra-based frontend to the [letter_opener](https://github.com/ryanb/letter_opener).
This provides almost the same feature as the [letter_opener_web](https://github.com/fgrehm/letter_opener_web).
letter_opener_web is Rails based application. It's very useful.
@@ -37,16 +38,20 @@
Then set the delivery method and mount app in `config/apps.rb`
```ruby
Padrino.configure_apps do
- # If you will specify a message file location.
- # LetterOpener.location = Padrino.root('tmp/letter_opener')
- set :delivery_method, LetterOpener::DeliveryMethod => {}
+ if Padrino.env == :development
+ # If you will specify a message file location.
+ # LetterOpener.location = Padrino.root('tmp/letter_opener')
+ set :delivery_method, LetterOpener::DeliveryMethod => {}
+ end
end
-Padrino.mount('LetterOpener::Web::App').to('/inbox')
+if Padrino.env == :development
+ Padrino.mount('LetterOpener::Web::App').to('/inbox')
+end
Padrino.mount('SampleProject::App', :app_file => Padrino.root('app/app.rb')).to('/')
```
## Sinatra Sample
@@ -54,13 +59,15 @@
# app.rb
module Sample
class App < Sinatra::Base
configure do
set :root, File.dirname(__FILE__)
- LetterOpener.location = File.join("#{root}/tmp")
- Mail.defaults do
- delivery_method LetterOpener::DeliveryMethod
+ if ENV['RACK_ENV'] == 'development'
+ LetterOpener.location = File.join("#{root}/tmp")
+ Mail.defaults do
+ delivery_method LetterOpener::DeliveryMethod
+ end
end
end
end
end
```
@@ -76,10 +83,10 @@
end
```
## Contributing
-1. Fork it ( https://github.com/[my-github-username]/letter_opener-web/fork )
+1. Fork it ( https://github.com/tyabe/letter_opener-web/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request