lib/asciidoctor/syntax_highlighter.rb in asciidoctor-2.0.15 vs lib/asciidoctor/syntax_highlighter.rb in asciidoctor-2.0.16

- old
+ new

@@ -97,13 +97,14 @@ # Returns nothing. def write_stylesheet doc, to_dir raise ::NotImplementedError, %(#{SyntaxHighlighter} subclass #{self.class} must implement the ##{__method__} method since #write_stylesheet? returns true) end - private_class_method def self.included into + def self.included into into.extend Config - end || :included + end + private_class_method :included # use separate declaration for Ruby 2.0.x module Config # Public: Statically register the current class in the registry for the specified names. # # names - one or more String or Symbol names with which to register the current class as a syntax highlighter @@ -150,11 +151,11 @@ syntax_hl end end private - + def registry raise ::NotImplementedError, %(#{Factory} subclass #{self.class} must implement the ##{__method__} method) end end @@ -164,23 +165,21 @@ def initialize seed_registry = nil @registry = seed_registry || {} end private - - def registry - @registry - end + + attr_reader :registry end module DefaultFactory include Factory - private - @@registry = {} + private + def registry @@registry end unless RUBY_ENGINE == 'opal' @@ -213,11 +212,9 @@ 'coderay' => %(#{__dir__}/syntax_highlighter/coderay), 'prettify' => %(#{__dir__}/syntax_highlighter/prettify), 'pygments' => %(#{__dir__}/syntax_highlighter/pygments), 'rouge' => %(#{__dir__}/syntax_highlighter/rouge), } - - private @@mutex = ::Mutex.new end end