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)