Project

General

Profile

Defect #26055 » 0002-Pull-up-retrieve_supported_languages-private-class-m.patch

Mischa The Evil, 2017-05-28 15:56

View differences:

lib/redmine/syntax_highlighting.rb
module CodeRay
require 'coderay'
def self.retrieve_supported_languages
::CodeRay::Scanners.list +
# Add CodeRay scanner aliases
::CodeRay::Scanners.plugin_hash.keys.map(&:to_sym) -
# Remove internal CodeRay scanners
%w(debug default raydebug scanner).map(&:to_sym)
end
private_class_method :retrieve_supported_languages
class << self
# Highlights +text+ as the content of +filename+
# Should not return line numbers nor outer pre tag
......
end
def language_supported?(language)
supported_languages =
::CodeRay::Scanners.list +
::CodeRay::Scanners.plugin_hash.keys.map(&:to_sym) -
%w(debug default raydebug scanner).map(&:to_sym)
supported_languages = retrieve_supported_languages
supported_languages.include?(language.to_s.downcase.to_sym)
rescue
false
(2-2/4)