mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Fix '<anonymous>' showing up for root group
This commit is contained in:
parent
84ac41967b
commit
aee171656a
1 changed files with 10 additions and 11 deletions
|
@ -121,19 +121,18 @@ module Spectator
|
||||||
# Constructs the full name or description of the example group.
|
# Constructs the full name or description of the example group.
|
||||||
# This prepends names of groups this group is part of.
|
# This prepends names of groups this group is part of.
|
||||||
def to_s(io)
|
def to_s(io)
|
||||||
|
# Prefix with group's full name if the node belongs to a group.
|
||||||
|
return unless parent = @group
|
||||||
|
|
||||||
|
parent.to_s(io)
|
||||||
name = @name
|
name = @name
|
||||||
|
|
||||||
# Prefix with group's full name if the node belongs to a group.
|
# Add padding between the node names
|
||||||
if (parent = @group)
|
# only if the names don't appear to be symbolic.
|
||||||
parent.to_s(io)
|
# Skip blank group names (like the root group).
|
||||||
|
io << ' ' unless !parent.name? || # ameba:disable Style/NegatedConditionsInUnless
|
||||||
# Add padding between the node names
|
(parent.name?.is_a?(Symbol) && name.is_a?(String) &&
|
||||||
# only if the names don't appear to be symbolic.
|
(name.starts_with?('#') || name.starts_with?('.')))
|
||||||
# Skip blank group names (like the root group).
|
|
||||||
io << ' ' unless !parent.name? || # ameba:disable Style/NegatedConditionsInUnless
|
|
||||||
(parent.name?.is_a?(Symbol) && name.is_a?(String) &&
|
|
||||||
(name.starts_with?('#') || name.starts_with?('.')))
|
|
||||||
end
|
|
||||||
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue