File: ext.rb

package info (click to toggle)
ruby-json 2.9.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,616 kB
  • sloc: ansic: 4,201; java: 3,457; ruby: 3,343; sh: 22; makefile: 11
file content (23 lines) | stat: -rw-r--r-- 588 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require 'json/common'

module JSON
  # This module holds all the modules/classes that implement JSON's
  # functionality as C extensions.
  module Ext
    if RUBY_ENGINE == 'truffleruby'
      require 'json/ext/parser'
      require 'json/truffle_ruby/generator'
      JSON.parser = Parser
      JSON.generator = ::JSON::TruffleRuby::Generator
    else
      require 'json/ext/parser'
      require 'json/ext/generator'
      JSON.parser = Parser
      JSON.generator = Generator
    end
  end

  JSON_LOADED = true unless defined?(::JSON::JSON_LOADED)
end