Sha256: ce782816a70e05c91c1b22a0f0352eadb8fe76ec9fc0327252a23885c06f1b25

Contents?: true

Size: 704 Bytes

Versions: 16

Compression:

Stored size: 704 Bytes

Contents

require 'mkit/app/model/setting'
require 'mkit/app/model/pool'
require 'mkit/config/config'
require 'fileutils'
require 'mkit/utils'

module MKIt
  module Initializers

    def self.load_my_configuration(config_dir: MKIt::Utils.config_dir)
      MKIt::Utils.log.info "loading configurations from '#{config_dir}'..."
      MKIt::Config.load_yml!("#{config_dir}/mkit_config.yml")
    end

    def self.load_default_configs
      if Pool.find_by_name(MKIt::Utils.me).nil?
        st = Pool.new(
          name: MKIt::Utils.me,
          ip: MKIt::Config.mkit.my_network.ip,
          range: '10-200',
          netmask: '24',
          preferred: true
        )
        st.save
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mkit-0.9.0 lib/mkit/config/load_default_configs.rb
mkit-0.8.0 lib/mkit/config/load_default_configs.rb
mkit-0.7.2 lib/mkit/config/load_default_configs.rb
mkit-0.7.1 lib/mkit/config/load_default_configs.rb
mkit-0.7.0 lib/mkit/config/load_default_configs.rb
mkit-0.6.3 lib/mkit/config/load_default_configs.rb
mkit-0.6.2 lib/mkit/config/load_default_configs.rb
mkit-0.6.1 lib/mkit/config/load_default_configs.rb
mkit-0.6.0 lib/mkit/config/load_default_configs.rb
mkit-0.5.0 lib/mkit/config/load_default_configs.rb
mkit-0.4.3 lib/mkit/config/load_default_configs.rb
mkit-0.4.2 lib/mkit/config/load_default_configs.rb
mkit-0.4.1 lib/mkit/config/load_default_configs.rb
mkit-0.4.0 lib/mkit/config/load_default_configs.rb
mkit-0.3.0 lib/mkit/config/load_default_configs.rb
mkit-0.2.0 lib/mkit/config/load_default_configs.rb