ariadne_view_components 0.0.44-x86_64-darwin → 0.0.46-x86_64-darwin
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/app/lib/ariadne/action_view_extensions/form_helper.rb +30 -0
- data/app/lib/ariadne/audited/dsl.rb +32 -0
- data/app/lib/ariadne/class_name_helper.rb +22 -0
- data/app/lib/ariadne/fetch_or_fallback_helper.rb +110 -0
- data/app/lib/ariadne/form_builder.rb +74 -0
- data/app/lib/ariadne/icon_helper.rb +51 -0
- data/app/lib/ariadne/logger_helper.rb +23 -0
- data/app/lib/ariadne/status/dsl.rb +41 -0
- data/app/lib/ariadne/view_helper.rb +22 -0
- data/lib/ariadne/view_components/version.rb +1 -1
- metadata +10 -12
- data/lib/tasks/ariadne_view_components.rake +0 -48
- data/lib/tasks/build.rake +0 -30
- data/lib/tasks/coverage.rake +0 -20
- data/lib/tasks/docs.rake +0 -466
- data/lib/tasks/helpers/ast_processor.rb +0 -44
- data/lib/tasks/helpers/ast_traverser.rb +0 -77
- data/lib/tasks/static.rake +0 -15
- data/lib/tasks/test.rake +0 -19
- data/lib/yard/docs_helper.rb +0 -90
- data/lib/yard/renders_many_handler.rb +0 -19
- data/lib/yard/renders_one_handler.rb +0 -19
data/lib/yard/docs_helper.rb
DELETED
@@ -1,90 +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(last_word_connector: ", or ")}."
|
32
|
-
end
|
33
|
-
|
34
|
-
def link_to_accessibility
|
35
|
-
"[Accessibility](#accessibility)"
|
36
|
-
end
|
37
|
-
|
38
|
-
def link_to_classes_docs
|
39
|
-
"[Classes and attributes](/classes-attributes)"
|
40
|
-
end
|
41
|
-
|
42
|
-
def link_to_attributes_docs
|
43
|
-
"[Classes and attributes](/classes-attributes)"
|
44
|
-
end
|
45
|
-
|
46
|
-
def link_to_typography_docs
|
47
|
-
"[Typography](/system-arguments#typography)"
|
48
|
-
end
|
49
|
-
|
50
|
-
def link_to_component(component)
|
51
|
-
(status_module, component_name) = status_module_and_component_name(component)
|
52
|
-
status_path = status_module.nil? ? "" : "/"
|
53
|
-
|
54
|
-
"[#{component_name}](/components/#{status_path}#{component_name.underscore})"
|
55
|
-
end
|
56
|
-
|
57
|
-
def link_to_heroicons
|
58
|
-
"[Heroicon](https://ariadne.style/heroicons/)"
|
59
|
-
end
|
60
|
-
|
61
|
-
def link_to_heading_practices
|
62
|
-
"[Learn more about best heading practices (WAI Headings)](https://www.w3.org/WAI/tutorials/page-structure/headings/)"
|
63
|
-
end
|
64
|
-
|
65
|
-
def status_module_and_short_name(component)
|
66
|
-
name_with_status = component.name.gsub(/Ariadne::|Component/, "")
|
67
|
-
|
68
|
-
m = name_with_status.match(/(?<status>Beta|Alpha|Deprecated)?(?<_colons>::)?(?<name>.*)/)
|
69
|
-
[m[:status]&.downcase, m[:name].gsub("::", "")]
|
70
|
-
end
|
71
|
-
|
72
|
-
def status_module_and_component_name(component)
|
73
|
-
name_with_status = component.name.gsub(/Ariadne::/, "")
|
74
|
-
|
75
|
-
m = name_with_status.match(/(?<status>Beta|Alpha|Deprecated)?(?<_colons>::)?(?<name>.*)/)
|
76
|
-
[m[:status]&.downcase, m[:name].gsub("::", "")]
|
77
|
-
end
|
78
|
-
|
79
|
-
def pretty_value(val)
|
80
|
-
case val
|
81
|
-
when nil
|
82
|
-
"`nil`"
|
83
|
-
when Symbol
|
84
|
-
"`:#{val}`"
|
85
|
-
else
|
86
|
-
"`#{val}`"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
end
|
90
|
-
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
|