lib/linguist/language.rb in gitlab-linguist-2.9.6 vs lib/linguist/language.rb in gitlab-linguist-3.0.0

- old
+ new

@@ -1,7 +1,6 @@ require 'escape_utils' -require 'pygments' require 'yaml' require 'linguist/classifier' require 'linguist/samples' @@ -233,14 +232,10 @@ @color = attributes[:color] # Set aliases @aliases = [default_alias_name] + (attributes[:aliases] || []) - # Lookup Lexer object - @lexer = Pygments::Lexer.find_by_name(attributes[:lexer] || name) || - raise(ArgumentError, "#{@name} is missing lexer") - @ace_mode = attributes[:ace_mode] @wrap = attributes[:wrap] || false # Set legacy search term @search_term = attributes[:search_term] || default_alias_name @@ -424,10 +419,10 @@ # text - String of code to be highlighted # options - A Hash of options (defaults to {}) # # Returns html String def colorize(text, options = {}) - lexer.highlight(text, options = {}) + text end # Public: Return name as String representation def to_s name