<commit_before>class CodeRunner
	
	module InteractiveMethods
		COMMANDS.each do |command|
			eval("def #{command[1]}(*args) 
# 			     if args[-1].kind_of? 
					CodeRunner.send(#{command[0].to_sym.inspect}, *args)
						end")
		end
		def up
			ObjectSpace.each_object{|obj| obj.update if obj.class.to_s =~ /CodeRunner$/}
			nil
		end
		def cd(dirct)
			Dir.chdir(dirct)
		end
		def setup_interactive
			@runner = CodeRunner.fetch_runner(CodeRunner::DEFAULT_COMMAND_OPTIONS.dup) unless CodeRunner::DEFAULT_COMMAND_OPTIONS[:q]
			@r = @runner
		end
		def pwd
			puts Dir.pwd
		end
		def runs
			CodeRunner.runner.run_list
		end


			

		
		INTERACTIVE_METHODS = <<EOF


include CodeRunner::InteractiveMethods
setup_interactive
module Kernel

		alias_method(:shell_do, "`".to_sym)
	def `(cmd)
		c =caller
		if c[0] =~ /irb_binding/
			system(cmd)
		else
			shell_do(cmd)
		end
	end
end
EOF

	end # module InteractiveMethods

  	def CodeRunner.interactive_mode(copts={})
		process_command_options(copts)
	  			unless false and FileTest.exist? (ENV['HOME'] + '/code_runner_interactive_options.rb')
				File.open(ENV['HOME'] + '/.code_runner_interactive_options.rb', 'w') do |file|
					file.puts <<EOF
	$has_put_startup_message_for_code_runner = true #please leave!
	$code_runner_interactive_mode = true #please leave!
	require 'yaml'

	def reset
	  Dispatcher.reset_application!
	end
	  
	IRB.conf[:AUTO_INDENT] = true
	IRB.conf[:USE_READLINE] = true
	IRB.conf[:LOAD_MODULES] = []  unless IRB.conf.key?(:LOAD_MODULES)
	unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
	  IRB.conf[:LOAD_MODULES] << 'irb/completion'
	end      

				
	require 'irb/completion'
	require 'irb/ext/save-history'
	require 'socket'
unless ENV['CODE_RUNNER_SYSTEM'] == 'macosx'
	prompt_start = "\001#{Terminal::LIGHT_GREEN}\002CodeRunner\001#{Terminal::RESET}\002 v#{CODE_RUNNER_VERSION} - \001#{Terminal::CYAN}\002#\{ENV['USER']\}@#\{Socket::gethostname\}:#\{File.basename(Dir.pwd)}\001#{Terminal::RESET}\002 timemarker\n"
	prompt_start = "\001#{Terminal::LIGHT_GREEN}\002CodeRunner\001#{Terminal::RESET}\002 v#{CODE_RUNNER_VERSION} - \001#{Terminal::CYAN}\002#\{Socket::gethostname\}:#\{File.basename(Dir.pwd)}\001#{Terminal::RESET}\002 timemarker %02n,%i \n"
else
		prompt_start = "CodeRunner #\{File.basename(Dir.pwd)}"
end
  IRB.conf[:PROMPT][:CODE_RUNNER] = {:PROMPT_I=>"#\{prompt_start}>> %02n,%i >> ", :PROMPT_N=>"#\{prompt_start}>> %02n:%i > ", :PROMPT_S=>"#\{prompt_start}>> %02n:%i (%l)> ", :PROMPT_C=>"#\{prompt_start}>> %02n:%i >>  ", :RETURN=>""}
  IRB.conf[:PROMPT][:CODE_RUNNER] = {:PROMPT_I=>"#\{prompt_start}>> ", :PROMPT_N=>"#\{prompt_start}> ", :PROMPT_S=>"#\{prompt_start}(%l)> ", :PROMPT_C=>"#\{prompt_start}>>  ", :RETURN=>""}
#   IRB.conf[:PROMPT][:CODE_RUNNER] = {:PROMPT_I=>"#\{prompt_start} %02n,%i>> ", :PROMPT_N=>"#\{prompt_start} %02n:%i> ", :PROMPT_S=>"#\{prompt_start} %02n:%i (%l)> ", :PROMPT_C=>"#\{prompt_start} %02n:%i>>  ", :RETURN=>""}


	IRB.conf[:PROMPT_MODE] = :CODE_RUNNER
	IRB.conf[:SAVE_HISTORY] = 400
	IRB.conf[:HISTORY_FILE] = "\#\{Dir.pwd}/.code-runner-irb-save-history"
	IRB.conf[:INSPECT_MODE] = false
	

EOF
				end # File.open
			end # unless
			File.open(".int.tmp.rb", 'w')do |file|
				file.puts "#{copts.inspect}.each do |key, val|
					CodeRunner::DEFAULT_COMMAND_OPTIONS[key] = val
				end"
				file.puts CodeRunner::InteractiveMethods::INTERACTIVE_METHODS
			end
# 			asdfa
			exec %[#{Config::CONFIG['bindir']}/irb#{Config::CONFIG['ruby_install_name'].sub(/ruby/, '')} -f -I '#{Dir.pwd}' -I '#{SCRIPT_FOLDER}'   -I '#{ENV['HOME']}' -r '.code_runner_interactive_options' -r 'coderunner' -r .int.tmp ]
	end<commit_msg>--Switched to RbConfig<commit_after>class CodeRunner
	
	module InteractiveMethods
		COMMANDS.each do |command|
			eval("def #{command[1]}(*args) 
# 			     if args[-1].kind_of? 
					CodeRunner.send(#{command[0].to_sym.inspect}, *args)
						end")
		end
		def up
			ObjectSpace.each_object{|obj| obj.update if obj.class.to_s =~ /CodeRunner$/}
			nil
		end
		def cd(dirct)
			Dir.chdir(dirct)
		end
		def setup_interactive
			@runner = CodeRunner.fetch_runner(CodeRunner::DEFAULT_COMMAND_OPTIONS.dup) unless CodeRunner::DEFAULT_COMMAND_OPTIONS[:q]
			@r = @runner
		end
		def pwd
			puts Dir.pwd
		end
		def runs
			CodeRunner.runner.run_list
		end


			

		
		INTERACTIVE_METHODS = <<EOF


include CodeRunner::InteractiveMethods
setup_interactive
module Kernel

		alias_method(:shell_do, "`".to_sym)
	def `(cmd)
		c =caller
		if c[0] =~ /irb_binding/
			system(cmd)
		else
			shell_do(cmd)
		end
	end
end
EOF

	end # module InteractiveMethods

  	def CodeRunner.interactive_mode(copts={})
		process_command_options(copts)
	  			unless false and FileTest.exist? (ENV['HOME'] + '/code_runner_interactive_options.rb')
				File.open(ENV['HOME'] + '/.code_runner_interactive_options.rb', 'w') do |file|
					file.puts <<EOF
	$has_put_startup_message_for_code_runner = true #please leave!
	$code_runner_interactive_mode = true #please leave!
	require 'yaml'

	def reset
	  Dispatcher.reset_application!
	end
	  
	IRB.conf[:AUTO_INDENT] = true
	IRB.conf[:USE_READLINE] = true
	IRB.conf[:LOAD_MODULES] = []  unless IRB.conf.key?(:LOAD_MODULES)
	unless IRB.conf[:LOAD_MODULES].include?('irb/completion')
	  IRB.conf[:LOAD_MODULES] << 'irb/completion'
	end      

				
	require 'irb/completion'
	require 'irb/ext/save-history'
	require 'socket'
unless ENV['CODE_RUNNER_SYSTEM'] == 'macosx'
	prompt_start = "\001#{Terminal::LIGHT_GREEN}\002CodeRunner\001#{Terminal::RESET}\002 v#{CODE_RUNNER_VERSION} - \001#{Terminal::CYAN}\002#\{ENV['USER']\}@#\{Socket::gethostname\}:#\{File.basename(Dir.pwd)}\001#{Terminal::RESET}\002 timemarker\n"
	prompt_start = "\001#{Terminal::LIGHT_GREEN}\002CodeRunner\001#{Terminal::RESET}\002 v#{CODE_RUNNER_VERSION} - \001#{Terminal::CYAN}\002#\{Socket::gethostname\}:#\{File.basename(Dir.pwd)}\001#{Terminal::RESET}\002 timemarker %02n,%i \n"
else
		prompt_start = "CodeRunner #\{File.basename(Dir.pwd)}"
end
  IRB.conf[:PROMPT][:CODE_RUNNER] = {:PROMPT_I=>"#\{prompt_start}>> %02n,%i >> ", :PROMPT_N=>"#\{prompt_start}>> %02n:%i > ", :PROMPT_S=>"#\{prompt_start}>> %02n:%i (%l)> ", :PROMPT_C=>"#\{prompt_start}>> %02n:%i >>  ", :RETURN=>""}
  IRB.conf[:PROMPT][:CODE_RUNNER] = {:PROMPT_I=>"#\{prompt_start}>> ", :PROMPT_N=>"#\{prompt_start}> ", :PROMPT_S=>"#\{prompt_start}(%l)> ", :PROMPT_C=>"#\{prompt_start}>>  ", :RETURN=>""}
#   IRB.conf[:PROMPT][:CODE_RUNNER] = {:PROMPT_I=>"#\{prompt_start} %02n,%i>> ", :PROMPT_N=>"#\{prompt_start} %02n:%i> ", :PROMPT_S=>"#\{prompt_start} %02n:%i (%l)> ", :PROMPT_C=>"#\{prompt_start} %02n:%i>>  ", :RETURN=>""}


	IRB.conf[:PROMPT_MODE] = :CODE_RUNNER
	IRB.conf[:SAVE_HISTORY] = 400
	IRB.conf[:HISTORY_FILE] = "\#\{Dir.pwd}/.code-runner-irb-save-history"
	IRB.conf[:INSPECT_MODE] = false
	

EOF
				end # File.open
			end # unless
			File.open(".int.tmp.rb", 'w')do |file|
				file.puts "#{copts.inspect}.each do |key, val|
					CodeRunner::DEFAULT_COMMAND_OPTIONS[key] = val
				end"
				file.puts CodeRunner::InteractiveMethods::INTERACTIVE_METHODS
			end
# 			asdfa
			exec %[#{RbConfig::CONFIG['bindir']}/irb#{Config::CONFIG['ruby_install_name'].sub(/ruby/, '')} -f -I '#{Dir.pwd}' -I '#{SCRIPT_FOLDER}'   -I '#{ENV['HOME']}' -r '.code_runner_interactive_options' -r 'coderunner' -r .int.tmp ]
	end
{'fraction_non_alphanumeric': 0.1930902635531886, 'fraction_numerical': 0.019937184214119896, 'mean_word_length': 4.882730923694779, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 85, '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': '1672313', 'n_tokens_mistral': 3299, 'n_tokens_neox': 2927, 'n_words': 425}