Skip to content
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
6 changes: 4 additions & 2 deletions .yard-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Documentation/EmptyCommentLine:
Enabled: true

Documentation/BlankLineBeforeDefinition:
Enabled: false
Enabled: true
Exclude:
- 'lib/view_component/config.rb'

Tags/Order:
Enabled: true
Expand Down Expand Up @@ -78,7 +80,7 @@ Tags/NonAsciiType:
Enabled: true

Tags/TagGroupSeparator:
Enabled: false
Enabled: true

Tags/ForbiddenTags:
Enabled: true
Expand Down
2 changes: 1 addition & 1 deletion lib/docs/docs_builder_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def docstring
def deprecation_text
@method.tag(:deprecated)&.text
end
# :nocov:

# :nocov:
def docstring_and_deprecation_text
<<~DOCS.strip.html_safe
#{docstring}
Expand Down
1 change: 1 addition & 0 deletions lib/view_component/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def config
# so helpers, etc work as expected.
#
# @param view_context [ActionView::Base] The original view context.
#
# @return [void]
def set_original_view_context(view_context)
# noop
Expand Down
1 change: 1 addition & 0 deletions lib/view_component/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def compile(raise_errors: false, force: false)
end

# @param requested_details [ActionView::TemplateDetails::Requested] i.e. locales, formats, variants
#
# @return all matching compiled templates, in priority order based on the requested details from LookupContext
def find_templates_for(requested_details)
filtered_templates = @templates.select do |template|
Expand Down
4 changes: 4 additions & 0 deletions lib/view_component/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def defaults
end

# @!attribute generate
#
# @return [ActiveSupport::OrderedOptions]
# The subset of configuration options relating to generators.
#
Expand Down Expand Up @@ -95,6 +96,7 @@ def defaults
# in `spec/views/components/` rather than the default `spec/components/`.

# @!attribute previews
#
# @return [ActiveSupport::OrderedOptions]
# The subset of configuration options relating to previews.
#
Expand Down Expand Up @@ -124,6 +126,7 @@ def defaults
#

# @!attribute instrumentation_enabled
#
# @return [Boolean]
# Whether ActiveSupport notifications are enabled.
# Defaults to `false`.
Expand Down Expand Up @@ -171,6 +174,7 @@ def default_previews_options
end

# @!attribute current
#
# @return [ViewComponent::Config]
# Returns the current ViewComponent::Config. This is persisted against this
# class so that config options remain accessible before the rest of
Expand Down
1 change: 1 addition & 0 deletions lib/view_component/system_test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module SystemTestHelpers
# Returns a block that can be used to visit the path of the inline rendered component.
# @param fragment [Nokogiri::Fragment] The fragment returned from `render_inline`.
# @param layout [String] The (optional) layout to use.
#
# @return [Proc] A block that can be used to visit the path of the inline rendered component.
def with_rendered_component_path(fragment, layout: false, &block)
file = Tempfile.new(
Expand Down
3 changes: 3 additions & 0 deletions lib/view_component/test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def assert_component_rendered
# ```
#
# @param component [ViewComponent::Base, ViewComponent::Collection] The instance of the component to be rendered.
#
# @return [Nokogiri::HTML5]
def render_inline(component, **args, &block)
@page = nil
Expand Down Expand Up @@ -74,7 +75,9 @@ def rendered_json
# @param name [String] The name of the preview to be rendered.
# @param from [ViewComponent::Preview] The class of the preview to be rendered.
# @param params [Hash] Parameters to be passed to the preview.
#
# @return [Nokogiri::HTML5]
#
# @note `#rendered_preview` expects a preview to be defined with the same class
# name as the calling test, but with `Test` replaced with `Preview`:
#
Expand Down
Loading