diff --git a/lib/departure/configuration.rb b/lib/departure/configuration.rb index 34e48cb9..4f19cfe2 100644 --- a/lib/departure/configuration.rb +++ b/lib/departure/configuration.rb @@ -1,5 +1,7 @@ module Departure class Configuration + SUPPORTED_ADAPTERS = %i[trilogy mysql2] + attr_accessor :tmp_path, :global_percona_args, :enabled_by_default, :redirect_stderr, :adapter def initialize @@ -15,6 +17,14 @@ def error_log_path File.join(tmp_path, error_log_filename) end + def adapter=(name) + if SUPPORTED_ADAPTERS.include?(name) + @adapter = name + else + raise ArgumentError, "Supported Departure adapters are #{SUPPORTED_ADAPTERS.inspect}" + end + end + private attr_reader :error_log_filename