refactor: reintroduce RangeList
This commit is contained in:
parent
878c2cb95c
commit
49b541b8d9
2 changed files with 7 additions and 4 deletions
|
@ -8,7 +8,7 @@ describe TimeCost::RangeList do
|
|||
|
||||
describe ".new" do
|
||||
it "can be created without arguments" do
|
||||
assert_instance_of TimeCost::RangeList, list
|
||||
list.should be_a(TimeCost::RangeList)
|
||||
end
|
||||
end
|
||||
|
|
@ -4,7 +4,10 @@ module TimeCost
|
|||
@ranges = [] of Range
|
||||
end
|
||||
|
||||
def add(range : Range)
|
||||
def add(commit : Commit) : RangeList
|
||||
end
|
||||
|
||||
def add(range : Range) : RangeList
|
||||
merged = false
|
||||
merged_range = nil
|
||||
|
||||
|
@ -34,7 +37,7 @@ module TimeCost
|
|||
end
|
||||
end
|
||||
|
||||
def sum
|
||||
def sum : Float
|
||||
result = 0
|
||||
@ranges.each do |r|
|
||||
result += r.diff
|
||||
|
|
Loading…
Reference in a new issue