Skip to content

Commit f40a5ca

Browse files
committed
Provide for ordering within the same weight
1 parent 9a37a47 commit f40a5ca

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/octocatalog-diff/cli/options.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,18 @@ def self.has_weight(w) # rubocop:disable Style/PredicateName
2828
@weight = w
2929
end
3030

31+
def self.order_within_weight(w) # rubocop:disable Style/TrivialAccessors
32+
@order_within_weight = w
33+
end
34+
3135
def self.weight
32-
@weight || DEFAULT_WEIGHT
36+
if @weight && @order_within_weight
37+
@weight + (@order_within_weight / 100.0)
38+
elsif @weight
39+
@weight
40+
else
41+
DEFAULT_WEIGHT
42+
end
3343
end
3444

3545
def self.name

0 commit comments

Comments
 (0)