From b2b106e3146626240c4ac199ffc1ab130917cdc6 Mon Sep 17 00:00:00 2001 From: Edouard CHIN Date: Wed, 29 Jan 2025 23:27:19 +0100 Subject: [PATCH] Few doc tweaks: - Also modified the gemspec files' blob as the ragel's `parser.rl` file was removed in c8d5236a921e886b1909081d1a6b907a8d95a249 --- README.md | 2 +- json.gemspec | 2 +- lib/json/common.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 008d4573..d327f74a 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ To combine JSON fragments into a bigger JSON document, you can use `JSON::Fragme posts_json = cache.fetch_multi(post_ids) do |post_id| JSON.generate(Post.find(post_id)) end -posts_json.map { |post_json| JSON::Fragment.new(post_json) } +posts_json.map! { |post_json| JSON::Fragment.new(post_json) } JSON.generate({ posts: posts_json, count: posts_json.count }) ``` diff --git a/json.gemspec b/json.gemspec index dc397719..943c78aa 100644 --- a/json.gemspec +++ b/json.gemspec @@ -52,7 +52,7 @@ spec = Gem::Specification.new do |s| s.files += Dir["lib/json/ext/**/*.jar"] else s.extensions = Dir["ext/json/**/extconf.rb"] - s.files += Dir["ext/json/**/*.{c,h,rl}"] + s.files += Dir["ext/json/**/*.{c,h}"] end end diff --git a/lib/json/common.rb b/lib/json/common.rb index dfb9f580..005bac5c 100644 --- a/lib/json/common.rb +++ b/lib/json/common.rb @@ -172,10 +172,10 @@ class MissingUnicodeSupport < JSONError; end # JSON.generate({ count: 3, items: fragments }) # # This allows to easily assemble multiple JSON fragments that have - # been peristed somewhere without having to parse them nor resorting + # been persisted somewhere without having to parse them nor resorting # to string interpolation. # - # Note: no validation is performed on the provided string. it is the + # Note: no validation is performed on the provided string. It is the # responsability of the caller to ensure the string contains valid JSON. Fragment = Struct.new(:json) do def initialize(json)