Skip to content

Commit

Permalink
Updates for release 0.3.3, which basically rolls back to 0.3.1 and ad…
Browse files Browse the repository at this point in the history
…ds back support for Ruby >= 2.6.

This version uses `#to_json` and retains the behavior that ActiveSupport may override the `#to_json` behavior in some cases.

For #2
  • Loading branch information
gkellogg committed Dec 5, 2023
1 parent a85e688 commit 641719d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: ['3.0', 3.1, 3.2, ruby-head, jruby]
ruby: [2.6, 2.7, '3.0', 3.1, 3.2, ruby-head, jruby]
steps:
- name: Clone repository
uses: actions/checkout@v3
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ group :development, :test do
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
gem 'benchmark-ips'
gem 'rake'
gem 'activesupport'
end

group :debug do
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
0.3.3
2 changes: 1 addition & 1 deletion json-canonicalization.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Gem::Specification.new do |gem|
gem.files = %w(AUTHORS README.md LICENSE VERSION) + Dir.glob('lib/**/*.rb')
gem.test_files = Dir.glob('spec/**/*.rb') + Dir.glob('spec/**/*.json')

gem.required_ruby_version = '>= 3.0'
gem.required_ruby_version = '>= 2.6'
gem.requirements = []
gem.add_development_dependency 'rspec', '~> 3.12'
gem.add_development_dependency 'yard' , '~> 0.9'
Expand Down
6 changes: 3 additions & 3 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
::JSON.generate(self)
self.to_json
end
end

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

class Symbol
# Output JSON with control characters escaped
# @return [String]
def to_json_c14n
::JSON.generate(self)
self.to_json
end
end
2 changes: 0 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

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

begin
require 'simplecov'
Expand Down

0 comments on commit 641719d

Please sign in to comment.