Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Few doc tweaks: #740

Merged
merged 1 commit into from
Jan 29, 2025
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
```

Expand Down
2 changes: 1 addition & 1 deletion json.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions lib/json/common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down