Sha256: a5b6e5b490f59d284781b789e819dd6bff431ddf1fad52c1e72899642c52314d

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

module Legion
  module Data
    module Settings
      def self.default
        {
          connected:        false,
          cache:            cache,
          connection:       connection,
          creds:            creds,
          migrations:       migrations,
          models:           models,
          connect_on_start: true
        }
      end

      def self.models
        {
          continue_on_load_fail: false,
          autoload:              true
        }
      end

      def self.migrations
        {
          continue_on_fail: false,
          auto_migrate:     true,
          ran:              false,
          version:          nil
        }
      end

      def self.connection
        {
          log:                 false,
          log_connection_info: false,
          log_warn_duration:   1,
          sql_log_level:       'debug',
          max_connections:     10
        }
      end

      def self.creds
        {
          username: 'legion',
          password: 'legion',
          database: 'legion',
          host:     '127.0.0.1',
          port:     3306,
          debug:    false
        }
      end

      def self.cache
        {
          connected:   false,
          auto_enable: Legion::Settings[:cache][:connected],
          ttl:         60
        }
      end
    end
  end
end

begin
  Legion::Settings.merge_settings('data', Legion::Data::Settings.default) if Legion.const_defined?('Settings')
rescue StandardError => e
  Legion::Logging.fatal(e.message) if Legion::Logging.method_defined?(:fatal)
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
legion-data-java-1.1.2 lib/legion/data/settings.rb
legion-data-1.1.2 lib/legion/data/settings.rb