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
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ group :development, :test do
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
gem 'benchmark-ips'
gem 'rake'
gem 'activesupport'
end

group :debug do
Expand Down
7 changes: 3 additions & 4 deletions lib/json/canonicalization.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Object
# Default canonicalization output for Ruby objects
# @return [String]
def to_json_c14n
self.to_json
::JSON.generate(self)
end
end

Expand Down Expand Up @@ -86,15 +86,14 @@ class String
# Output JSON with control characters escaped
# @return [String]
def to_json_c14n
self.to_json
::JSON.generate(self)
end
end

class Symbol
# Output JSON with control characters escaped
# @return [String]
def to_json_c14n
self.to_json
::JSON.generate(self)
end
end

2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

require "bundler/setup"
require 'rspec'
require 'active_support'
require 'active_support/core_ext'

begin
require 'simplecov'
Expand Down