Skip to content

Commit b79aee1

Browse files
authored
Upgrade YARD to 0.9.38. (#941)
YARD 0.9.38 parses `MyClass = Data.define(...)` for the first time: lsegal/yard#1600 There are 3 spots in this codebase that `be rake site:docs_coverage` reported as uncovered on YARD 0.9.38. This addresses all three.
1 parent 35f1434 commit b79aee1

5 files changed

Lines changed: 25 additions & 3 deletions

File tree

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ group :site do
5353
# TODO: switch back to a release version once that fix is merged and released.
5454
gem "rouge", github: "myronmarston/rouge", ref: "12c0da6aa98e0d0a0762c47103b64290c88620a1"
5555

56-
gem "yard", "~> 0.9", ">= 0.9.37"
56+
gem "yard", "~> 0.9", ">= 0.9.38"
5757
gem "yard-doctest", "~> 0.1", ">= 0.1.17"
5858
gem "yard-markdown", "~> 0.5"
5959
end

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ GEM
583583
vcr (6.3.1)
584584
base64
585585
webrick (1.9.1)
586-
yard (0.9.37)
586+
yard (0.9.38)
587587
yard-doctest (0.1.17)
588588
minitest
589589
yard
@@ -663,7 +663,7 @@ DEPENDENCIES
663663
steep (~> 1.10.0)
664664
super_diff (~> 0.17)
665665
vcr (~> 6.3, >= 6.3.1)
666-
yard (~> 0.9, >= 0.9.37)
666+
yard (~> 0.9, >= 0.9.38)
667667
yard-doctest (~> 0.1, >= 0.1.17)
668668
yard-markdown (~> 0.5)
669669

elasticgraph-apollo/lib/elastic_graph/apollo/graphql/entities_field_resolver.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,17 @@ def initialize(type:, id:, other_fields:, schema_element_names:)
155155
)
156156
end
157157

158+
# @private
158159
Adapter = ::Data.define(:type, :schema_element_names) do
159160
# @implements Adapter
160161

162+
# Customizes the given query to filter to entities matching the provided representations.
163+
# Builds a filter matching all IDs from the representations and configures pagination
164+
# and requested fields.
165+
#
166+
# @param query [ElasticGraph::GraphQL::DatastoreQuery] the query to customize
167+
# @param representations [Array<RepresentationWithId>] the representations to query for
168+
# @return [ElasticGraph::GraphQL::DatastoreQuery] the customized query
161169
def customize_query(query, representations)
162170
# Given a set of representations, builds a filter that will match all of them (and only them).
163171
all_ids = representations.map(&:id).reject { |id| id.is_a?(::Array) or id.is_a?(::Hash) }

elasticgraph-support/lib/elastic_graph/support/faraday_middleware/msearch_using_get_instead_of_post.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ module FaradayMiddleware
2020
# did for years.
2121
#
2222
# For more info, see: https://github.com/elastic/elasticsearch-ruby/issues/1005
23+
# @private
2324
MSearchUsingGetInsteadOfPost = ::Data.define(:app) do
2425
# @implements MSearchUsingGetInsteadOfPost
26+
27+
# Processes a Faraday request, converting `_msearch` POST requests to GET requests.
28+
#
29+
# @param env [Faraday::Env] the Faraday request environment
30+
# @return [Faraday::Response] the response from the next middleware in the stack
2531
def call(env)
2632
env.method = :get if env.url.path.to_s.end_with?("/_msearch")
2733
app.call(env)

elasticgraph-support/lib/elastic_graph/support/faraday_middleware/support_timeouts.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,16 @@ module FaradayMiddleware
2020
#
2121
# This middleware helps us work around this deficiency by looking for the TIMEOUT_MS_HEADER. If present, it deletes
2222
# it from the headers and instead sets it as the request timeout.
23+
# @private
2324
SupportTimeouts = ::Data.define(:app) do
2425
# @implements SupportTimeouts
26+
27+
# Processes a Faraday request, extracting timeout from headers and applying it to the request.
28+
# Converts {TIMEOUT_MS_HEADER} from request headers into a Faraday request timeout setting.
29+
#
30+
# @param env [Faraday::Env] the Faraday request environment
31+
# @return [Faraday::Response] the response from the next middleware in the stack
32+
# @raise [Errors::RequestExceededDeadlineError] if the request times out
2533
def call(env)
2634
if (timeout_ms = env.request_headers.delete(TIMEOUT_MS_HEADER))
2735
env.request.timeout = Integer(timeout_ms) / 1000.0

0 commit comments

Comments
 (0)