diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a57c5..23443c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## ContactUs 1.0.0 (Jan 15th 2015) + +* Fix Rails 4.2 deliver_later deprecation. +* Require Ruby 2+ + ## ContactUs 0.5.4 (Jun 25th 2014) * Added Greek locale. diff --git a/Gemfile b/Gemfile index 3e7a95d..041a08e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,4 @@ -source "http://rubygems.org" +source "https://rubygems.org" # Specify your gem's dependencies in contact_us.gemspec gemspec diff --git a/app/models/contact_us/contact.rb b/app/models/contact_us/contact.rb index e508113..2cb72dc 100644 --- a/app/models/contact_us/contact.rb +++ b/app/models/contact_us/contact.rb @@ -18,7 +18,7 @@ def initialize(attributes = {}) def save if self.valid? - ContactUs::ContactMailer.contact_email(self).deliver + ContactUs::ContactMailer.contact_email(self).deliver_now return true end return false diff --git a/contact_us.gemspec b/contact_us.gemspec index 4eda2c9..b19f9e4 100644 --- a/contact_us.gemspec +++ b/contact_us.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |s| s.summary = %q{Gem providing simple Contact Us functionality with a Rails 3+ Engine.} s.description = %q{A Rails 3+ Engine providing a basic contact form. I used Formtastic to keep things simple, and to hook into your apps custom Formtastic stylesheets.} - s.required_ruby_version = '>= 1.9.3' + s.required_ruby_version = '>= 2.0.0' s.rubyforge_project = "contact_us" s.files = `git ls-files`.split("\n") @@ -20,12 +20,12 @@ Gem::Specification.new do |s| s.require_paths = ["lib"] s.add_development_dependency "capybara", "~> 2.0" - s.add_development_dependency "rspec-rails", "~> 2.13" + s.add_development_dependency "rspec-rails", "~> 2.99" s.add_development_dependency "shoulda-matchers", ">= 1.5.4" s.add_development_dependency "simplecov", "~> 0.7" s.add_development_dependency "sqlite3", "~> 1.3.5" s.add_development_dependency "formtastic", ">= 2.1.0" s.add_development_dependency "simple_form" - s.add_runtime_dependency "rails", ">= 4.0.0" + s.add_runtime_dependency "rails", ">= 4.2.0" end diff --git a/lib/contact_us/version.rb b/lib/contact_us/version.rb index 33fed3a..51dd8e3 100644 --- a/lib/contact_us/version.rb +++ b/lib/contact_us/version.rb @@ -1,3 +1,3 @@ module ContactUs - VERSION = "0.5.4" + VERSION = "1.0.0" end diff --git a/spec/mailers/contact_us/contact_mailer_spec.rb b/spec/mailers/contact_us/contact_mailer_spec.rb index 92b9be2..a870025 100644 --- a/spec/mailers/contact_us/contact_mailer_spec.rb +++ b/spec/mailers/contact_us/contact_mailer_spec.rb @@ -47,13 +47,13 @@ end it "should deliver successfully" do - lambda { ContactUs::ContactMailer.contact_email(@contact).deliver }.should_not raise_error + lambda { ContactUs::ContactMailer.contact_email(@contact).deliver_now }.should_not raise_error end describe "and delivered" do it "should be added to the delivery queue" do - lambda { ContactUs::ContactMailer.contact_email(@contact).deliver }.should change(ActionMailer::Base.deliveries,:size).by(1) + lambda { ContactUs::ContactMailer.contact_email(@contact).deliver_now }.should change(ActionMailer::Base.deliveries,:size).by(1) end end diff --git a/spec/models/contact_us/contact_spec.rb b/spec/models/contact_us/contact_spec.rb index c88946b..94d32b9 100644 --- a/spec/models/contact_us/contact_spec.rb +++ b/spec/models/contact_us/contact_spec.rb @@ -48,7 +48,7 @@ it 'should send email and return true if records valid' do mail = Mail.new(:from=>"Valid@Email.com", :to => "test@test.com") - mail.stub(:deliver).and_return(true) + mail.stub(:deliver_now).and_return(true) contact = ContactUs::Contact.new(:email => "Valid@Email.com", :message => "Test") ContactUs::ContactMailer.should_receive(:contact_email).with(contact).and_return(mail) contact.save.should eql(true)