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.3.7 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.6 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.5 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.4 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.3 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.2 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.3.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.2.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.1.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.1.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.0.3 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.0.2 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.0.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-3.0.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-2.27.1 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-2.27.0 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-2.26.3 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-2.26.2 ./lib/rubypitaya/core/initializer_broadcast.rb
rubypitaya-2.26.1 ./lib/rubypitaya/core/initializer_broadcast.rb