diff --git a/Gemfile b/Gemfile index 697b11a..da9c0df 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/lib/json/canonicalization.rb b/lib/json/canonicalization.rb index e972eaf..e8ec97f 100644 --- a/lib/json/canonicalization.rb +++ b/lib/json/canonicalization.rb @@ -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 @@ -86,7 +86,7 @@ class String # Output JSON with control characters escaped # @return [String] def to_json_c14n - self.to_json + ::JSON.generate(self) end end @@ -94,7 +94,6 @@ class Symbol # Output JSON with control characters escaped # @return [String] def to_json_c14n - self.to_json + ::JSON.generate(self) end end - diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bbd5c8e..2e8a590 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,6 +2,8 @@ require "bundler/setup" require 'rspec' +require 'active_support' +require 'active_support/core_ext' begin require 'simplecov'