primer_view_components 0.0.118 → 0.0.120
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +32 -0
- data/app/assets/javascripts/primer_view_components.js +1 -1
- data/app/assets/javascripts/primer_view_components.js.map +1 -1
- data/app/assets/styles/primer_view_components.css +1 -1
- data/app/assets/styles/primer_view_components.css.map +1 -1
- data/app/components/primer/alpha/action_list/item.rb +1 -1
- data/app/components/primer/alpha/action_list.rb +1 -1
- data/app/components/primer/alpha/dialog.rb +2 -2
- data/app/components/primer/alpha/modal_dialog.js +2 -0
- data/app/components/primer/alpha/modal_dialog.ts +2 -0
- data/app/components/primer/alpha/text_field.css +1 -1
- data/app/components/primer/alpha/text_field.css.json +1 -1
- data/app/components/primer/alpha/text_field.css.map +1 -1
- data/app/components/primer/alpha/text_field.pcss +6 -0
- data/app/components/primer/alpha/toggle_switch.css +1 -1
- data/app/components/primer/alpha/toggle_switch.css.json +1 -1
- data/app/components/primer/alpha/toggle_switch.css.map +1 -1
- data/app/components/primer/alpha/toggle_switch.html.erb +4 -2
- data/app/components/primer/alpha/toggle_switch.js +23 -11
- data/app/components/primer/alpha/toggle_switch.pcss +6 -0
- data/app/components/primer/alpha/toggle_switch.ts +27 -11
- data/app/components/primer/alpha/tool_tip.js +0 -3
- data/app/components/primer/alpha/tool_tip.ts +0 -4
- data/app/components/primer/alpha/tooltip.rb +4 -3
- data/app/components/primer/beta/icon_button.rb +1 -1
- data/app/components/primer/component.rb +4 -0
- data/app/components/primer/icon_button.rb +1 -1
- data/app/components/primer/primer.d.ts +1 -0
- data/app/components/primer/primer.js +1 -0
- data/app/components/primer/primer.ts +1 -0
- data/app/forms/example_toggle_switch_form.rb +1 -1
- data/lib/primer/deprecations.yml +0 -13
- data/lib/primer/forms/dsl/input.rb +1 -1
- data/lib/primer/forms/toggle_switch.html.erb +7 -2
- data/lib/primer/forms/toggle_switch.rb +2 -4
- data/lib/primer/forms/toggle_switch_input.d.ts +5 -0
- data/lib/primer/forms/toggle_switch_input.js +29 -0
- data/lib/primer/forms/toggle_switch_input.ts +19 -0
- data/lib/primer/view_components/linters/button_component_migration_counter.rb +2 -2
- data/lib/primer/view_components/version.rb +1 -1
- data/lib/primer/view_components.rb +5 -0
- data/lib/primer/yard/backend.rb +38 -0
- data/lib/primer/yard/component_manifest.rb +123 -0
- data/lib/primer/yard/docs_helper.rb +81 -0
- data/lib/primer/yard/legacy_gatsby_backend.rb +271 -0
- data/lib/primer/yard/registry.rb +146 -0
- data/lib/primer/yard/renders_many_handler.rb +23 -0
- data/lib/primer/yard/renders_one_handler.rb +23 -0
- data/lib/rubocop/config/default.yml +3 -0
- data/lib/rubocop/cop/primer/test_selector.rb +48 -0
- data/lib/tasks/docs.rake +37 -405
- data/previews/primer/alpha/dialog_preview/body_has_scrollbar_overflow.html.erb +9 -0
- data/previews/primer/alpha/dialog_preview.rb +15 -0
- data/previews/primer/alpha/tooltip_preview.rb +8 -8
- data/previews/primer/beta/clipboard_copy_preview.rb +1 -1
- data/previews/primer/forms/forms_preview/example_toggle_switch_form.html.erb +3 -1
- data/static/arguments.json +2 -34
- data/static/audited_at.json +0 -3
- data/static/constants.json +0 -20
- data/static/statuses.json +0 -3
- metadata +20 -29
- data/app/components/primer/box_component.rb +0 -7
- data/app/components/primer/clipboard_copy.rb +0 -7
- data/app/components/primer/dropdown_menu_component.html.erb +0 -8
- data/app/components/primer/dropdown_menu_component.rb +0 -58
- data/lib/yard/docs_helper.rb +0 -79
- data/lib/yard/renders_many_handler.rb +0 -19
- data/lib/yard/renders_one_handler.rb +0 -19
data/static/arguments.json
CHANGED
@@ -194,7 +194,7 @@
|
|
194
194
|
{
|
195
195
|
"name": "id",
|
196
196
|
"type": "String",
|
197
|
-
"default": "`
|
197
|
+
"default": "`self.class.generate_id`",
|
198
198
|
"description": "Used internally."
|
199
199
|
},
|
200
200
|
{
|
@@ -308,7 +308,7 @@
|
|
308
308
|
{
|
309
309
|
"name": "id",
|
310
310
|
"type": "String",
|
311
|
-
"default": "
|
311
|
+
"default": "`self.class.generate_id`",
|
312
312
|
"description": "The id of the dialog."
|
313
313
|
},
|
314
314
|
{
|
@@ -2231,38 +2231,6 @@
|
|
2231
2231
|
}
|
2232
2232
|
]
|
2233
2233
|
},
|
2234
|
-
{
|
2235
|
-
"component": "DropdownMenu",
|
2236
|
-
"status": "deprecated",
|
2237
|
-
"source": "https://github.com/primer/view_components/tree/main/app/components/primer/dropdown_menu_component.rb",
|
2238
|
-
"lookbook": "https://primer.style/view-components/lookbook/inspect/primer/dropdown_menu/default/",
|
2239
|
-
"parameters": [
|
2240
|
-
{
|
2241
|
-
"name": "direction",
|
2242
|
-
"type": "Symbol",
|
2243
|
-
"default": "`:se`",
|
2244
|
-
"description": "One of `:e`, `:ne`, `:s`, `:se`, `:sw`, or `:w`."
|
2245
|
-
},
|
2246
|
-
{
|
2247
|
-
"name": "scheme",
|
2248
|
-
"type": "Symbol",
|
2249
|
-
"default": "`:default`",
|
2250
|
-
"description": "Pass `:dark` for dark mode theming"
|
2251
|
-
},
|
2252
|
-
{
|
2253
|
-
"name": "header",
|
2254
|
-
"type": "String",
|
2255
|
-
"default": "`nil`",
|
2256
|
-
"description": "Optional string to display as the header"
|
2257
|
-
},
|
2258
|
-
{
|
2259
|
-
"name": "system_arguments",
|
2260
|
-
"type": "Hash",
|
2261
|
-
"default": "N/A",
|
2262
|
-
"description": "[System arguments](/system-arguments)"
|
2263
|
-
}
|
2264
|
-
]
|
2265
|
-
},
|
2266
2234
|
{
|
2267
2235
|
"component": "IconButton",
|
2268
2236
|
"status": "deprecated",
|
data/static/audited_at.json
CHANGED
@@ -73,15 +73,12 @@
|
|
73
73
|
"Primer::Beta::Truncate::TruncateText": "",
|
74
74
|
"Primer::BlankslateComponent": "",
|
75
75
|
"Primer::Box": "",
|
76
|
-
"Primer::BoxComponent": "",
|
77
76
|
"Primer::ButtonComponent": "",
|
78
|
-
"Primer::ClipboardCopy": "",
|
79
77
|
"Primer::ConditionalWrapper": "",
|
80
78
|
"Primer::Content": "",
|
81
79
|
"Primer::Dropdown": "",
|
82
80
|
"Primer::Dropdown::Menu": "",
|
83
81
|
"Primer::Dropdown::Menu::Item": "",
|
84
|
-
"Primer::DropdownMenuComponent": "",
|
85
82
|
"Primer::HellipButton": "",
|
86
83
|
"Primer::IconButton": "",
|
87
84
|
"Primer::LabelComponent": "",
|
data/static/constants.json
CHANGED
@@ -1000,8 +1000,6 @@
|
|
1000
1000
|
},
|
1001
1001
|
"Primer::Box": {
|
1002
1002
|
},
|
1003
|
-
"Primer::BoxComponent": {
|
1004
|
-
},
|
1005
1003
|
"Primer::ButtonComponent": {
|
1006
1004
|
"DEFAULT_SCHEME": "default",
|
1007
1005
|
"DEFAULT_SIZE": "medium",
|
@@ -1031,8 +1029,6 @@
|
|
1031
1029
|
"medium"
|
1032
1030
|
]
|
1033
1031
|
},
|
1034
|
-
"Primer::ClipboardCopy": {
|
1035
|
-
},
|
1036
1032
|
"Primer::ConditionalWrapper": {
|
1037
1033
|
},
|
1038
1034
|
"Primer::Content": {
|
@@ -1045,22 +1041,6 @@
|
|
1045
1041
|
},
|
1046
1042
|
"Primer::Dropdown::Menu::Item": {
|
1047
1043
|
},
|
1048
|
-
"Primer::DropdownMenuComponent": {
|
1049
|
-
"DIRECTION_DEFAULT": "se",
|
1050
|
-
"DIRECTION_OPTIONS": [
|
1051
|
-
"se",
|
1052
|
-
"sw",
|
1053
|
-
"w",
|
1054
|
-
"e",
|
1055
|
-
"ne",
|
1056
|
-
"s"
|
1057
|
-
],
|
1058
|
-
"SCHEME_DEFAULT": "default",
|
1059
|
-
"SCHEME_MAPPINGS": {
|
1060
|
-
"default": "",
|
1061
|
-
"dark": "dropdown-menu-dark"
|
1062
|
-
}
|
1063
|
-
},
|
1064
1044
|
"Primer::HellipButton": {
|
1065
1045
|
},
|
1066
1046
|
"Primer::IconButton": {
|
data/static/statuses.json
CHANGED
@@ -73,15 +73,12 @@
|
|
73
73
|
"Primer::Beta::Truncate::TruncateText": "alpha",
|
74
74
|
"Primer::BlankslateComponent": "deprecated",
|
75
75
|
"Primer::Box": "stable",
|
76
|
-
"Primer::BoxComponent": "deprecated",
|
77
76
|
"Primer::ButtonComponent": "deprecated",
|
78
|
-
"Primer::ClipboardCopy": "deprecated",
|
79
77
|
"Primer::ConditionalWrapper": "alpha",
|
80
78
|
"Primer::Content": "stable",
|
81
79
|
"Primer::Dropdown": "deprecated",
|
82
80
|
"Primer::Dropdown::Menu": "deprecated",
|
83
81
|
"Primer::Dropdown::Menu::Item": "deprecated",
|
84
|
-
"Primer::DropdownMenuComponent": "deprecated",
|
85
82
|
"Primer::HellipButton": "deprecated",
|
86
83
|
"Primer::IconButton": "deprecated",
|
87
84
|
"Primer::LabelComponent": "deprecated",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: primer_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.120
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitHub Open Source
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|
@@ -56,22 +56,22 @@ dependencies:
|
|
56
56
|
name: view_component
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: '2.0'
|
62
62
|
- - "<"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: '
|
64
|
+
version: '4.0'
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
|
-
- - "
|
69
|
+
- - ">"
|
70
70
|
- !ruby/object:Gem::Version
|
71
|
-
version: 2.
|
71
|
+
version: '2.0'
|
72
72
|
- - "<"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '4.0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: allocation_stats
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,20 +100,6 @@ dependencies:
|
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: 0.6.3
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: axe-core-api
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: 4.2.0
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: 4.2.0
|
117
103
|
- !ruby/object:Gem::Dependency
|
118
104
|
name: benchmark-ips
|
119
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -672,17 +658,13 @@ files:
|
|
672
658
|
- app/components/primer/blankslate_component.html.erb
|
673
659
|
- app/components/primer/blankslate_component.rb
|
674
660
|
- app/components/primer/box.rb
|
675
|
-
- app/components/primer/box_component.rb
|
676
661
|
- app/components/primer/button_component.html.erb
|
677
662
|
- app/components/primer/button_component.rb
|
678
|
-
- app/components/primer/clipboard_copy.rb
|
679
663
|
- app/components/primer/component.rb
|
680
664
|
- app/components/primer/conditional_wrapper.rb
|
681
665
|
- app/components/primer/content.rb
|
682
666
|
- app/components/primer/dropdown.rb
|
683
667
|
- app/components/primer/dropdown/menu.rb
|
684
|
-
- app/components/primer/dropdown_menu_component.html.erb
|
685
|
-
- app/components/primer/dropdown_menu_component.rb
|
686
668
|
- app/components/primer/hellip_button.rb
|
687
669
|
- app/components/primer/icon_button.html.erb
|
688
670
|
- app/components/primer/icon_button.rb
|
@@ -851,6 +833,9 @@ files:
|
|
851
833
|
- lib/primer/forms/toggle_switch.html.erb
|
852
834
|
- lib/primer/forms/toggle_switch.rb
|
853
835
|
- lib/primer/forms/toggle_switch_form.rb
|
836
|
+
- lib/primer/forms/toggle_switch_input.d.ts
|
837
|
+
- lib/primer/forms/toggle_switch_input.js
|
838
|
+
- lib/primer/forms/toggle_switch_input.ts
|
854
839
|
- lib/primer/forms/utils.rb
|
855
840
|
- lib/primer/view_components.rb
|
856
841
|
- lib/primer/view_components/audited.rb
|
@@ -888,6 +873,13 @@ files:
|
|
888
873
|
- lib/primer/view_components/linters/two_column_layout_migration_counter.rb
|
889
874
|
- lib/primer/view_components/statuses.rb
|
890
875
|
- lib/primer/view_components/version.rb
|
876
|
+
- lib/primer/yard/backend.rb
|
877
|
+
- lib/primer/yard/component_manifest.rb
|
878
|
+
- lib/primer/yard/docs_helper.rb
|
879
|
+
- lib/primer/yard/legacy_gatsby_backend.rb
|
880
|
+
- lib/primer/yard/registry.rb
|
881
|
+
- lib/primer/yard/renders_many_handler.rb
|
882
|
+
- lib/primer/yard/renders_one_handler.rb
|
891
883
|
- lib/rubocop/config/default.yml
|
892
884
|
- lib/rubocop/cop/primer.rb
|
893
885
|
- lib/rubocop/cop/primer/base_cop.rb
|
@@ -901,6 +893,7 @@ files:
|
|
901
893
|
- lib/rubocop/cop/primer/no_tag_memoize.rb
|
902
894
|
- lib/rubocop/cop/primer/primer_octicon.rb
|
903
895
|
- lib/rubocop/cop/primer/system_argument_instead_of_class.rb
|
896
|
+
- lib/rubocop/cop/primer/test_selector.rb
|
904
897
|
- lib/tasks/custom_utilities.yml
|
905
898
|
- lib/tasks/docs.rake
|
906
899
|
- lib/tasks/helpers/ast_processor.rb
|
@@ -909,9 +902,6 @@ files:
|
|
909
902
|
- lib/tasks/static.rake
|
910
903
|
- lib/tasks/test.rake
|
911
904
|
- lib/tasks/utilities.rake
|
912
|
-
- lib/yard/docs_helper.rb
|
913
|
-
- lib/yard/renders_many_handler.rb
|
914
|
-
- lib/yard/renders_one_handler.rb
|
915
905
|
- previews/primer/alpha/action_list_preview.rb
|
916
906
|
- previews/primer/alpha/action_list_preview/heading.html.erb
|
917
907
|
- previews/primer/alpha/auto_complete_preview.rb
|
@@ -920,6 +910,7 @@ files:
|
|
920
910
|
- previews/primer/alpha/banner_preview/with_action_content.html.erb
|
921
911
|
- previews/primer/alpha/button_marketing_preview.rb
|
922
912
|
- previews/primer/alpha/dialog_preview.rb
|
913
|
+
- previews/primer/alpha/dialog_preview/body_has_scrollbar_overflow.html.erb
|
923
914
|
- previews/primer/alpha/dialog_preview/custom_header.html.erb
|
924
915
|
- previews/primer/alpha/dialog_preview/nested_dialog.html.erb
|
925
916
|
- previews/primer/alpha/dialog_preview/test.html.erb
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Primer
|
4
|
-
# DropdownMenus are lightweight context menus for housing navigation and actions.
|
5
|
-
# They're great for instances where you don't need the full power (and code)
|
6
|
-
# of the select menu.
|
7
|
-
class DropdownMenuComponent < Primer::Component
|
8
|
-
status :deprecated
|
9
|
-
|
10
|
-
SCHEME_DEFAULT = :default
|
11
|
-
SCHEME_MAPPINGS = {
|
12
|
-
SCHEME_DEFAULT => "",
|
13
|
-
:dark => "dropdown-menu-dark"
|
14
|
-
}.freeze
|
15
|
-
|
16
|
-
DIRECTION_DEFAULT = :se
|
17
|
-
DIRECTION_OPTIONS = [DIRECTION_DEFAULT, :sw, :w, :e, :ne, :s].freeze
|
18
|
-
|
19
|
-
# @example With a header
|
20
|
-
# <div>
|
21
|
-
# <%= render(Primer::Beta::Details.new(overlay: :default, reset: true, position: :relative)) do |component| %>
|
22
|
-
# <% component.with_summary do %>
|
23
|
-
# Dropdown
|
24
|
-
# <% end %>
|
25
|
-
#
|
26
|
-
# <% component.with_body do %>
|
27
|
-
# <%= render(Primer::DropdownMenuComponent.new(header: "Options")) do %>
|
28
|
-
# <ul>
|
29
|
-
# <li><a class="dropdown-item" href="#url">Dropdown item</a></li>
|
30
|
-
# <li><a class="dropdown-item" href="#url">Dropdown item</a></li>
|
31
|
-
# <li><a class="dropdown-item" href="#url">Dropdown item</a></li>
|
32
|
-
# </ul>
|
33
|
-
# <% end %>
|
34
|
-
# <% end %>
|
35
|
-
# <% end %>
|
36
|
-
# </div>
|
37
|
-
#
|
38
|
-
# @param direction [Symbol] <%= one_of(Primer::DropdownMenuComponent::DIRECTION_OPTIONS) %>
|
39
|
-
# @param scheme [Symbol] Pass `:dark` for dark mode theming
|
40
|
-
# @param header [String] Optional string to display as the header
|
41
|
-
# @param system_arguments [Hash] <%= link_to_system_arguments_docs %>
|
42
|
-
def initialize(direction: DIRECTION_DEFAULT, scheme: SCHEME_DEFAULT, header: nil, **system_arguments)
|
43
|
-
@header = header
|
44
|
-
@direction = direction
|
45
|
-
@system_arguments = deny_tag_argument(**system_arguments)
|
46
|
-
|
47
|
-
@system_arguments[:tag] = "details-menu"
|
48
|
-
@system_arguments[:role] = "menu"
|
49
|
-
|
50
|
-
@system_arguments[:classes] = class_names(
|
51
|
-
@system_arguments[:classes],
|
52
|
-
"dropdown-menu",
|
53
|
-
"dropdown-menu-#{fetch_or_fallback(DIRECTION_OPTIONS, direction, DIRECTION_DEFAULT)}",
|
54
|
-
SCHEME_MAPPINGS[fetch_or_fallback(SCHEME_MAPPINGS.keys, scheme, SCHEME_DEFAULT)]
|
55
|
-
)
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
data/lib/yard/docs_helper.rb
DELETED
@@ -1,79 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# :nocov:
|
4
|
-
|
5
|
-
module YARD
|
6
|
-
# Helper methods to use for yard documentation
|
7
|
-
module DocsHelper
|
8
|
-
def one_of(enumerable, lower: false, sort: true)
|
9
|
-
# Sort the array if requested
|
10
|
-
if sort
|
11
|
-
enumerable = enumerable.sort do |a, b|
|
12
|
-
a.instance_of?(b.class) ? a <=> b : a.class.to_s <=> b.class.to_s
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
values =
|
17
|
-
case enumerable
|
18
|
-
when Hash
|
19
|
-
enumerable.map do |key, value|
|
20
|
-
"#{pretty_value(key)} (#{pretty_value(value)})"
|
21
|
-
end
|
22
|
-
else
|
23
|
-
enumerable.map do |key|
|
24
|
-
pretty_value(key)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
prefix = "One of"
|
29
|
-
prefix = prefix.downcase if lower
|
30
|
-
|
31
|
-
"#{prefix} #{values.to_sentence(two_words_connector: ' or ', last_word_connector: ', or ')}."
|
32
|
-
end
|
33
|
-
|
34
|
-
def link_to_accessibility
|
35
|
-
"[Accessibility](#accessibility)"
|
36
|
-
end
|
37
|
-
|
38
|
-
def link_to_system_arguments_docs
|
39
|
-
"[System arguments](/system-arguments)"
|
40
|
-
end
|
41
|
-
|
42
|
-
def link_to_typography_docs
|
43
|
-
"[Typography](/system-arguments#typography)"
|
44
|
-
end
|
45
|
-
|
46
|
-
def link_to_component(component)
|
47
|
-
status_module, short_name, class_name = status_module_and_short_name(component)
|
48
|
-
status_path = status_module.nil? ? "" : "#{status_module}/"
|
49
|
-
|
50
|
-
"[#{class_name}](/components/#{status_path}#{short_name.downcase})"
|
51
|
-
end
|
52
|
-
|
53
|
-
def link_to_octicons
|
54
|
-
"[Octicon](https://primer.style/octicons/)"
|
55
|
-
end
|
56
|
-
|
57
|
-
def link_to_heading_practices
|
58
|
-
"[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)"
|
59
|
-
end
|
60
|
-
|
61
|
-
def status_module_and_short_name(component)
|
62
|
-
name_with_status = component.name.gsub(/Primer::|Component/, "")
|
63
|
-
|
64
|
-
m = name_with_status.match(/(?<status>Beta|Alpha|Deprecated)?(?<_colons>::)?(?<name>.*)/)
|
65
|
-
[m[:status]&.downcase, m[:name].gsub("::", ""), m[:name]]
|
66
|
-
end
|
67
|
-
|
68
|
-
def pretty_value(val)
|
69
|
-
case val
|
70
|
-
when nil
|
71
|
-
"`nil`"
|
72
|
-
when Symbol
|
73
|
-
"`:#{val}`"
|
74
|
-
else
|
75
|
-
"`#{val}`"
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module YARD
|
4
|
-
# YARD Handler to parse `renders_many` calls.
|
5
|
-
class RendersManyHandler < YARD::Handlers::Ruby::Base
|
6
|
-
handles method_call(:renders_many)
|
7
|
-
namespace_only
|
8
|
-
|
9
|
-
process do
|
10
|
-
name = statement.parameters.first.jump(:tstring_content, :ident).source
|
11
|
-
object = YARD::CodeObjects::MethodObject.new(namespace, name)
|
12
|
-
register(object)
|
13
|
-
parse_block(statement.last, owner: object)
|
14
|
-
|
15
|
-
object.dynamic = true
|
16
|
-
object[:renders_many] = true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module YARD
|
4
|
-
# YARD Handler to parse `renders_one` calls.
|
5
|
-
class RendersOneHandler < YARD::Handlers::Ruby::Base
|
6
|
-
handles method_call(:renders_one)
|
7
|
-
namespace_only
|
8
|
-
|
9
|
-
process do
|
10
|
-
name = statement.parameters.first.jump(:tstring_content, :ident).source
|
11
|
-
object = YARD::CodeObjects::MethodObject.new(namespace, name)
|
12
|
-
register(object)
|
13
|
-
parse_block(statement.last, owner: object)
|
14
|
-
|
15
|
-
object.dynamic = true
|
16
|
-
object[:renders_one] = true
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|