Skip to content

Commit

Permalink
Few doc tweaks:
Browse files Browse the repository at this point in the history
- Also modified the gemspec files' blob as the ragel's `parser.rl`
  file was removed in c8d5236
  • Loading branch information
Edouard-chin committed Jan 29, 2025
1 parent 39ef430 commit b2b106e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
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

0 comments on commit b2b106e

Please sign in to comment.