<commit_before>steal.plugins('jquery/controller','jquery/view').then(function($){
	jQuery.Controller.getFolder = function(){
		return jQuery.String.underscore( this.fullName.replace(/\./g,"/") ).replace("/Controllers","")
	}
	
	var calculatePosition = function(Class, view, action_name){
		var path = jQuery.String.underscore( Class.fullName.replace(/\./g,"/").replace("/"+Class.shortName,"") ).replace("/Controllers",""),
			controller_name = Class.underscoreShortName;
			
        //calculate view
        
        if(typeof view == "string") {
			if(view.substr(0,2) == "//" ){ //leave where it is
                
            }else{
                view = "//"+new steal.File( '../views/'+ 
                    (jQuery.String.steal(view,'/') ? view : controller_name+'/'+view)
                    ).joinFrom(path)+jQuery.View.ext
            }
        }else if(!view) {
            view = "//"+new steal.File(
                '../views/'+controller_name+'/'+action_name.replace(/\.|#/g, '').replace(/ /g,'_')
                ).joinFrom(path)+jQuery.View.ext;
        }
		return view
	}
	var calculateHelpers = function(myhelpers){
		var helpers = {};
        if(myhelpers){
            if(jQuery.isArray(myhelpers))
                for(var h =0; h < myhelpers.length; h++) jQuery.extend(helpers, myhelpers[h] );
            else
                jQuery.extend(helpers, myhelpers );
        }else{
            if(this._default_helpers ) helpers = this._default_helpers
            //load from name
            var current = window;
            var parts = this.Class.fullName.split(/\./);
            for(var i =0; i < parts.length; i++){
                if(typeof current.Helpers == 'object'){
                    jQuery.extend(helpers, current.Helpers );
                }
                current = current[parts[i]];
            }
            if(typeof current.Helpers == 'object'){
                    jQuery.extend(helpers, current.Helpers );
            }
            this._default_helpers = helpers;
        }
		return helpers;
	}
	
/**
 * @add jQuery.Controller Prototype
 */

jQuery.Controller.prototype.
/**
 * @tag view
 * Renders a View template with the controller instance. If the first argument
 * is not supplied, 
 * it looks for a view in /views/controller_name/action_name.ejs.
 * If data is not provided, it uses the controller instance as data.
 * @codestart
 * TasksController = $.Controller.extend('TasksController',{
 *   click : function(el){
 *     // renders with views/tasks/click.ejs
 *     el.html( this.view() ) 
 *     // renders with views/tasks/under.ejs
 *     el.after( this.view("under", [1,2]) );
 *     // renders with views/shared/top.ejs
 *     el.before( this.view("shared/top", {phrase: "hi"}) );
 *   }
 * })
 * @codeend
 * @plugin controller/view
 * @return {String} the rendered result of the view.
 * @param {String} [optional1] view The view you are going to render.  If a view isn't explicity given
 * this function will try to guess at the correct view as show in the example code above.
 * @param {Object} [optional2] data data to be provided to the view.  If not present, the controller instance 
 * is used.
 * @param {Object} [optional3] myhelpers an object of helpers that will be available in the view.  If not present
 * this controller class's "Helpers" property will be used.
 *
 */
view = function(view, data, myhelpers) {
		//shift args if no view is provided
        if(typeof view != "string" && !myhelpers){
            myhelpers = data;
            data = view;
            view = null;
        }
        //guess from controller name
		view = calculatePosition(this.Class, view, this.called)
        
        //calculate data
        data = data || this;
        
        //calculate helpers
        var helpers = calculateHelpers.call(this, myhelpers)
        
		
        return jQuery.View(view, data, helpers); //what about controllers in other folders?
};

jQuery.Controller.prototype.

$view = function(view, data, myhelpers) {
		//shift args if no view is provided
        if(typeof view != "string" && !myhelpers){
            myhelpers = data;
            data = view;
            view = null;
        }
        //guess from controller name
		view = calculatePosition(this.Class, view, this.called)
        
        //calculate data
        data = data || this;
        
        //calculate helpers
        var helpers = calculateHelpers.call(this, myhelpers)
        
		
        return jQuery.View(view, data, helpers, true); //what about controllers in other folders?
}
	
})
<commit_msg>Fixed typo (was jQuery.String.steal, should be jQuery.String.include).<commit_after>steal.plugins('jquery/controller','jquery/view').then(function($){
	jQuery.Controller.getFolder = function(){
		return jQuery.String.underscore( this.fullName.replace(/\./g,"/") ).replace("/Controllers","")
	}
	
	var calculatePosition = function(Class, view, action_name){
		var path = jQuery.String.underscore( Class.fullName.replace(/\./g,"/").replace("/"+Class.shortName,"") ).replace("/Controllers",""),
			controller_name = Class.underscoreShortName;
			
        //calculate view
        
        if(typeof view == "string") {
			if(view.substr(0,2) == "//" ){ //leave where it is
                
            }else{
                view = "//"+new steal.File( '../views/'+ 
                    (jQuery.String.include(view,'/') ? view : controller_name+'/'+view)
                    ).joinFrom(path)+jQuery.View.ext
            }
        }else if(!view) {
            view = "//"+new steal.File(
                '../views/'+controller_name+'/'+action_name.replace(/\.|#/g, '').replace(/ /g,'_')
                ).joinFrom(path)+jQuery.View.ext;
        }
		return view
	}
	var calculateHelpers = function(myhelpers){
		var helpers = {};
        if(myhelpers){
            if(jQuery.isArray(myhelpers))
                for(var h =0; h < myhelpers.length; h++) jQuery.extend(helpers, myhelpers[h] );
            else
                jQuery.extend(helpers, myhelpers );
        }else{
            if(this._default_helpers ) helpers = this._default_helpers
            //load from name
            var current = window;
            var parts = this.Class.fullName.split(/\./);
            for(var i =0; i < parts.length; i++){
                if(typeof current.Helpers == 'object'){
                    jQuery.extend(helpers, current.Helpers );
                }
                current = current[parts[i]];
            }
            if(typeof current.Helpers == 'object'){
                    jQuery.extend(helpers, current.Helpers );
            }
            this._default_helpers = helpers;
        }
		return helpers;
	}
	
/**
 * @add jQuery.Controller Prototype
 */

jQuery.Controller.prototype.
/**
 * @tag view
 * Renders a View template with the controller instance. If the first argument
 * is not supplied, 
 * it looks for a view in /views/controller_name/action_name.ejs.
 * If data is not provided, it uses the controller instance as data.
 * @codestart
 * TasksController = $.Controller.extend('TasksController',{
 *   click : function(el){
 *     // renders with views/tasks/click.ejs
 *     el.html( this.view() ) 
 *     // renders with views/tasks/under.ejs
 *     el.after( this.view("under", [1,2]) );
 *     // renders with views/shared/top.ejs
 *     el.before( this.view("shared/top", {phrase: "hi"}) );
 *   }
 * })
 * @codeend
 * @plugin controller/view
 * @return {String} the rendered result of the view.
 * @param {String} [optional1] view The view you are going to render.  If a view isn't explicity given
 * this function will try to guess at the correct view as show in the example code above.
 * @param {Object} [optional2] data data to be provided to the view.  If not present, the controller instance 
 * is used.
 * @param {Object} [optional3] myhelpers an object of helpers that will be available in the view.  If not present
 * this controller class's "Helpers" property will be used.
 *
 */
view = function(view, data, myhelpers) {
		//shift args if no view is provided
        if(typeof view != "string" && !myhelpers){
            myhelpers = data;
            data = view;
            view = null;
        }
        //guess from controller name
		view = calculatePosition(this.Class, view, this.called)
        
        //calculate data
        data = data || this;
        
        //calculate helpers
        var helpers = calculateHelpers.call(this, myhelpers)
        
		
        return jQuery.View(view, data, helpers); //what about controllers in other folders?
};

jQuery.Controller.prototype.

$view = function(view, data, myhelpers) {
		//shift args if no view is provided
        if(typeof view != "string" && !myhelpers){
            myhelpers = data;
            data = view;
            view = null;
        }
        //guess from controller name
		view = calculatePosition(this.Class, view, this.called)
        
        //calculate data
        data = data || this;
        
        //calculate helpers
        var helpers = calculateHelpers.call(this, myhelpers)
        
		
        return jQuery.View(view, data, helpers, true); //what about controllers in other folders?
}
	
})

{'fraction_non_alphanumeric': 0.13257864373571351, 'fraction_numerical': 0.0019592903015130075, 'mean_word_length': 2.1272974812797822, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '6475513', 'n_tokens_mistral': 2661, 'n_tokens_neox': 2618, 'n_words': 720}