Skip to content
Browse files

first commit

  • Loading branch information...
0 parents commit 8ab86f5018b6c77b998d2d1a16c580956598ae56 @scottwater committed Sep 4, 2011
Showing with 161 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +1 −0 .rbenv-gemsets
  3. +4 −0 Gemfile
  4. +83 −0 Gemfile.lock
  5. +1 −0 Rakefile
  6. +40 −0 lib/resque_mail_queue.rb
  7. +29 −0 resque_mail_queue.gemspec
3 .gitignore
@@ -0,0 +1,3 @@
+*.gem
+.bundle
+pkg/*
1 .rbenv-gemsets
@@ -0,0 +1 @@
+resque_mail_queue global
4 Gemfile
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in resque_mail_queue.gemspec
+gemspec
83 Gemfile.lock
@@ -0,0 +1,83 @@
+PATH
+ remote: .
+ specs:
+ resque_mail_queue (0.0.1)
+ actionmailer (~> 3.0.0)
+ resque (>= 1.1.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.10)
+ actionpack (= 3.0.10)
+ mail (~> 2.2.19)
+ actionpack (3.0.10)
+ activemodel (= 3.0.10)
+ activesupport (= 3.0.10)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.5.0)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.14)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.10)
+ activesupport (= 3.0.10)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activesupport (3.0.10)
+ builder (2.1.2)
+ diff-lcs (1.1.3)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ i18n (0.5.0)
+ mail (2.2.19)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ multi_json (1.0.3)
+ polyglot (0.3.2)
+ rack (1.2.3)
+ rack-mount (0.6.14)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ redis (2.2.2)
+ redis-namespace (1.0.3)
+ redis (< 3.0.0)
+ resque (1.19.0)
+ multi_json (~> 1.0)
+ redis-namespace (~> 1.0.2)
+ sinatra (>= 0.9.2)
+ vegas (~> 0.1.2)
+ resque_spec (0.7.0)
+ resque (>= 1.15.0)
+ rspec (>= 2.5.0)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ sinatra (1.2.6)
+ rack (~> 1.1)
+ tilt (>= 1.2.2, < 2.0)
+ tilt (1.3.3)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.29)
+ vegas (0.1.8)
+ rack (>= 1.0.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ resque_mail_queue!
+ resque_spec (>= 0.7.0)
1 Rakefile
@@ -0,0 +1 @@
+require "bundler/gem_tasks"
40 lib/resque_mail_queue.rb
@@ -0,0 +1,40 @@
+module Resque
+ module MailQueue
+ extend self
+
+ def queue
+ :default
+ end
+
+ def perform(options = {})
+ options = options.with_indifferent_access
+
+ mailer = options[:klass].constantize
+ method = options[:method]
+ mailer.send(method, *options[:args]).deliver
+ end
+
+ def enqueue()
+ EnqueueProxy.new(self)
+ end
+
+ class EnqueueProxy
+
+ def initialize(klass)
+ @klass = klass
+ end
+
+ def method_missing(m, *args, &block)
+ if @klass.respond_to? m
+ options = {:klass => @klass.to_s, :method => m, :args => args}
+ Resque.enqueue(MailQueue, options)
+ else
+ super
+ end
+ end
+
+ end
+
+ VERSION = '0.0.1'
+ end
+end
29 resque_mail_queue.gemspec
@@ -0,0 +1,29 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "lib/resque_mail_queue"
+
+Gem::Specification.new do |s|
+ s.name = "resque_mail_queue"
+ s.version = Resque::MailQueue::VERSION
+ s.authors = ["Scott Watermasysk"]
+ s.email = ["scottwater@gmail.com"]
+ s.homepage = ""
+ s.summary = %q{TODO: Write a gem summary}
+ s.description = %q{TODO: Write a gem description}
+
+ s.rubyforge_project = "resque_mail_queue"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+
+ s.add_dependency 'actionmailer', '~> 3.0.0'
+ s.add_dependency 'resque', '>= 1.1.0'
+ s.add_development_dependency 'resque_spec', '>= 0.7.0'
+
+
+ # specify any dependencies here; for example:
+ # s.add_development_dependency "rspec"
+ # s.add_runtime_dependency "rest-client"
+end

0 comments on commit 8ab86f5

Please sign in to comment.
Something went wrong with that request. Please try again.