repo
stringlengths
5
92
file_url
stringlengths
80
287
file_path
stringlengths
5
197
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:37:27
2026-01-04 17:58:21
truncated
bool
2 classes
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/declared.rb
lib/grape/dsl/declared.rb
# frozen_string_literal: true module Grape module DSL module Declared # Denotes a situation where a DSL method has been invoked in a # filter which it should not yet be available in class MethodNotYetAvailable < StandardError def initialize(msg = '#declared is not available prior to par...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/logger.rb
lib/grape/dsl/logger.rb
# frozen_string_literal: true module Grape module DSL module Logger # Set or retrive the configured logger. If none was configured, this # method will create a new one, logging to stdout. # @param logger [Object] the new logger to use def logger(logger = nil) global_settings = inh...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/middleware.rb
lib/grape/dsl/middleware.rb
# frozen_string_literal: true module Grape module DSL module Middleware # Apply a custom middleware to the API. Applies # to the current namespace and any children, but # not parents. # # @param middleware_class [Class] The class of the middleware you'd like # to inject. ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/routing.rb
lib/grape/dsl/routing.rb
# frozen_string_literal: true module Grape module DSL module Routing attr_reader :endpoints def given(conditional_option, &) return unless conditional_option mounted(&) end def mounted(&block) evaluate_as_instance_with_configuration(block, lazy: true) end ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/inside_route.rb
lib/grape/dsl/inside_route.rb
# frozen_string_literal: true module Grape module DSL module InsideRoute include Declared # Backward compatibility: alias exception class to previous location MethodNotYetAvailable = Declared::MethodNotYetAvailable # The API version as specified in the URL. def version env...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/callbacks.rb
lib/grape/dsl/callbacks.rb
# frozen_string_literal: true module Grape module DSL module Callbacks # before: execute the given block before validation, coercion, or any endpoint # before_validation: execute the given block after `before`, but prior to validation or coercion # after_validation: execute the given block afte...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/validations.rb
lib/grape/dsl/validations.rb
# frozen_string_literal: true module Grape module DSL module Validations # Opens a root-level ParamsScope, defining parameter coercions and # validations for the endpoint. # @yield instance context of the new scope def params(&) Grape::Validations::ParamsScope.new(api: self, type:...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/helpers.rb
lib/grape/dsl/helpers.rb
# frozen_string_literal: true module Grape module DSL module Helpers # Add helper methods that will be accessible from any # endpoint within this namespace (and child namespaces). # # When called without a block, all known helpers within this scope # are included. # # @p...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/parameters.rb
lib/grape/dsl/parameters.rb
# frozen_string_literal: true module Grape module DSL # Defines DSL methods, meant to be applied to a ParamsScope, which define # and describe the parameters accepted by an endpoint, or all endpoints # within a namespace. module Parameters # Set the module used to build the request.params. ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/settings.rb
lib/grape/dsl/settings.rb
# frozen_string_literal: true module Grape module DSL # Keeps track of settings (implemented as key-value pairs, grouped by # types), in two contexts: top-level settings which apply globally no # matter where they're defined, and inheritable settings which apply only # in the current scope and scopes...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/request_response.rb
lib/grape/dsl/request_response.rb
# frozen_string_literal: true module Grape module DSL module RequestResponse # Specify the default format for the API's serializers. # May be `:json` or `:txt` (default). def default_format(new_format = nil) return inheritable_setting.namespace_inheritable[:default_format] if new_format...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/dsl/headers.rb
lib/grape/dsl/headers.rb
# frozen_string_literal: true module Grape module DSL module Headers # This method has four responsibilities: # 1. Set a specifc header value by key # 2. Retrieve a specifc header value by key # 3. Retrieve all headers that have been set # 4. Delete a specifc header key-value pair ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/error_formatter/txt.rb
lib/grape/error_formatter/txt.rb
# frozen_string_literal: true module Grape module ErrorFormatter class Txt < Base def self.format_structured_message(structured_message) message = structured_message[:message] || Grape::Json.dump(structured_message) Array.wrap(message).tap do |final_message| if structured_message....
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/error_formatter/xml.rb
lib/grape/error_formatter/xml.rb
# frozen_string_literal: true module Grape module ErrorFormatter class Xml < Base def self.format_structured_message(structured_message) structured_message.respond_to?(:to_xml) ? structured_message.to_xml(root: :error) : structured_message.to_s end end end end
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/error_formatter/json.rb
lib/grape/error_formatter/json.rb
# frozen_string_literal: true module Grape module ErrorFormatter class Json < Base class << self def format_structured_message(structured_message) ::Grape::Json.dump(structured_message) end private def wrap_message(message) return message if message.is_...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/error_formatter/base.rb
lib/grape/error_formatter/base.rb
# frozen_string_literal: true module Grape module ErrorFormatter class Base class << self def call(message, backtrace, options = {}, env = nil, original_exception = nil) merge_backtrace = backtrace.present? && options.dig(:rescue_options, :backtrace) merge_original_exception = o...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/error_formatter/serializable_hash.rb
lib/grape/error_formatter/serializable_hash.rb
# frozen_string_literal: true module Grape module ErrorFormatter class SerializableHash < Json; end end end
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/api/instance.rb
lib/grape/api/instance.rb
# frozen_string_literal: true module Grape class API # The API Instance class, is the engine behind Grape::API. Each class that inherits # from this will represent a different API instance class Instance extend Grape::DSL::Settings extend Grape::DSL::Desc extend Grape::DSL::Validations ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/single_attribute_iterator.rb
lib/grape/validations/single_attribute_iterator.rb
# frozen_string_literal: true module Grape module Validations class SingleAttributeIterator < AttributesIterator private def yield_attributes(val, attrs) return if skip?(val) attrs.each do |attr_name| yield val, attr_name, empty?(val) end end # Primiti...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/attributes_iterator.rb
lib/grape/validations/attributes_iterator.rb
# frozen_string_literal: true module Grape module Validations class AttributesIterator include Enumerable attr_reader :scope def initialize(validator, scope, params) @scope = scope @attrs = validator.attrs @original_params = scope.params(params) @params = Array...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/multiple_attributes_iterator.rb
lib/grape/validations/multiple_attributes_iterator.rb
# frozen_string_literal: true module Grape module Validations class MultipleAttributesIterator < AttributesIterator private def yield_attributes(resource_params, _attrs) yield resource_params unless skip?(resource_params) end end end end
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/params_documentation.rb
lib/grape/validations/params_documentation.rb
# frozen_string_literal: true module Grape module Validations # Documents parameters of an endpoint. If documentation isn't needed (for instance, it is an # internal API), the class only cleans up attributes to avoid junk in RAM. module ParamsDocumentation def document_params(attrs, validations, t...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/contract_scope.rb
lib/grape/validations/contract_scope.rb
# frozen_string_literal: true module Grape module Validations class ContractScope # Declare the contract to be used for the endpoint's parameters. # @param api [API] the API endpoint to modify. # @param contract the contract or schema to be used for validation. Optional. # @yield a block ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types.rb
lib/grape/validations/types.rb
# frozen_string_literal: true module Grape module Validations # Module for code related to grape's system for # coercion and type validation of incoming request # parameters. # # Grape uses a number of tests and assertions to # work out exactly how a parameter should be handled, # based o...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validator_factory.rb
lib/grape/validations/validator_factory.rb
# frozen_string_literal: true module Grape module Validations class ValidatorFactory def self.create_validator(options) options[:validator_class].new(options[:attributes], options[:options], options[:required], ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/params_scope.rb
lib/grape/validations/params_scope.rb
# frozen_string_literal: true module Grape module Validations class ParamsScope attr_accessor :element, :parent, :index attr_reader :type, :params_meeting_dependency include Grape::DSL::Parameters include Grape::Validations::ParamsDocumentation # There are a number of documentatio...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/as_validator.rb
lib/grape/validations/validators/as_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class AsValidator < Base # We use a validator for renaming parameters. This is just a marker for # the parameter scope to handle the renaming. No actual validation # happens here. def validate_pa...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/all_or_none_of_validator.rb
lib/grape/validations/validators/all_or_none_of_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class AllOrNoneOfValidator < MultipleParamsBase def validate_params!(params) keys = keys_in_common(params) return if keys.empty? || keys.length == all_keys.length raise Grape::Exceptions::...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/same_as_validator.rb
lib/grape/validations/validators/same_as_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class SameAsValidator < Base def validate_param!(attr_name, params) confirmation = options_key?(:value) ? @option[:value] : @option return if params[attr_name] == params[confirmation] rais...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/default_validator.rb
lib/grape/validations/validators/default_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class DefaultValidator < Base def initialize(attrs, options, required, scope, opts = {}) @default = options super end def validate_param!(attr_name, params) params[attr_nam...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/contract_scope_validator.rb
lib/grape/validations/validators/contract_scope_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class ContractScopeValidator < Base attr_reader :schema def initialize(_attrs, _options, _required, _scope, opts) super @schema = opts.fetch(:schema) end # Validates a given...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/coerce_validator.rb
lib/grape/validations/validators/coerce_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class CoerceValidator < Base def initialize(attrs, options, required, scope, opts) super @converter = if type.is_a?(Grape::Validations::Types::VariantCollectionCoercer) type...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/presence_validator.rb
lib/grape/validations/validators/presence_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class PresenceValidator < Base def validate_param!(attr_name, params) return if params.respond_to?(:key?) && params.key?(attr_name) raise Grape::Exceptions::Validation.new(params: [@scope.full_name(...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/values_validator.rb
lib/grape/validations/validators/values_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class ValuesValidator < Base def initialize(attrs, options, required, scope, opts) @values = options.is_a?(Hash) ? options[:value] : options super end def validate_param!(attr_name, ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/regexp_validator.rb
lib/grape/validations/validators/regexp_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class RegexpValidator < Base def validate_param!(attr_name, params) return unless params.respond_to?(:key) && params.key?(attr_name) value = options_key?(:value) ? @option[:value] : @option ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/mutually_exclusive_validator.rb
lib/grape/validations/validators/mutually_exclusive_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class MutuallyExclusiveValidator < MultipleParamsBase def validate_params!(params) keys = keys_in_common(params) return if keys.length <= 1 raise Grape::Exceptions::Validation.new(params: ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/base.rb
lib/grape/validations/validators/base.rb
# frozen_string_literal: true module Grape module Validations module Validators class Base attr_reader :attrs # Creates a new Validator from options specified # by a +requires+ or +optional+ directive during # parameter definition. # @param attrs [Array] names of at...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/allow_blank_validator.rb
lib/grape/validations/validators/allow_blank_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class AllowBlankValidator < Base def validate_param!(attr_name, params) return if (options_key?(:value) ? @option[:value] : @option) || !params.is_a?(Hash) value = params[attr_name] value ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/except_values_validator.rb
lib/grape/validations/validators/except_values_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class ExceptValuesValidator < Base def initialize(attrs, options, required, scope, opts) @except = options.is_a?(Hash) ? options[:value] : options super end def validate_param!(attr_...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/exactly_one_of_validator.rb
lib/grape/validations/validators/exactly_one_of_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class ExactlyOneOfValidator < MultipleParamsBase def validate_params!(params) keys = keys_in_common(params) return if keys.length == 1 raise Grape::Exceptions::Validation.new(params: all_ke...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/at_least_one_of_validator.rb
lib/grape/validations/validators/at_least_one_of_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class AtLeastOneOfValidator < MultipleParamsBase def validate_params!(params) return unless keys_in_common(params).empty? raise Grape::Exceptions::Validation.new(params: all_keys, message: message(:...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/length_validator.rb
lib/grape/validations/validators/length_validator.rb
# frozen_string_literal: true module Grape module Validations module Validators class LengthValidator < Base def initialize(attrs, options, required, scope, opts) @min = options[:min] @max = options[:max] @is = options[:is] super raise ArgumentErr...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/validators/multiple_params_base.rb
lib/grape/validations/validators/multiple_params_base.rb
# frozen_string_literal: true module Grape module Validations module Validators class MultipleParamsBase < Base def validate!(params) attributes = MultipleAttributesIterator.new(self, @scope, params) array_errors = [] attributes.each do |resource_params| v...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/set_coercer.rb
lib/grape/validations/types/set_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # Takes the given array and converts it to a set. Every element of the set # is also coerced. class SetCoercer < ArrayCoercer def initialize(type, strict = false) super @coercer = nil ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/custom_type_collection_coercer.rb
lib/grape/validations/types/custom_type_collection_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # See {CustomTypeCoercer} for details on types # that will be supported by this by this coercer. # This coercer works in the same way as +CustomTypeCoercer+ # except that it expects to receive an array of strings t...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/file.rb
lib/grape/validations/types/file.rb
# frozen_string_literal: true module Grape module Validations module Types # Implementation for parameters that are multipart file objects. # Actual handling of these objects is provided by +Rack::Request+; # this class is here only to assert that rack's handling has succeeded. class File...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/dry_type_coercer.rb
lib/grape/validations/types/dry_type_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # A base class for classes which must identify a coercer to be used. # If the +strict+ argument is true, it won't coerce the given value # but check its type. More information there # https://dry-rb.org/gems/dry-ty...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/json.rb
lib/grape/validations/types/json.rb
# frozen_string_literal: true module Grape module Validations module Types # Handles coercion and type checking for parameters that are complex # types given as JSON-encoded strings. It accepts both JSON objects # and arrays of objects, and will coerce the input to a +Hash+ # or +Array+ o...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/multiple_type_coercer.rb
lib/grape/validations/types/multiple_type_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # This class is intended for use with Grape endpoint parameters that # have been declared to be of variant-type using the +:types+ option. # +MultipleTypeCoercer+ will build a coercer for each type declared # in th...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/primitive_coercer.rb
lib/grape/validations/types/primitive_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # Coerces the given value to a type defined via a +type+ argument during # initialization. When +strict+ is true, it doesn't coerce a value but check # that it has the proper type. class PrimitiveCoercer < DryTypeC...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/variant_collection_coercer.rb
lib/grape/validations/types/variant_collection_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # This class wraps {MultipleTypeCoercer}, for use with collections # that allow members of more than one type. class VariantCollectionCoercer # Construct a new coercer that will attempt to coerce # a list...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/array_coercer.rb
lib/grape/validations/types/array_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # Coerces elements in an array. It might be an array of strings or integers or # an array of arrays of integers. # # It could've been possible to use an +of+ # method (https://dry-rb.org/gems/dry-types/main/a...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/invalid_value.rb
lib/grape/validations/types/invalid_value.rb
# frozen_string_literal: true module Grape module Validations module Types # Instances of this class may be used as tokens to denote that a parameter value could not be # coerced. The given message will be used as a validation error. class InvalidValue attr_reader :message def ...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/validations/types/custom_type_coercer.rb
lib/grape/validations/types/custom_type_coercer.rb
# frozen_string_literal: true module Grape module Validations module Types # This class will detect type classes that implement # a class-level +parse+ method. The method should accept one # +String+ argument and should return the value coerced to # the appropriate type. The method may ra...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/router/greedy_route.rb
lib/grape/router/greedy_route.rb
# frozen_string_literal: true # Act like a Grape::Router::Route but for greedy_match # see @neutral_map module Grape class Router class GreedyRoute < BaseRoute extend Forwardable def_delegators :@endpoint, :call attr_reader :endpoint, :allow_header def initialize(pattern, endpoint:, a...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/router/route.rb
lib/grape/router/route.rb
# frozen_string_literal: true module Grape class Router class Route < BaseRoute extend Forwardable FORWARD_MATCH_METHOD = ->(input, pattern) { input.start_with?(pattern.origin) } NON_FORWARD_MATCH_METHOD = ->(input, pattern) { pattern.match?(input) } attr_reader :app, :request_method, :...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/router/base_route.rb
lib/grape/router/base_route.rb
# frozen_string_literal: true module Grape class Router class BaseRoute extend Forwardable delegate_missing_to :@options attr_reader :options, :pattern def_delegators :@pattern, :path, :origin def_delegators :@options, :description, :version, :requirements, :prefix, :anchor, :set...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/router/pattern.rb
lib/grape/router/pattern.rb
# frozen_string_literal: true module Grape class Router class Pattern extend Forwardable DEFAULT_CAPTURES = %w[format version].freeze attr_reader :origin, :path, :pattern, :to_regexp def_delegators :pattern, :params def_delegators :to_regexp, :=== alias match? === de...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/parser/xml.rb
lib/grape/parser/xml.rb
# frozen_string_literal: true module Grape module Parser class Xml < Base def self.call(object, _env) ::Grape::Xml.parse(object) rescue ::Grape::Xml::ParseError # handle XML parsing errors via the rescue handlers or provide error message raise Grape::Exceptions::InvalidMessage...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/parser/json.rb
lib/grape/parser/json.rb
# frozen_string_literal: true module Grape module Parser class Json < Base def self.call(object, _env) ::Grape::Json.load(object) rescue ::Grape::Json::ParseError # handle JSON parsing errors via the rescue handlers or provide error message raise Grape::Exceptions::InvalidMess...
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
ruby-grape/grape
https://github.com/ruby-grape/grape/blob/17fb0cf64296e9c9c968ea7b62f7614538070be4/lib/grape/parser/base.rb
lib/grape/parser/base.rb
# frozen_string_literal: true module Grape module Parser class Base def self.call(_object, _env) raise NotImplementedError end def self.inherited(klass) super Parser.register(klass) end end end end
ruby
MIT
17fb0cf64296e9c9c968ea7b62f7614538070be4
2026-01-04T15:38:22.454413Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/tasks/benchmark.rb
tasks/benchmark.rb
require "json" require "fileutils" BENCHMARK_FILE_SIZE = 1 * 1024 * 1024 * 1024 BENCHMARK_FILE_PATH = File.expand_path("./tmp/benchmark/data.log") namespace :benchmark do task :init do # Synchronize stdout because the output order is not as intended on Windows environment STDOUT.sync = true end task :p...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/tasks/backport.rb
tasks/backport.rb
require_relative 'backport/backporter' =begin When you want to manually execute backporting, set the following environment variables: * GITHUB_REPOSITORY: fluent/fluentd * GITHUB_TOKEN: ${PERSONAL_ACCESS_TOKEN} Optional: * REPOSITORY_REMOTE: origin If you execute in forked repository, it might be 'upstream' =en...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/tasks/backport/backporter.rb
tasks/backport/backporter.rb
require 'open-uri' require 'json' require 'optparse' require 'logger' class PullRequestBackporter def initialize @logger = Logger.new(STDOUT) @options = { upstream: "fluent/fluentd", branch: "v1.16", dry_run: false, log_level: Logger::Severity::INFO, remote: 'origin' } en...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/tasks/benchmark/patch_in_tail.rb
tasks/benchmark/patch_in_tail.rb
require 'benchmark' require 'fluent/plugin/in_tail' class Fluent::Plugin::TailInput::TailWatcher::IOHandler alias_method :original_with_io, :with_io def with_io(&block) @benchmark_measured_in_tail ||= false # Measure the benchmark only once. return original_with_io(&block) if @benchmark_measured_in_ta...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_event.rb
test/test_event.rb
require_relative 'helper' require 'fluent/test' require 'fluent/event' require 'fluent/plugin/compressable' module EventTest module DeepCopyAssertion def assert_duplicated_records(es1, es2) ary1 = [] es1.each do |_, record| ary1 << record end ary2 = [] es2.each do |_, record...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_event_router.rb
test/test_event_router.rb
require_relative 'helper' require 'fluent/event_router' require_relative 'test_plugin_classes' class EventRouterTest < ::Test::Unit::TestCase include Fluent include FluentTest teardown do @output = nil @filter = nil @compat_filter = nil @error_output = nil @emit_handler = nil @default_co...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_tls.rb
test/test_tls.rb
require_relative 'helper' require 'fluent/tls' class UniqueIdTest < Test::Unit::TestCase TEST_TLS1_1_CASES = { 'New TLS v1.1' => :'TLS1_1', 'Old TLS v1.1' => :'TLSv1_1', } TEST_TLS1_2_CASES = { 'New TLS v1.2' => :'TLS1_2', 'Old TLS v1.2' => :'TLSv1_2' } TEST_TLS1_3_CASES = { 'New TLS v1.3...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_configdsl.rb
test/test_configdsl.rb
require_relative 'helper' require 'fluent/config/dsl' require 'fluent/test' require 'tempfile' class ConfigDSLTest < Test::Unit::TestCase # TEST_CONFIG1 = %[ # <source> # type forward # port 24224 # </source> # <match test.**> # type forward # flush_interval 1s # <server> ...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_variable_store.rb
test/test_variable_store.rb
require_relative 'helper' require 'fluent/variable_store' class VariableStoreTest < Test::Unit::TestCase def setup end def teardown Fluent::VariableStore.try_to_reset do # nothing end end sub_test_case '#fetch_or_build' do test 'fetch same object when the same key is passed' do c1 =...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_formatter.rb
test/test_formatter.rb
require_relative 'helper' require 'fluent/test' require 'fluent/formatter' module FormatterTest include Fluent def tag 'tag' end def record {'message' => 'awesome', 'greeting' => 'hello'} end class BaseFormatterTest < ::Test::Unit::TestCase include FormatterTest def test_call form...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_msgpack_factory.rb
test/test_msgpack_factory.rb
require_relative 'helper' require 'fluent/msgpack_factory' class MessagePackFactoryTest < Test::Unit::TestCase test 'call log.warn only once' do klass = Class.new do include Fluent::MessagePackFactory::Mixin end mp = klass.new mock.proxy($log).warn(anything).once assert mp.msgpack_factor...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_input.rb
test/test_input.rb
require_relative 'helper' require 'fluent/input' class FluentInputTest < ::Test::Unit::TestCase include Fluent def setup Fluent::Test.setup end def create_driver(conf = '') Fluent::Test::InputTestDriver.new(Fluent::Input).configure(conf, true) end def test_router d = create_driver assert...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_filter.rb
test/test_filter.rb
require_relative 'helper' require 'fluent/filter' class FilterTest < Test::Unit::TestCase include Fluent setup do Fluent::Test.setup @time = Fluent::Engine.now end def create_driver(klass = Fluent::Filter, conf = '') Test::FilterTestDriver.new(klass).configure(conf, true) end def emit(klass,...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_source_only_buffer_agent.rb
test/test_source_only_buffer_agent.rb
require_relative 'helper' class SourceOnlyBufferAgentTest < ::Test::Unit::TestCase def log logger = ServerEngine::DaemonLogger.new( Fluent::Test::DummyLogDevice.new, { log_level: ServerEngine::DaemonLogger::INFO } ) Fluent::Log.new(logger) end def setup omit "Not supported on Windows...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_static_config_analysis.rb
test/test_static_config_analysis.rb
require_relative 'helper' require 'fluent/config' require 'fluent/static_config_analysis' require 'fluent/plugin/out_forward' require 'fluent/plugin/out_stdout' require 'fluent/plugin/out_exec' require 'fluent/plugin/in_forward' require 'fluent/plugin/in_sample' require 'fluent/plugin/filter_grep' require 'fluent/plug...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_output.rb
test/test_output.rb
require_relative 'helper' require 'fluent/test' require 'fluent/output' require 'fluent/output_chain' require 'fluent/plugin/buffer' require 'timecop' require 'flexmock/test_unit' module FluentOutputTest include Fluent include FlexMock::TestCase class BufferedOutputTest < ::Test::Unit::TestCase include Flue...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_fluent_log_event_router.rb
test/test_fluent_log_event_router.rb
require_relative 'helper' require 'fluent/fluent_log_event_router' require 'fluent/root_agent' require 'fluent/system_config' class FluentLogEventRouterTest < ::Test::Unit::TestCase # @param config [String] def build_config(config) Fluent::Config.parse(config, 'fluent_log_event', '', syntax: :v1) end sub_...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_capability.rb
test/test_capability.rb
require_relative 'helper' require 'fluent/test' require 'fluent/capability' class FluentCapabilityTest < ::Test::Unit::TestCase setup do @capability = Fluent::Capability.new(:current_process) omit "Fluent::Capability class is not usable on this environment" unless @capability.usable? end sub_test_case "...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_plugin.rb
test/test_plugin.rb
require_relative 'helper' require 'fluent/plugin' require 'fluent/plugin/input' require 'fluent/plugin/filter' require 'fluent/plugin/output' require 'fluent/plugin/buffer' require 'fluent/plugin/parser' require 'fluent/plugin/formatter' require 'fluent/plugin/storage' class PluginTest < Test::Unit::TestCase class ...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_time_formatter.rb
test/test_time_formatter.rb
require_relative 'helper' require 'fluent/test' require 'fluent/time' class TimeFormatterTest < ::Test::Unit::TestCase setup do @fmt ="%Y%m%d %H%M%z" # YYYYMMDD HHMM[+-]HHMM end def format(format, localtime, timezone) formatter = Fluent::TimeFormatter.new(format, localtime, timezone) formatter.form...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_plugin_classes.rb
test/test_plugin_classes.rb
require_relative 'helper' require 'fluent/plugin/input' require 'fluent/plugin/output' require 'fluent/plugin/bare_output' require 'fluent/plugin/filter' module FluentTest class FluentTestCounterMetrics < Fluent::Plugin::Metrics Fluent::Plugin.register_metrics('test_counter', self) attr_reader :data de...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_supervisor.rb
test/test_supervisor.rb
require_relative 'helper' require 'fluent/event_router' require 'fluent/system_config' require 'fluent/supervisor' require 'fluent/file_wrapper' require_relative 'test_plugin_classes' require 'net/http' require 'uri' require 'fileutils' require 'tempfile' require 'securerandom' require 'pathname' if Fluent.windows? ...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
true
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_config.rb
test/test_config.rb
require_relative 'helper' require 'fluent/config' require 'fluent/config/parser' require 'fluent/supervisor' require 'fluent/load' require 'fileutils' class ConfigTest < Test::Unit::TestCase include Fluent TMP_DIR = File.dirname(__FILE__) + "/tmp/config#{ENV['TEST_ENV_NUMBER']}" def read_config(path, use_yaml:...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_event_time.rb
test/test_event_time.rb
require_relative 'helper' require 'timecop' require 'oj' require 'yajl' class EventTimeTest < Test::Unit::TestCase setup do @now = Time.now Timecop.freeze(@now) end teardown do Timecop.return end test '#sec' do assert_equal(1, Fluent::EventTime.new(1, 2).sec) end test '#nsec' do as...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_plugin_id.rb
test/test_plugin_id.rb
require_relative 'helper' require 'fluent/plugin/base' require 'fluent/system_config' require 'fileutils' class PluginIdTest < Test::Unit::TestCase TMP_DIR = File.expand_path(File.dirname(__FILE__) + "/tmp/plugin_id/#{ENV['TEST_ENV_NUMBER']}") class MyPlugin < Fluent::Plugin::Base include Fluent::PluginId e...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_process.rb
test/test_process.rb
require_relative 'helper' require 'fluent/process' class ProcessCompatibilityTest < ::Test::Unit::TestCase test 'DetachProcessMixin is defined' do assert defined?(::Fluent::DetachProcessMixin) assert_equal ::Fluent::DetachProcessMixin, ::Fluent::Compat::DetachProcessMixin end test 'DetachMultiProcessMix...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_engine.rb
test/test_engine.rb
require_relative 'helper' require 'fluent/engine' require 'fluent/config' require 'fluent/input' require 'fluent/system_config' class EngineTest < ::Test::Unit::TestCase class DummyEngineTestOutput < Fluent::Plugin::Output Fluent::Plugin.register_output('dummy_engine_test', self) def write(chunk); end end ...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_clock.rb
test/test_clock.rb
require_relative 'helper' require 'fluent/clock' require 'timecop' class ClockTest < ::Test::Unit::TestCase teardown do Fluent::Clock.return # call it always not to affect other tests end sub_test_case 'without any pre-operation' do test 'clock can provides incremental floating point number based on se...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_plugin_helper.rb
test/test_plugin_helper.rb
require_relative 'helper' require 'fluent/plugin_helper' require 'fluent/plugin/base' class PluginHelperTest < Test::Unit::TestCase module FluentTest; end sub_test_case 'Fluent::Plugin::Base.helpers method works as shortcut to include helper modules' do class FluentTest::PluginTest1 < Fluent::Plugin::TestBase...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_mixin.rb
test/test_mixin.rb
require_relative 'helper' require 'fluent/mixin' require 'fluent/env' require 'fluent/plugin' require 'fluent/config' require 'fluent/test' require 'timecop' module MixinTest module Utils def setup super Fluent::Test.setup @time = Time.utc(1,2,3,4,5,2010,nil,nil,nil,nil) Timecop.freeze(@t...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_daemonizer.rb
test/test_daemonizer.rb
require_relative 'helper' require 'fluent/daemonizer' class DaemonizerTest < ::Test::Unit::TestCase TMP_DIR = File.join(File.dirname(__FILE__), 'tmp', 'daemonizer') setup do FileUtils.mkdir_p(TMP_DIR) end teardown do FileUtils.rm_rf(TMP_DIR) rescue nil end test 'makes pid file' do pid_path =...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/helper.rb
test/helper.rb
# simplecov must be loaded before any of target code if ENV['SIMPLE_COV'] require 'simplecov' if defined?(SimpleCov::SourceFile) mod = SimpleCov::SourceFile def mod.new(*args, &block) m = allocate m.instance_eval do begin initialize(*args, &block) rescue Encoding::Undef...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_match.rb
test/test_match.rb
require_relative 'helper' require 'fluent/match' class MatchTest < Test::Unit::TestCase include Fluent def test_simple assert_glob_match('a', 'a') assert_glob_match('a.b', 'a.b') assert_glob_not_match('a', 'b') assert_glob_not_match('a.b', 'aab') end def test_wildcard assert_glob_match('a...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_file_wrapper.rb
test/test_file_wrapper.rb
require_relative 'helper' require 'fluent/file_wrapper' class FileWrapperTest < Test::Unit::TestCase TMP_DIR = File.dirname(__FILE__) + "/../tmp/file_wrapper#{ENV['TEST_ENV_NUMBER']}" def setup FileUtils.mkdir_p(TMP_DIR) end def teardown FileUtils.rm_rf(TMP_DIR) end sub_test_case 'WindowsFile ex...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_time_parser.rb
test/test_time_parser.rb
require_relative 'helper' require 'fluent/test' require 'fluent/time' class TimeParserTest < ::Test::Unit::TestCase def setup Fluent::Test.setup end def test_call_with_parse parser = Fluent::TimeParser.new assert(parser.parse('2013-09-18 12:00:00 +0900').is_a?(Fluent::EventTime)) time = event_...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_test_drivers.rb
test/test_test_drivers.rb
require_relative 'helper' require 'fluent/plugin/input' require 'fluent/test/driver/input' require 'fluent/plugin/output' require 'fluent/test/driver/output' require 'fluent/plugin/filter' require 'fluent/test/driver/filter' require 'fluent/plugin/multi_output' require 'fluent/test/driver/multi_output' require 'fluent/...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_log.rb
test/test_log.rb
require_relative 'helper' require 'fluent/test/driver/input' require 'fluent/engine' require 'fluent/log' require 'timecop' require 'logger' require 'securerandom' require 'pathname' class LogTest < Test::Unit::TestCase def tmp_dir File.join(File.dirname(__FILE__), "tmp", "log", "#{ENV['TEST_ENV_NUMBER']}", Secu...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
true
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_oj_options.rb
test/test_oj_options.rb
require_relative 'helper' require 'fluent/test' require 'fluent/oj_options' class OjOptionsTest < ::Test::Unit::TestCase begin require 'oj' @@oj_is_available = true rescue LoadError @@oj_is_available = false end setup do @orig_env = {} ENV.each do |key, value| @orig_env[key] = value ...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false
fluent/fluentd
https://github.com/fluent/fluentd/blob/088cb0c98b56feeec0e6da70d1314a25ffd19d0a/test/test_unique_id.rb
test/test_unique_id.rb
require_relative 'helper' require 'fluent/plugin/base' require 'fluent/unique_id' module UniqueIdTestEnv class Dummy < Fluent::Plugin::Base include Fluent::UniqueId::Mixin end end class UniqueIdTest < Test::Unit::TestCase sub_test_case 'module used directly' do test '.generate generates 128bit length un...
ruby
Apache-2.0
088cb0c98b56feeec0e6da70d1314a25ffd19d0a
2026-01-04T15:37:30.958053Z
false