Sha256: d8416ed8fd830a1daa7a59859d7eeeed9113c2309ae00f0feb8f2c06eac358cc

Contents?: true

Size: 756 Bytes

Versions: 11

Compression:

Stored size: 756 Bytes

Contents

module Initializer
  def self.run
    require_config
    require_lib
    require_initializers
    require_models
  end

  def self.require_config
    require_relative "../config/config"
  end

  def self.require_lib
    require! %w(
      lib/serializers/base
      lib/serializers/**/*
      lib/endpoints/base
      lib/endpoints/**/*
      lib/mediators/base
      lib/mediators/**/*
      lib/routes
    )
  end

  def self.require_models
    require! %w(
      lib/models/**/*
    )
  end

  def self.require_initializers
    Pliny::Utils.require_glob("#{Config.root}/config/initializers/*.rb")
  end

  def self.require!(globs)
    Array(globs).each do |f|
      Pliny::Utils.require_glob("#{Config.root}/#{f}.rb")
    end
  end
end

Initializer.run

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pliny-0.20.0 lib/template/lib/initializer.rb
pliny-0.19.0 lib/template/lib/initializer.rb
pliny-0.18.0 lib/template/lib/initializer.rb
pliny-0.17.1 lib/template/lib/initializer.rb
pliny-0.17.0 lib/template/lib/initializer.rb
pliny-0.16.3 lib/template/lib/initializer.rb
pliny-0.16.2 lib/template/lib/initializer.rb
pliny-0.16.1 lib/template/lib/initializer.rb
pliny-0.16.0 lib/template/lib/initializer.rb
pliny-0.15.1 lib/template/lib/initializer.rb
pliny-0.15.0 lib/template/lib/initializer.rb