<commit_before>import Foundation
import Swinject
import UIKit


public class GlobalAssembly: AssemblyType {
    
    public init() { }

    public func assemble(container: Container) {
        container.register(DateResolverProtocol.self) { _ in
            DateResolver()
        }

        container.register(Validator<NSDate?>.self) { r in
            let dateResolver = r.resolve(DateResolverProtocol.self)!

            return Validator(DateValidator(dateResolver: dateResolver))
        }

        container.register(Validator<String?>.self) { _ in
            return Validator(NoteValidator())
        }

        container.register(Validator<Priority?>.self) { _ in
            return Validator(PriorityValidator())
        }

        container.register(DateFormatterProtocol.self, name: "relative") { _ in
            RelativeDateFormatter()
        }

        container.register(TODONoteDataAccessObjectProtocol.self) { r in
            let factory = r.resolve(TODONoteFactoryProtocol.self)!

            return TODONoteDataAccessObject(factory: factory)
        }

        container.register(TODONoteFactoryProtocol.self) { r in
            let dateResolver = r.resolve(DateResolverProtocol.self)!
            let guidGenerator = r.resolve(GUIDGeneratorProtocol.self)!

            return TODONoteFactory(dateResolver: dateResolver,
                    guidGenerator: guidGenerator)
        }

        container.register(GUIDGeneratorProtocol.self) { _ in
            GUIDGenerator()
        }
    }
}
<commit_msg>Added realm configurator to global assembly<commit_after>import Foundation
import Swinject
import UIKit


public class GlobalAssembly: AssemblyType {
    
    public init() { }

    public func assemble(container: Container) {
        container.register(DateResolverProtocol.self) { _ in
            DateResolver()
        }

        container.register(Validator<NSDate?>.self) { r in
            let dateResolver = r.resolve(DateResolverProtocol.self)!

            return Validator(DateValidator(dateResolver: dateResolver))
        }

        container.register(Validator<String?>.self) { _ in
            return Validator(NoteValidator())
        }

        container.register(Validator<Priority?>.self) { _ in
            return Validator(PriorityValidator())
        }

        container.register(DateFormatterProtocol.self, name: "relative") { _ in
            RelativeDateFormatter()
        }

        container.register(TODONoteDataAccessObjectProtocol.self) { r in
            let factory = r.resolve(TODONoteFactoryProtocol.self)!

            return TODONoteDataAccessObject(factory: factory)
        }

        container.register(TODONoteFactoryProtocol.self) { r in
            let dateResolver = r.resolve(DateResolverProtocol.self)!
            let guidGenerator = r.resolve(GUIDGeneratorProtocol.self)!

            return TODONoteFactory(dateResolver: dateResolver,
                    guidGenerator: guidGenerator)
        }

        container.register(GUIDGeneratorProtocol.self) { _ in
            GUIDGenerator()
        }
        
        container.register(RealmConfigurationFactoryProtocol.self) { _ in
            let appGroup = "group.com.jakubturek.ReactiveTODO"
            let fileManager = NSFileManager.defaultManager()
            
            return AppGroupRealmConfigurationFactory(appGroupIdentifier: appGroup,
                                                     fileManager: fileManager)
        }
    }
}

{'fraction_non_alphanumeric': 0.0792507204610951, 'fraction_numerical': 0.0, 'mean_word_length': 2.321531100478469, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5042724', 'n_tokens_mistral': 868, 'n_tokens_neox': 825, 'n_words': 152}