Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #23 from nashby/gemfiles

test against actionmailer 3.0, 3.1, 3.2, 4.0
  • Loading branch information...
commit 9dbc4413abc22ba450878b65c78825624b641fba 2 parents 1686fef + 9eb05f0
@rafaelfranca rafaelfranca authored
View
9 .travis.yml
@@ -4,7 +4,16 @@ rvm:
- ree
- jruby-18mode
gemfile:
+ - gemfiles/Gemfile-rails.3.0.x
+ - gemfiles/Gemfile-rails.3.1.x
+ - gemfiles/Gemfile-rails.3.2.x
- Gemfile
+matrix:
+ exclude:
+ - rvm: ree
+ gemfile: Gemfile
+ - rvm: jruby-18mode
+ gemfile: Gemfile
notifications:
recipients:
- jose.valim@plataformatec.com.br
View
5 Gemfile
@@ -1,6 +1,9 @@
-source :rubygems
+source 'https://rubygems.org'
gemspec
gem 'rake'
gem 'rdoc'
+
+gem 'actionmailer', '~> 4.0.0.beta1'
+gem 'activemodel', '~> 4.0.0.beta1'
View
77 Gemfile.lock
@@ -1,66 +1,63 @@
PATH
remote: .
specs:
- mail_form (1.3.0)
- actionmailer (~> 3.0)
+ mail_form (1.4.0)
+ actionmailer (>= 3.0)
+ activemodel (>= 3.0)
GEM
- remote: http://rubygems.org/
+ remote: https://rubygems.org/
specs:
- actionmailer (3.2.9)
- actionpack (= 3.2.9)
- mail (~> 2.4.4)
- actionpack (3.2.9)
- activemodel (= 3.2.9)
- activesupport (= 3.2.9)
- builder (~> 3.0.0)
+ actionmailer (4.0.0.beta1)
+ actionpack (= 4.0.0.beta1)
+ mail (~> 2.5.3)
+ actionpack (4.0.0.beta1)
+ activesupport (= 4.0.0.beta1)
+ builder (~> 3.1.0)
erubis (~> 2.7.0)
- journey (~> 1.0.4)
- rack (~> 1.4.0)
- rack-cache (~> 1.2)
- rack-test (~> 0.6.1)
- sprockets (~> 2.2.1)
- activemodel (3.2.9)
- activesupport (= 3.2.9)
- builder (~> 3.0.0)
- activesupport (3.2.9)
- i18n (~> 0.6)
- multi_json (~> 1.0)
- builder (3.0.4)
+ rack (~> 1.5.2)
+ rack-test (~> 0.6.2)
+ activemodel (4.0.0.beta1)
+ activesupport (= 4.0.0.beta1)
+ builder (~> 3.1.0)
+ activesupport (4.0.0.beta1)
+ i18n (~> 0.6.2)
+ minitest (~> 4.2)
+ multi_json (~> 1.3)
+ thread_safe (~> 0.1)
+ tzinfo (~> 0.3.33)
+ atomic (1.0.1)
+ builder (3.1.4)
erubis (2.7.0)
- hike (1.2.1)
- i18n (0.6.1)
- journey (1.0.4)
- json (1.7.5)
- mail (2.4.4)
+ i18n (0.6.4)
+ json (1.7.7)
+ mail (2.5.3)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
- mime-types (1.19)
- multi_json (1.3.7)
+ mime-types (1.21)
+ minitest (4.7.0)
+ multi_json (1.7.2)
polyglot (0.3.3)
- rack (1.4.1)
- rack-cache (1.2)
- rack (>= 0.4)
+ rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
- rake (10.0.2)
- rdoc (3.12)
+ rake (10.0.3)
+ rdoc (4.0.0)
json (~> 1.4)
- sprockets (2.2.1)
- hike (~> 1.2)
- multi_json (~> 1.0)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- tilt (1.3.3)
+ thread_safe (0.1.0)
+ atomic
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
+ tzinfo (0.3.37)
PLATFORMS
ruby
DEPENDENCIES
+ actionmailer (~> 4.0.0.beta1)
+ activemodel (~> 4.0.0.beta1)
mail_form!
rake
rdoc
View
9 gemfiles/Gemfile-rails.3.0.x
@@ -0,0 +1,9 @@
+source 'https://rubygems.org'
+
+gem 'mail_form', :path => '..'
+
+gem 'rake'
+gem 'rdoc'
+
+gem 'actionmailer', '~> 3.0.0'
+gem 'activemodel', '~> 3.0.0'
View
9 gemfiles/Gemfile-rails.3.1.x
@@ -0,0 +1,9 @@
+source 'https://rubygems.org'
+
+gem 'mail_form', :path => '..'
+
+gem 'rake'
+gem 'rdoc'
+
+gem 'actionmailer', '~> 3.1.0'
+gem 'activemodel', '~> 3.1.0'
View
9 gemfiles/Gemfile-rails.3.2.x
@@ -0,0 +1,9 @@
+source 'https://rubygems.org'
+
+gem 'mail_form', :path => '..'
+
+gem 'rake'
+gem 'rdoc'
+
+gem 'actionmailer', '~> 3.2.0'
+gem 'activemodel', '~> 3.2.0'
View
17 lib/mail_form/notifier.rb
@@ -1,5 +1,20 @@
module MailForm
class Notifier < ActionMailer::Base
+ # since ActionMailer 3.0 has own simple_format method
+ # but we need one from the ActionPack
+ # https://github.com/rails/rails/commit/fb34f8577c47d958ca32b7ab585c1904e1a776b1
+ helper do
+ def simple_format(text, html_options={}, options={})
+ @text_helper ||= Class.new do
+ include ActionView::Helpers::TextHelper
+ include ActionView::Helpers::TagHelper
+ include ActionView::Helpers::SanitizeHelper
+ end.new
+
+ @text_helper.simple_format(text, html_options, options)
+ end
+ end
+
self.mailer_name = "mail_form"
append_view_path File.expand_path('../views', __FILE__)
@@ -22,4 +37,4 @@ def contact(resource)
mail(headers)
end
end
-end
+end
View
2  lib/mail_form/shim.rb
@@ -46,7 +46,7 @@ def id
# Create just check validity, and if so, trigger callbacks.
def deliver
if valid?
- _run_deliver_callbacks { true }
+ run_callbacks :deliver
else
false
end
View
5 lib/mail_form/views/mail_form/contact.erb
@@ -22,8 +22,9 @@
value = @resource.request.send(attribute)
value = if value.is_a?(Hash) && !value.empty?
- list = value.to_a.map{ |k,v| content_tag(:li, h("#{k}: #{v.inspect}")) }.join("\n")
- content_tag(:ul, raw(list), :style => "list-style:none;")
+ content_tag(:ul, :style => "list-style:none;") do
+ value.to_a.map{ |k,v| content_tag(:li, h("#{k}: #{v.inspect}")) }.reduce{ |list, li| list << li << '\n'.html_safe }
+ end
elsif value.is_a?(String)
value
else
View
3  mail_form.gemspec
@@ -18,5 +18,6 @@ Gem::Specification.new do |s|
s.rubyforge_project = "mail_form"
- s.add_dependency('actionmailer', '~> 3.0')
+ s.add_dependency('actionmailer', '>= 3.0')
+ s.add_dependency('activemodel', '>= 3.0')
end
Please sign in to comment.
Something went wrong with that request. Please try again.