Skip to content

Commit afcc7f8

Browse files
Removed <=> operator on ExtensionPresence. Doesn't seem to be needed anyways (looked at code to see if using it and looked at output artifacts).
1 parent 3b84826 commit afcc7f8

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

lib/arch_obj_models/extension.rb

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -625,19 +625,6 @@ def ==(other)
625625
end
626626
end
627627

628-
# @overload <=>(other)
629-
# @param other [String] A presence string
630-
# @return [Integer] Sort alphabetically by presence, then alphabetically by optional_type
631-
def <=>(other)
632-
raise ArgumentError, "ExtensionPresence is only comparable to other ExtensionPresence classes" unless other.is_a?(ExtensionPresence)
633-
634-
if @presence != other.presence
635-
@presence <=> other.presence
636-
else
637-
@optional_type <=> other.optional_type
638-
end
639-
end
640-
641628
######################################################
642629
# Following comparison operators follow these rules:
643630
# - "mandatory" is greater than "optional"
@@ -695,8 +682,12 @@ class ExtensionRequirement
695682
# @return [Array<RequirementSpec>] Set of requirement specifications
696683
def requirement_specs = @requirements
697684

685+
def requirement_specs_to_s
686+
"#{@requirements.map(&:to_s).join(', ')}"
687+
end
688+
698689
def to_s
699-
"#{name} #{@requirements.map(&:to_s).join(', ')}"
690+
"#{name} " + requirement_specs_to_s
700691
end
701692

702693
# @return [Extension] The extension that this requirement is for

lib/arch_obj_models/profile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def ext_req_to_adoc(ext_req)
225225
ext = cfg_arch.extension(ext_req.name)
226226
ret << "* *#{ext_req.name}* " + (ext.nil? ? "" : ext.long_name)
227227
ret << "+"
228-
ret << "Version #{ext_req.requirement_specs}"
228+
ret << "Version #{ext_req.requirement_specs_to_s}"
229229

230230
ret
231231
end

0 commit comments

Comments
 (0)