module EXEL
Provides methods to configure EXEL
rubocop:disable Lint/InheritException
Constants
- VERSION
Public Class Methods
@return The currently configured async provider. Defaults to EXEL::Providers::ThreadedAsyncProvider
# File lib/exel.rb, line 42 def self.async_provider configuration.async_provider || Providers::ThreadedAsyncProvider end
@return The current configuration
# File lib/exel.rb, line 22 def self.configuration @config ||= OpenStruct.new(middleware: Middleware::Chain.new) end
Yields the configuration object to the given block. Configuration can include:
-
async_provider
Set an async provider. Defaults toEXEL::Providers::ThreadedAsyncProvider
-
remote_provider
Set a remote provider. Defaults toEXEL::Providers::LocalFileProvider
-
Any configuration required by the async/remote providers
Typically, async_provider
and remote_provider
will be automatically set upon requiring those gems.
Example:
EXEL.configure do |config| config.s3_bucket = 'my_bucket' end
# File lib/exel.rb, line 37 def self.configure yield configuration end
@return The currently set logger
# File lib/exel.rb, line 10 def self.logger EXEL::Logging.logger end
Sets the logger to be used.
@param [Logger] The logger to set. Must comply with the Ruby Logger interface
# File lib/exel.rb, line 17 def self.logger=(logger) EXEL::Logging.logger = logger end
# File lib/exel.rb, line 51 def self.middleware configuration.middleware end
@return The currently configured remote provider. Defaults to EXEL::Providers::LocalFileProvider
# File lib/exel.rb, line 47 def self.remote_provider configuration.remote_provider || Providers::LocalFileProvider end