<commit_before># Requires the settings key 'lessc' to point to the Less JavaScript compiler.
# Requires Nodejs to be installed.

require 'open3'
require 'os'

# Compiles the main stylesheet. Note that all LESS stylesheets 
# included in the main stylesheet will be relative to the main_file.
def compile(css, include_paths, settings)
	lessjs = settings['lessc']
	result = css
	sep = (OS.windows? or OS.Underlying.windows?) ? ';' : ':'
	command = "node \"#{lessjs}\" --compress --include-path=\"#{include_paths.join(sep)}\" -"

	begin
		Open3.popen3(command) do |stdin, stdout, stderr|
			stdin.puts(css)
			stdin.close
			result = stdout.read
			error = stderr.read
			stdout.close
			stderr.close

			if error.length > 0
				puts error
			end
		end
	end

	result
end<commit_msg>Fix the OS:: issue<commit_after># Requires the settings key 'lessc' to point to the Less JavaScript compiler.
# Requires Nodejs to be installed.

require 'open3'
require 'os'

# Compiles the main stylesheet. Note that all LESS stylesheets 
# included in the main stylesheet will be relative to the main_file.
def compile(css, include_paths, settings)
	lessjs = settings['lessc']
	result = css
	sep = (OS.windows? or OS::Underlying.windows?) ? ';' : ':'
	command = "node \"#{lessjs}\" --compress --include-path=\"#{include_paths.join(sep)}\" -"

	begin
		Open3.popen3(command) do |stdin, stdout, stderr|
			stdin.puts(css)
			stdin.close
			result = stdout.read
			error = stderr.read
			stdout.close
			stderr.close

			if error.length > 0
				puts error
			end
		end
	end

	result
end
{'fraction_non_alphanumeric': 0.11572890025575447, 'fraction_numerical': 0.005115089514066497, 'mean_word_length': 3.616519174041298, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2095493', 'n_tokens_mistral': 575, 'n_tokens_neox': 526, 'n_words': 168}