lib/rouge/lexers/yaml.rb in rouge-2.2.1 vs lib/rouge/lexers/yaml.rb in rouge-3.0.0
- old
+ new
@@ -8,12 +8,12 @@
mimetypes 'text/x-yaml'
tag 'yaml'
aliases 'yml'
filenames '*.yaml', '*.yml'
- def self.analyze_text(text)
+ def self.detect?(text)
# look for the %YAML directive
- return 1 if text =~ /\A\s*%YAML/m
+ return true if text =~ /\A\s*%YAML/m
end
SPECIAL_VALUES = Regexp.union(%w(true false null))
# NB: Tabs are forbidden in YAML, which is why you see things