lib/mailstro.rb in mailstro-0.0.10 vs lib/mailstro.rb in mailstro-0.1.0
- old
+ new
@@ -1,17 +1,18 @@
require 'faraday'
-require_relative "mailstro/version"
-require_relative "mailstro/configuration"
-require_relative "mailstro/error"
-require_relative "mailstro/resource"
-require_relative "mailstro/delivery"
+require_relative 'mailstro/version'
+require_relative 'mailstro/configuration'
+require_relative 'mailstro/error'
+require_relative 'mailstro/resource'
+require_relative 'mailstro/delivery'
+require_relative 'mailstro/test_strategy'
-module Mailstro
- # Allows us to remove default behaviour during testing.
- class RealStrategy
+module Mailstro
+ # We want this disabled by default to avoid accidental emails.
+ class ProductionStrategy
class << self
def deliver(email_name, options)
Delivery.new(email_name, options).deliver
end
end
@@ -19,10 +20,10 @@
class << self
attr_accessor :configuration, :strategy
end
- @strategy = RealStrategy
+ @strategy = TestStrategy
@configuration = Configuration.new
def self.configure
yield(@configuration) && @configuration.validate!
end