module Avrolution

Constants

COMPATIBILITY
DEPLOYMENT
VERSION

Attributes

compatibility_breaks_file[W]

Path to the compatibility breaks file. Defaults to #{Avrolution.root}/avro_compatibility_breaks.txt

compatibility_schema_registry_url[W]

The URL (including any Basic Auth) for the schema registry to use for compatibility checks

deployment_schema_registry_url[W]

The URL (including any Basic Auth) for the schema registry to use for deployment

logger[RW]
root[W]

Root directory to search for schemas, and default location for compatibility breaks file

Public Class Methods

compatibility_breaks_file() click to toggle source
# File lib/avrolution/configuration.rb, line 51
def self.compatibility_breaks_file
  @compatibility_breaks_file ||= "#{root}/avro_compatibility_breaks.txt"
end
compatibility_schema_registry_url() click to toggle source
# File lib/avrolution/configuration.rb, line 55
def self.compatibility_schema_registry_url
  fetch_url(COMPATIBILITY)
end
configure() { |self| ... } click to toggle source
# File lib/avrolution/configuration.rb, line 63
def self.configure
  yield self
end
deployment_schema_registry_url() click to toggle source
# File lib/avrolution/configuration.rb, line 59
def self.deployment_schema_registry_url
  fetch_url(DEPLOYMENT)
end
fetch_url(label) click to toggle source
# File lib/avrolution/configuration.rb, line 27
def fetch_url(label)
  env_name = "#{label.upcase}_SCHEMA_REGISTRY_URL"
  ivar_name = "@#{env_name.downcase}"
  env_value = ENV[env_name]
  result = if env_value
             env_value
           elsif instance_variable_get(ivar_name)
             ivar_value = instance_variable_get(ivar_name)
             ivar_value = instance_variable_set(ivar_name, ivar_value.call) if ivar_value.is_a?(Proc)
             ivar_value
           end

  raise "#{env_name.downcase} must be set" if result.blank?

  result
end
root() click to toggle source
# File lib/avrolution/configuration.rb, line 47
def self.root
  @root || raise('root must be set')
end