Sha256: 9608e5c07a46ebbd129091a3cc99ddb0fe7b0e544f991f0e6555d2cbf4082108

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

# The enclosing module for the library
module Sqewer
  # Eager-load everything except extensions. Sort to ensure
  # the files load in the same order on all platforms.
  Dir.glob(__dir__ + '/**/*.rb').sort.each do |path|
    if path != __FILE__ && File.dirname(path) !~ /\/extensions$/
      require path
    end
  end
  
  # Loads a particular Sqewer extension that is not loaded
  # automatically during the gem require.
  #
  # @param extension_name[String] the name of the extension to load (like `active_job_adapter`)
  def self.require_extension(extension_name)
    path = File.join("sqewer", "extensions", extension_name)
    require_relative path
  end
    
  # Shortcut access to Submitter#submit.
  #
  # @see {Sqewer::Submitter#submit!}
  def self.submit!(*jobs, **options)
    Sqewer::Submitter.default.submit!(*jobs, **options)
  end
  
  # If we are within Rails, load the railtie
  require_relative 'sqewer/extensions/railtie' if defined?(Rails)

  # Explicitly require retriable so that it ia available for use.
  require 'retriable'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sqewer-5.1.1 lib/sqewer.rb