Module: EXEL

Defined in:
lib/exel.rb,
lib/exel/job.rb,
lib/exel/value.rb,
lib/exel/events.rb,
lib/exel/context.rb,
lib/exel/logging.rb,
lib/exel/version.rb,
lib/exel/ast_node.rb,
lib/exel/instruction.rb,
lib/exel/sequence_node.rb,
lib/exel/logging_helper.rb,
lib/exel/instruction_node.rb,
lib/exel/middleware/chain.rb,
lib/exel/null_instruction.rb,
lib/exel/processor_helper.rb,
lib/exel/listen_instruction.rb,
lib/exel/middleware/logging.rb,
lib/exel/error/job_termination.rb,
lib/exel/deferred_context_value.rb,
lib/exel/logging/logger_wrapper.rb,
lib/exel/processors/run_processor.rb,
lib/exel/processors/async_processor.rb,
lib/exel/processors/split_processor.rb,
lib/exel/providers/local_file_provider.rb,
lib/exel/providers/threaded_async_provider.rb

Overview

rubocop:disable Lint/InheritException

Defined Under Namespace

Modules: Error, Events, Job, Logging, LoggingHelper, Middleware, ProcessorHelper, Processors, Providers, Value Classes: ASTNode, Context, DeferredContextValue, Instruction, InstructionNode, ListenInstruction, NullInstruction, SequenceNode

Constant Summary collapse

VERSION =
'1.5.0'

Class Method Summary collapse

Class Method Details

.async_providerObject

Returns The currently configured async provider. Defaults to EXEL::Providers::ThreadedAsyncProvider.

Returns:

  • The currently configured async provider. Defaults to EXEL::Providers::ThreadedAsyncProvider


42
43
44
# File 'lib/exel.rb', line 42

def self.async_provider
  configuration.async_provider || Providers::ThreadedAsyncProvider
end

.configurationObject

Returns The current configuration.

Returns:

  • The current configuration


22
23
24
# File 'lib/exel.rb', line 22

def self.configuration
  @config ||= OpenStruct.new(middleware: Middleware::Chain.new)
end

.configure {|configuration| ... } ⇒ Object

Yields the configuration object to the given block. Configuration can include:

  • async_provider Set an async provider. Defaults to EXEL::Providers::ThreadedAsyncProvider

  • remote_provider Set a remote provider. Defaults to EXEL::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

Yields:


37
38
39
# File 'lib/exel.rb', line 37

def self.configure
  yield configuration
end

.loggerObject

Returns The currently set logger.

Returns:

  • The currently set logger


10
11
12
# File 'lib/exel.rb', line 10

def self.logger
  EXEL::Logging.logger
end

.logger=(logger) ⇒ Object

Sets the logger to be used.

Parameters:

  • The (Logger)

    logger to set. Must comply with the Ruby Logger interface


17
18
19
# File 'lib/exel.rb', line 17

def self.logger=(logger)
  EXEL::Logging.logger = logger
end

.middlewareObject


51
52
53
# File 'lib/exel.rb', line 51

def self.middleware
  configuration.middleware
end

.remote_providerObject

Returns The currently configured remote provider. Defaults to EXEL::Providers::LocalFileProvider.

Returns:

  • The currently configured remote provider. Defaults to EXEL::Providers::LocalFileProvider


47
48
49
# File 'lib/exel.rb', line 47

def self.remote_provider
  configuration.remote_provider || Providers::LocalFileProvider
end