<commit_before>" Redline Smalltalk, Copyright (c) <NAME>. All rights reserved. See LICENSE in the root of this distribution "

Object < #Stout.

- initialize
    Transcript show: 'stout initialize'; cr.
    super initialize.
    "create router registry."
    JVM aload: 1;
        new: 'st/redline/stout/RouterRegistryImpl';
        dup;
        new: 'st/redline/stout/RouterFactoryImpl';
        dup;
        new: 'st/redline/stout/RequestPathSpecificationFactoryImpl';
        dup;
        invokeSpecial: 'st/redline/stout/RequestPathSpecificationFactoryImpl' method: '<init>' returning: '()V';
        invokeSpecial: 'st/redline/stout/RouterFactoryImpl' method: '<init>' returning: '(Lst/redline/stout/RequestPathSpecificationFactory;)V';
        invokeSpecial: 'st/redline/stout/RouterRegistryImpl' method: '<init>' returning: '(Lst/redline/stout/RouterFactory;)V';
        invokeVirtual: 'st/redline/PrimObject' method: 'javaValue' returning: '(Ljava/lang/Object;)Lst/redline/PrimObject;'.

- handle: action on: target with: request and: response and: dispatch
    Transcript show: 'stout handle'; cr.
    "handle http request type 'action' on 'target' uri."
    JVM aload: 1;
        invokeVirtual: 'st/redline/PrimObject' method: 'javaValue' returning: '()Ljava/lang/Object;';
        checkcast: 'st/redline/stout/RouterRegistry';
        arg: 3;
        arg: 2;
        invokeInterface: 'st/redline/stout/RouterRegistry' method: 'lookup' returning: '(Lst/redline/PrimObject;Lst/redline/PrimObject;)Lst/redline/stout/Router;';
        arg: 5;
        arg: 2;
        invokeInterface: 'st/redline/stout/Router' method: 'dispatchToBlock' returning: '(Lst/redline/PrimObject;Lst/redline/PrimObject;)V';
        aload: 1.

- get: target do: aBlock
    Transcript show: 'stout get'; cr.
    "register aBlock to be executed when a HTTP GET of target is received."
    JVM aload: 1;
        invokeVirtual: 'st/redline/PrimObject' method: 'javaValue' returning: '()Ljava/lang/Object;';
        checkcast: 'st/redline/stout/RouterRegistry';
        arg: 0;
        ldc: 'JSON';
        ldc: 'GET';
        arg: 1;
        invokeInterface: 'st/redline/stout/RouterRegistry' method: 'register' returning: '(Lst/redline/PrimObject;Ljava/lang/String;Ljava/lang/String;Lst/redline/PrimObject;)Lst/redline/stout/Router;';
        aload: 1.
<commit_msg>Fixing stout.<commit_after>" Redline Smalltalk, Copyright (c) <NAME>. All rights reserved. See LICENSE in the root of this distribution "

Object < #Stout.

- initialize
    Transcript show: 'stout initialize'; cr.
    super initialize.
    "create router registry."
    JVM aload: 1;
        new: 'st/redline/stout/RouterRegistryImpl';
        dup;
        new: 'st/redline/stout/RouterFactoryImpl';
        dup;
        new: 'st/redline/stout/RequestPathSpecificationFactoryImpl';
        dup;
        invokeSpecial: 'st/redline/stout/RequestPathSpecificationFactoryImpl' method: '<init>' returning: '()V';
        invokeSpecial: 'st/redline/stout/RouterFactoryImpl' method: '<init>' returning: '(Lst/redline/stout/RequestPathSpecificationFactory;)V';
        invokeSpecial: 'st/redline/stout/RouterRegistryImpl' method: '<init>' returning: '(Lst/redline/stout/RouterFactory;)V';
        invokeVirtual: 'st/redline/PrimObject' method: 'javaValue' returning: '(Ljava/lang/Object;)Lst/redline/PrimObject;'.

- handle: action on: target with: request and: response and: dispatch
    Transcript show: 'stout handle'; cr.
    "handle http request type 'action' on 'target' uri."
    JVM aload: 1;
        invokeVirtual: 'st/redline/PrimObject' method: 'javaValue' returning: '()Ljava/lang/Object;';
        checkcast: 'st/redline/stout/RouterRegistry';
        arg: 1;
        arg: 0;
        invokeInterface: 'st/redline/stout/RouterRegistry' method: 'lookup' returning: '(Lst/redline/PrimObject;Lst/redline/PrimObject;)Lst/redline/stout/Router;';
        arg: 3;
        arg: 1;
        invokeInterface: 'st/redline/stout/Router' method: 'dispatchToBlock' returning: '(Lst/redline/PrimObject;Lst/redline/PrimObject;)V';
        aload: 1.

- get: target do: aBlock
    Transcript show: 'stout get'; cr.
    "register aBlock to be executed when a HTTP GET of target is received."
    JVM aload: 1;
        invokeVirtual: 'st/redline/PrimObject' method: 'javaValue' returning: '()Ljava/lang/Object;';
        checkcast: 'st/redline/stout/RouterRegistry';
        arg: 0;
        ldc: 'JSON';
        ldc: 'GET';
        arg: 1;
        invokeInterface: 'st/redline/stout/RouterRegistry' method: 'register' returning: '(Lst/redline/PrimObject;Ljava/lang/String;Ljava/lang/String;Lst/redline/PrimObject;)Lst/redline/stout/Router;';
        aload: 1.

{'fraction_non_alphanumeric': 0.13331911262798635, 'fraction_numerical': 0.00469283276450512, 'mean_word_length': 3.436140018921476, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '3424341', 'n_tokens_mistral': 1532, 'n_tokens_neox': 1508, 'n_words': 343}