<commit_before>package org.grails.plugins.console

import org.codehaus.groovy.grails.plugins.PluginManagerHolder

/**
 * @author <a href='mailto:<EMAIL>'><NAME></a>
 */
class ConsoleTagLib {

	static namespace = 'con'

	def resources = { attrs ->
		boolean hasResourcesPlugin = PluginManagerHolder.pluginManager.hasGrailsPlugin('resources')

		if (hasResourcesPlugin) {
			r.require(module: 'console')
			out << r.layoutResources()
		}
		else {
			out << """<link rel='stylesheet' media="screen" href='${resource(dir: 'js/CodeMirror-2.23/lib', file: 'codemirror.css', plugin: 'console')}' />"""
			out << """<link rel='stylesheet' media="screen" href='${resource(dir: 'css', file: 'jquery.layout.css', plugin: 'console')}' />"""
			out << """<link rel='stylesheet' media="screen" href='${resource(dir: 'css', file: 'grails-console.css', plugin: 'console')}' />"""
		}
	}

	def layoutResources = { attrs ->
		boolean hasResourcesPlugin = PluginManagerHolder.pluginManager.hasGrailsPlugin('resources')

		if (hasResourcesPlugin) {
			out << r.layoutResources()
		}
		else {
			for (name in ['jquery-1.7.1.min', 'jquery-ui-1.8.17.custom.min',
			              'jquery.layout', 'jquery.Storage', 'jquery.hotkeys',
			              'CodeMirror-2.23/lib/codemirror', 'CodeMirror-2.23/mode/groovy/groovy',
			              'grails-console/console']) {
				out << g.javascript(src: name + '.js', plugin: 'console')
			}
		}
	}
}<commit_msg>using DI for the pluginManager bean instead of using the deprecated holder<commit_after>package org.grails.plugins.console

import org.codehaus.groovy.grails.plugins.GrailsPluginManager

/**
 * @author <a href='mailto:<EMAIL>'><NAME></a>
 */
class ConsoleTagLib {

	static namespace = 'con'

	GrailsPluginManager pluginManager

	def resources = { attrs ->
		boolean hasResourcesPlugin = pluginManager.hasGrailsPlugin('resources')

		if (hasResourcesPlugin) {
			r.require(module: 'console')
			out << r.layoutResources()
		}
		else {
			out << """<link rel='stylesheet' media="screen" href='${resource(dir: 'js/CodeMirror-2.23/lib', file: 'codemirror.css', plugin: 'console')}' />"""
			out << """<link rel='stylesheet' media="screen" href='${resource(dir: 'css', file: 'jquery.layout.css', plugin: 'console')}' />"""
			out << """<link rel='stylesheet' media="screen" href='${resource(dir: 'css', file: 'grails-console.css', plugin: 'console')}' />"""
		}
	}

	def layoutResources = { attrs ->
		boolean hasResourcesPlugin = pluginManager.hasGrailsPlugin('resources')

		if (hasResourcesPlugin) {
			out << r.layoutResources()
		}
		else {
			for (name in ['jquery-1.7.1.min', 'jquery-ui-1.8.17.custom.min',
			              'jquery.layout', 'jquery.Storage', 'jquery.hotkeys',
			              'CodeMirror-2.23/lib/codemirror', 'CodeMirror-2.23/mode/groovy/groovy',
			              'grails-console/console']) {
				out << g.javascript(src: name + '.js', plugin: 'console')
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.18555289284491613, 'fraction_numerical': 0.010955152345087298, 'mean_word_length': 3.935810810810811, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 21, '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': '4740193', 'n_tokens_mistral': 1056, 'n_tokens_neox': 948, 'n_words': 179}