Comments (9)
I looked into this a while ago when someone else had the same issue. It's odd that ThinkingSphinx is loading a lib into memory that is not being used. (Apparently a ticket is open to resolve that.) I looked into ways to address this but I could not come up with a nice clean way due to the way the DelayedJob support was originally added.
One easy fix might be to undefined the Delayed const before you load email-spec. Doing that would prevent email-spec from loading the background process module.
So.. in short there is way, currently, to disable this. I would like to see a patch that forces DelatedJob people to require 'email-spec/delayed_job' or something. I went down the path of creating this but it didn't work out. Too much module magic. :( Anyways, patches are welcome as I probably won't be addressing this myself anytime soon.
from email-spec.
er... I meant to say.. "in short there is no way, currently, to disable this"
from email-spec.
Ah I figured it out. Since background_processes.rb is using Delayed::Job not ::Delayed::Job, this solves the problem without affecting anything outside of email-spec:
module EmailSpec
module Delayed
class Job
def self.work_off
# nothing
end
end
end
end
I think I'm happy with that little hack for the time being :)
I was trying to do what you were describing: have people manually require 'email_spec/background_processes' in their env.rb... but I'm also having a ton a trouble getting the module magic to work... my meta-programming skills are failing me...
To me it seems like it should be as simple as getting rid of "include EmailSpec::BackgroundProcesses::Compatibility" in deliveries.rb:68 and getting rid of "require 'email_spec/background_processes'" on email_spec.rb:8 and changing background_processes.rb to insert itself into EmailSpec::Deliveries... I tried
EmailSpec::Deliveries.class_eval do
include EmailSpec::BackgroundProcesses::DelayedJob
end
but it doesn't seem to insert the EmailSpec::BackgroundProcesses::DelayedJob methods into the chain... oh well...
from email-spec.
Right, I ran into the same issue. I was able to reproduce it in an irb session. Basically, mixing in modules after the fact effects method delegation differently than as if it happens inline (as presently defined). I think a redesign of how that is all working would be in order. I'm thinking more objects as strategies and less modules and method chaining. :) Glad you got an acceptable work-around for now though.
from email-spec.
I'm working through this and a few other issues now. Stay tuned.
from email-spec.
Fix available at http://github.com/KieranP/email-spec/commit/51c8c8e916c320064d4211740f426827ab31e6ed
from email-spec.
For the ticket record, the check for Delayed was too wide, so also added a check for Delayed::Job or Delayed::Worker, which should help reduce conflicts.
from email-spec.
I haven't had this problem since I started using the gem version of email_spec 0.4.0 http://rubygems.org/gems/email_spec/versions/0.4.0
from email-spec.
Merged in all of Kieran's awesome patches and released 0.6.0.
from email-spec.
Related Issues (20)
- mail.html method useful? HOT 2
- Testing in isolation seems to fail HOT 1
- visit_in_email opens the wrong link
- Match have body text with special characters HOT 1
- Doesn't work anymore after upgrading Rails (ActionMailer::Base.deliveries is empty) HOT 3
- Email_spec causes rspec to fail (though not under Spring) HOT 5
- NameError: uninitialized constant RSpec::Expectations on current_email method
- NameError: uninitialized constant Delayed::DelayMail HOT 4
- Update to support mail gem 2.7 HOT 2
- `have_body_text` with URL now failing after upgrading `mail` gem from 2.6.6 to 2.7.0 HOT 3
- Incorrect parse of confirmation url generated by ahoy_email HOT 1
- Non compatible HTML entities encoding/decoding HOT 1
- New gem version HOT 2
- EmailSpec::CouldNotFindEmailError HOT 2
- checking for a mail in the queue with multiple properties HOT 1
- Add include_link matcher HOT 2
- I send my mail both via Pony and ActionMailer
- Getting uninitialized constant EmailSpec::Helpers HOT 5
- undefined local variable or method `reset_mailer' HOT 21
- 2.2.1 gem released but master is 2.2.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from email-spec.