diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2019-01-26 04:29:42 -0700 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2019-01-26 04:29:42 -0700 |
| commit | 7cb74679da7634d4aa2508f4c488cffd9c835295 (patch) | |
| tree | fd1f3d3f44fc1b509568e04e85916d411aecf3d3 | |
| parent | b0611753987a638482c96953e6ec8f275f090b94 (diff) | |
add missing mode when writing pygments stylesheet
| -rw-r--r-- | lib/asciidoctor/syntax_highlighter/pygments.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/asciidoctor/syntax_highlighter/pygments.rb b/lib/asciidoctor/syntax_highlighter/pygments.rb index 17714055..136f4885 100644 --- a/lib/asciidoctor/syntax_highlighter/pygments.rb +++ b/lib/asciidoctor/syntax_highlighter/pygments.rb @@ -74,7 +74,7 @@ module Asciidoctor end def write_stylesheet doc, to_dir - ::File.write (::File.join to_dir, (stylesheet_basename @style)), (read_stylesheet @style) + ::File.write (::File.join to_dir, (stylesheet_basename @style)), (read_stylesheet @style), mode: FILE_WRITE_MODE end module Loader @@ -102,14 +102,14 @@ module Asciidoctor private - def style_available? style - (((@@available_styles ||= ::Pygments.styles.to_set).include? style) rescue nil) && style - end - def base_style style @@base_style_cache[style || DEFAULT_STYLE] end + def style_available? style + (((@@available_styles ||= ::Pygments.styles.to_set).include? style) rescue nil) && style + end + (@@base_style_cache = {}).default_proc = proc do |cache, key| if BaseStyleRx =~ @@stylesheet_cache[key] @@base_style_cache = cache.merge key => (style = $1.strip) |
