lib/mail_spy.rb in mail_spy-0.0.4 vs lib/mail_spy.rb in mail_spy-0.0.5

- old
+ new

@@ -1,6 +1,7 @@ require 'pp' #For debugging +require 'aws-sdk' require "mongoid" require "mail_spy/engine" require "mail_spy/manager" module MailSpy @@ -12,16 +13,21 @@ :address, :port, :authentication, :user_name, :password, :domain, :enable_starttls_auto, :name ) @@esps = {} - #@@config = MailSpyConfig.new + MailSpyConfig = Struct.new( + :tracker_host, :aws_access_key_id, + :aws_secret_access_key, :aws_campaign_bucket + ) + @@config = MailSpyConfig.new + # Allows the initializer to set the configuration - #def self.configure(&block) - # block.call(@@config) - #end + def self.configure(&block) + block.call(@@config) + end #TODO eventually have this be a view with a interface def self.add_email_service_provider(&block) esp = MailSpyESP.new block.call(esp) @@ -30,7 +36,26 @@ def self.esps @@esps end + def self.tracker_host + @@config.tracker_host + end + + def self.template_directory + @@config.template_directory + end + + def self.aws_access_key_id + @@config.aws_access_key_id + end + + def self.aws_secret_access_key + @@config.aws_secret_access_key + end + + def self.aws_campaign_bucket + @@config.aws_campaign_bucket + end end