Git Product home page Git Product logo

Comments (9)

bmabey avatar bmabey commented on May 28, 2024

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.

bmabey avatar bmabey commented on May 28, 2024

er... I meant to say.. "in short there is no way, currently, to disable this"

from email-spec.

agibralter avatar agibralter commented on May 28, 2024

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.

bmabey avatar bmabey commented on May 28, 2024

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.

KieranP avatar KieranP commented on May 28, 2024

I'm working through this and a few other issues now. Stay tuned.

from email-spec.

KieranP avatar KieranP commented on May 28, 2024

Fix available at http://github.com/KieranP/email-spec/commit/51c8c8e916c320064d4211740f426827ab31e6ed

from email-spec.

KieranP avatar KieranP commented on May 28, 2024

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.

agibralter avatar agibralter commented on May 28, 2024

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.

bmabey avatar bmabey commented on May 28, 2024

Merged in all of Kieran's awesome patches and released 0.6.0.

from email-spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.