Sha256: 5d815e736e6ea8ad32b718d6a40b9d2e916d836ae73f06284f6408e507132bde

Contents?: true

Size: 719 Bytes

Versions: 88

Compression:

Stored size: 719 Bytes

Contents

require 'rubypitaya/core/path'
require 'rubypitaya/core/initializer_base'

module RubyPitaya

  class InitializerBroadcast

    def run(initializer_content)
      app_classes = []
      plugin_classes = []

      ObjectSpace.each_object(InitializerBase.singleton_class) do |klass|
        is_plugin_class = klass.path.include?('plugins')

        if is_plugin_class
          plugin_classes << klass
        else
          app_classes << klass
        end
      end

      plugin_classes.each do |klass|
        instance = klass.new
        instance.run(initializer_content)
      end

      app_classes.each do |klass|
        instance = klass.new
        instance.run(initializer_content)
      end
    end
  end
end

Version data entries

88 entries across 84 versions & 1 rubygems

Version Path
rubypitaya-3.19.6 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.19.5 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.19.4 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.19.3 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.19.2 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.19.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.19.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.18.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.17.2 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.17.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.17.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.16.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.15.3 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.15.2 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.15.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.15.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.14.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.13.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.13.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.12.5 ./lib/rubypitaya/core/initializer_broadcast.rb