summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/yaml.rb
blob: 47f64a4cf5a71e628325b7dbdcaa57442fd5c808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module CodeRay
module Encoders

  # = YAML Encoder
  #
  # Slow.
  class YAML < Encoder

    register_for :yaml

    FILE_EXTENSION = 'yaml'

  protected
    def compile tokens, options
      require 'yaml'
      @out = tokens.to_a.to_yaml
    end

  end

end
end