Skip to content

Commit

Permalink
Rename Mel::Progress::Report#moving? to #running?
Browse files Browse the repository at this point in the history
  • Loading branch information
akadusei committed Sep 25, 2023
1 parent 7bd7f80 commit 21ebf02
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Add `Mel::Progress::Report#pending?`

### Changed
- Redefine `Mel::Progress::Report#moving?` to mean the progress is started and is greater than zero
- Rename `Mel::Progress::Report#moving?` to `#running?`
- Redefine `Mel::Progress::Report#running?` to mean the progress is started and is greater than zero

## [0.12.0] - 2023-09-19

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ report.try do |_report|
_report.value
_report.failure?
_report.moving?
_report.running?
_report.success?
_report.started?
Expand Down
4 changes: 2 additions & 2 deletions spec/mel/progress_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe Mel::Progress do
report.try do |_report|
_report.value.should eq(50)
_report.description.should eq(ProgressJob.progress_description)
_report.moving?.should be_true
_report.running?.should be_true
end

Mel.start_and_stop
Expand All @@ -43,7 +43,7 @@ describe Mel::Progress do

report.try do |_report|
_report.value.should eq(80)
_report.moving?.should be_true
_report.running?.should be_true
end

Mel.start_and_stop
Expand Down
4 changes: 2 additions & 2 deletions src/mel/progress/report.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ struct Mel::Progress
end

def started? : Bool
pending? || moving?
pending? || running?
end

def pending? : Bool
value == Progress::START
end

def moving? : Bool
def running? : Bool
Progress::START < value < Progress::END
end

Expand Down

0 comments on commit 21ebf02

Please sign in to comment.