letter_opener-web 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9515ad00e845f2393ebefc4d984be4bb884a647a
4
- data.tar.gz: 1ecbcf502ff736782e1e46ddc34f0e4f8edfb8e0
3
+ metadata.gz: 63799bcbf6f198b95803aa6b41bc491c9ee429af
4
+ data.tar.gz: 47d96f806c12f923af86466aaf4eac365e1c1a1f
5
5
  SHA512:
6
- metadata.gz: e68cb5961356b4003848fe48df6ee431e5f591907f1136aa65bb66b3d9062fbd1c70d1fd372d796e5c6b114ee112319f029a73b57e08bbfdb6e0db14f32ae935
7
- data.tar.gz: 6ec6458f7792b0f2f3e0586efd6e340a40b9e8669bcd8cb7740a296e9d40cb30e3303bda511faeceb9f9c1376180a021140f09e6cb5da244d97c22f226c07fdd
6
+ metadata.gz: 03220af9990d9c67d891e83edbc8af01c34f323c6f3ff8ff97c8235e07edc5f2db9792d3b7ed5345fd9a2c867eebe6a7b8b613c0917f7b0c7f1902adfa493814
7
+ data.tar.gz: d329779f223e49a76f77f6496104b169b45a3d50df1ba3c3aac172d1a8d0724d512e2a6bc925e353b76379ef6fbd82454d423c46e9d76b7cb6c5fc6d740798f6
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # LetterOpener::Web
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/letter_opener-web.svg)](http://badge.fury.io/rb/letter_opener-web)
3
4
  [![Build Status](https://travis-ci.org/tyabe/letter_opener-web.svg)](https://travis-ci.org/tyabe/letter_opener-web)
4
5
 
5
6
  A Sinatra-based frontend to the [letter_opener](https://github.com/ryanb/letter_opener).
@@ -39,12 +40,16 @@ Then set the delivery method and mount app in `config/apps.rb`
39
40
 
40
41
  ```ruby
41
42
  Padrino.configure_apps do
42
- # If you will specify a message file location.
43
- # LetterOpener.location = Padrino.root('tmp/letter_opener')
44
- set :delivery_method, LetterOpener::DeliveryMethod => {}
43
+ if Padrino.env == :development
44
+ # If you will specify a message file location.
45
+ # LetterOpener.location = Padrino.root('tmp/letter_opener')
46
+ set :delivery_method, LetterOpener::DeliveryMethod => {}
47
+ end
45
48
  end
46
49
 
47
- Padrino.mount('LetterOpener::Web::App').to('/inbox')
50
+ if Padrino.env == :development
51
+ Padrino.mount('LetterOpener::Web::App').to('/inbox')
52
+ end
48
53
  Padrino.mount('SampleProject::App', :app_file => Padrino.root('app/app.rb')).to('/')
49
54
  ```
50
55
 
@@ -56,9 +61,11 @@ module Sample
56
61
  class App < Sinatra::Base
57
62
  configure do
58
63
  set :root, File.dirname(__FILE__)
59
- LetterOpener.location = File.join("#{root}/tmp")
60
- Mail.defaults do
61
- delivery_method LetterOpener::DeliveryMethod
64
+ if ENV['RACK_ENV'] == 'development'
65
+ LetterOpener.location = File.join("#{root}/tmp")
66
+ Mail.defaults do
67
+ delivery_method LetterOpener::DeliveryMethod
68
+ end
62
69
  end
63
70
  end
64
71
  end
@@ -78,7 +85,7 @@ end
78
85
 
79
86
  ## Contributing
80
87
 
81
- 1. Fork it ( https://github.com/[my-github-username]/letter_opener-web/fork )
88
+ 1. Fork it ( https://github.com/tyabe/letter_opener-web/fork )
82
89
  2. Create your feature branch (`git checkout -b my-new-feature`)
83
90
  3. Commit your changes (`git commit -am 'Add some feature'`)
84
91
  4. Push to the branch (`git push origin my-new-feature`)
@@ -1,6 +1,9 @@
1
1
  require 'yaml'
2
2
  module LetterOpener
3
3
  class DeliveryMethod
4
+ class InvalidOption < StandardError; end
5
+
6
+ attr_accessor :settings
4
7
 
5
8
  def initialize(options = {})
6
9
  raise InvalidOption, "A location option is required when using the Letter Opener delivery method" if LetterOpener.location.nil?
@@ -11,6 +11,13 @@ module LetterOpener
11
11
 
12
12
  enable :method_override
13
13
 
14
+ if defined?(Padrino) && Padrino.version < '0.12.0'
15
+ def self.dependencies; []; end
16
+ def self.setup_application!; end
17
+ def self.reload!; end
18
+ set :erb, :engine_class => Padrino::Erubis::SafeBufferTemplate
19
+ end
20
+
14
21
  def root_path
15
22
  "#{env['SCRIPT_NAME']}/"
16
23
  end
@@ -1,5 +1,5 @@
1
1
  module LetterOpener
2
2
  module Web
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_opener-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takeshi Yabe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-16 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: letter_opener