Permalink
Browse files

Refactor

Move SequelMarshallableMailMessage out of Mail namespace. into
Converters space
  • Loading branch information...
1 parent dbd1c1e commit 43f73cbd75d50f9f7cedb5ddc3b99f6cbfee56a1 @ywen2 ywen2 committed Mar 26, 2012
View
@@ -7,6 +7,6 @@ guard :rspectacle, :cli => '--format documentation --backtrace' do
watch(%r{^spec/.+_spec\.rb$})
watch('lib/redis_cache_mailer_delivery.rb') { ['spec/redis_cache_mailer_delivery_spec.rb', 'lib/redis_cache_mailer_delivery.rb' ] }
- watch('lib/redis_cache_mailer_delivery/mail/(.+).rb') {|m| ["spec/redis_cache_mailer_delivery/mail/#{m[1]}_spec.rb", "lib/redis_cache_mailer_delivery/mail/#{m[1]}.rb" ] }
- watch('lib/redis_cache_mailer_delivery/(.+).rb') {|m| ["spec/redis_cache_mailer_delivery/#{m[1]}_spec.rb", "lib/redis_cache_mailer_delivery/#{m[1]}.rb" ] }
+ watch(/lib\/redis_cache_mailer_delivery\/converters\/(.+).rb/) {|m| ["spec/redis_cache_mailer_delivery/converters/#{m[1]}_spec.rb", "lib/redis_cache_mailer_delivery/converters/#{m[1]}.rb" ] }
+ watch(/lib\/redis_cache_mailer_delivery\/(.+).rb/) {|m| ["spec/redis_cache_mailer_delivery/#{m[1]}_spec.rb", "lib/redis_cache_mailer_delivery/#{m[1]}.rb" ] }
end
@@ -1,7 +1,7 @@
require 'action_mailer'
require 'redis_cache_mailer_delivery/version'
require 'redis_cache_mailer_delivery/cache_delivery'
-require 'redis_cache_mailer_delivery/mail/sequel_marshallable_mail_message'
+require 'redis_cache_mailer_delivery/converters/sequel_marshallable_mail_message'
require 'redis_cache_mailer_delivery/deliveries'
module RedisCacheMailerDelivery
@@ -0,0 +1,13 @@
+module RedisCacheMailerDelivery
+ module Converters
+ module SequelMarshallableMailMessage
+ class << self
+ def marshallable(object)
+ return object unless object.respond_to?(:record)
+ object.record.marshallable! if object.record.respond_to?(:marshallable!)
+ object
+ end
+ end
+ end
+ end
+end
@@ -1,11 +0,0 @@
-module Mail
- module SequelMarshallableMailMessage
- class << self
- def marshallable(object)
- return object unless object.respond_to?(:record)
- object.record.marshallable! if object.record.respond_to?(:marshallable!)
- object
- end
- end
- end
-end
@@ -3,7 +3,7 @@ class MarshallableConverterSetting
attr_reader :converter_name
class << self
def builtin_settings
- { :sequel_record_marshallable => Mail::SequelMarshallableMailMessage }
+ { :sequel_record_marshallable => RedisCacheMailerDelivery::Converters::SequelMarshallableMailMessage }
end
end
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe Mail::SequelMarshallableMailMessage do
+describe RedisCacheMailerDelivery::Converters::SequelMarshallableMailMessage do
let(:object) {Class.new.new}
describe "#marshallable" do
context "when the message responds to the record message" do
@@ -4,7 +4,7 @@ module RedisCacheMailerDelivery
describe MarshallableConverterSetting do
describe ".builtin_settings" do
it "returns the hash of builtin marshallable converters" do
- described_class.builtin_settings.should eq({:sequel_record_marshallable => Mail::SequelMarshallableMailMessage})
+ described_class.builtin_settings.should eq({:sequel_record_marshallable => RedisCacheMailerDelivery::Converters::SequelMarshallableMailMessage})
end
end
describe "#marshallable_class" do

0 comments on commit 43f73cb

Please sign in to comment.