<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace ModestTree.Zenject
{
    public sealed class GlobalCompositionRoot : MonoBehaviour
    {
        static GlobalCompositionRoot _instance;
        DiContainer _container;
        IDependencyRoot _dependencyRoot;

        public DiContainer Container
        {
            get
            {
                return _container;
            }
        }

        public static GlobalCompositionRoot Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new GameObject("Global Composition Root")
                        .AddComponent<GlobalCompositionRoot>();
                }
                return _instance;
            }
        }

        public void Awake()
        {
            DontDestroyOnLoad(gameObject);

            // Is this a good idea?
            //go.hideFlags = HideFlags.HideInHierarchy;

            _container = CreateContainer(false, gameObject);
            _dependencyRoot = _container.Resolve<IDependencyRoot>();
        }

        // If we're destroyed manually somehow handle that
        public void OnDestroy()
        {
            _instance = null;
            _dependencyRoot = null;
        }

        public static DiContainer CreateContainer(bool allowNullBindings, GameObject gameObj)
        {
            Assert.That(allowNullBindings || gameObj != null);

            var container = new DiContainer();
            container.AllowNullBindings = allowNullBindings;

            container.Bind<IInstaller>().ToSingle<StandardUnityInstaller>();
            container.Bind<GameObject>().To(gameObj)
                .WhenInjectedInto<StandardUnityInstaller>();
            container.InstallInstallers();
            Assert.That(!container.HasBinding<IInstaller>());

            foreach (var installer in GetGlobalInstallers())
            {
                FieldsInjecter.Inject(container, installer);
                container.Bind<IInstaller>().To(installer);
                container.InstallInstallers();
                Assert.That(!container.HasBinding<IInstaller>());
            }

            return container;
        }

        static IEnumerable<IInstaller> GetGlobalInstallers()
        {
            var installerConfig = (GlobalInstallerConfig)Resources.Load("ZenjectGlobalInstallers", typeof(GlobalInstallerConfig));

            if (installerConfig == null)
            {
                return Enumerable.Empty<IInstaller>();
            }

            return installerConfig.Installers;
        }
    }
}<commit_msg>Bug fix.  Global composition root was broken as it was referring to the wrong asset name<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace ModestTree.Zenject
{
    public sealed class GlobalCompositionRoot : MonoBehaviour
    {
        static GlobalCompositionRoot _instance;
        DiContainer _container;
        IDependencyRoot _dependencyRoot;

        public DiContainer Container
        {
            get
            {
                return _container;
            }
        }

        public static GlobalCompositionRoot Instance
        {
            get
            {
                if (_instance == null)
                {
                    _instance = new GameObject("Global Composition Root")
                        .AddComponent<GlobalCompositionRoot>();
                }
                return _instance;
            }
        }

        public void Awake()
        {
            DontDestroyOnLoad(gameObject);

            // Is this a good idea?
            //go.hideFlags = HideFlags.HideInHierarchy;

            _container = CreateContainer(false, gameObject);
            _dependencyRoot = _container.Resolve<IDependencyRoot>();
        }

        // If we're destroyed manually somehow handle that
        public void OnDestroy()
        {
            _instance = null;
            _dependencyRoot = null;
        }

        public static DiContainer CreateContainer(bool allowNullBindings, GameObject gameObj)
        {
            Assert.That(allowNullBindings || gameObj != null);

            var container = new DiContainer();
            container.AllowNullBindings = allowNullBindings;

            container.Bind<IInstaller>().ToSingle<StandardUnityInstaller>();
            container.Bind<GameObject>().To(gameObj)
                .WhenInjectedInto<StandardUnityInstaller>();
            container.InstallInstallers();
            Assert.That(!container.HasBinding<IInstaller>());

            foreach (var installer in GetGlobalInstallers())
            {
                FieldsInjecter.Inject(container, installer);
                container.Bind<IInstaller>().To(installer);
                container.InstallInstallers();
                Assert.That(!container.HasBinding<IInstaller>());
            }

            return container;
        }

        static IEnumerable<IInstaller> GetGlobalInstallers()
        {
            var installerConfig = (GlobalInstallerConfig)Resources.Load("ZenjectGlobalCompositionRoot", typeof(GlobalInstallerConfig));

            if (installerConfig == null)
            {
                return Enumerable.Empty<IInstaller>();
            }

            return installerConfig.Installers;
        }
    }
}
{'fraction_non_alphanumeric': 0.07827535159141377, 'fraction_numerical': 0.0, 'mean_word_length': 1.7717948717948717, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3437364', 'n_tokens_mistral': 1310, 'n_tokens_neox': 1233, 'n_words': 257}