Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def generator=(generator) # :nodoc:
end
end
self.state = generator::State
const_set :State, self.state
const_set :State, state
ensure
$VERBOSE = old
end
Expand Down Expand Up @@ -1072,7 +1072,7 @@ def j(*objs)
end

objs.each do |obj|
puts JSON::generate(obj, :allow_nan => true, :max_nesting => false)
puts JSON.generate(obj, :allow_nan => true, :max_nesting => false)
end
nil
end
Expand All @@ -1087,7 +1087,7 @@ def jj(*objs)
end

objs.each do |obj|
puts JSON::pretty_generate(obj, :allow_nan => true, :max_nesting => false)
puts JSON.pretty_generate(obj, :allow_nan => true, :max_nesting => false)
end
nil
end
Expand Down
4 changes: 2 additions & 2 deletions lib/json/ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ def parse

if RUBY_ENGINE == 'truffleruby'
require 'json/truffle_ruby/generator'
JSON.generator = ::JSON::TruffleRuby::Generator
JSON.generator = JSON::TruffleRuby::Generator
else
require 'json/ext/generator'
JSON.generator = Generator
end
end

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