diff --git a/README.md b/README.md index 1e9bcbc..fa3d3b4 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ quick-plan schedule -n 2018-04-29 -x -e your-mail-address@example.com ultra-80k- ``` ## Workout notation -The reserved keywords of the notation are: workout, warmup, cooldown, run, bike, repeat, recover and lap-button. +The reserved keywords of the notation are: workout, warmup, cooldown, run, bike, go, repeat, recover and lap-button. **``** := `
+` @@ -83,7 +83,7 @@ The reserved keywords of the notation are: workout, warmup, cooldown, run, bike, **``** := ` | ` -**``** := `(warmup | cooldown | run | bike | recover): [@ ]` +**``** := `(warmup | cooldown | run | bike | go | recover): [@ ]` **``** := `repeat: ( - )+` @@ -126,6 +126,6 @@ If not specified -m value from configuration will be used ('metric' by default). ## Known issues -- It is highly recommanded to use Google Spreadsheets or LibreOffice Calc to edit CSV files, as they both force line-feed (LF) +- It is highly recommended to use Google Spreadsheets or LibreOffice Calc to edit CSV files, as they both force line-feed (LF) instead of carriage-return (CR) character for internal line breaks when defining workouts. The parser we use is not able to parse CR values within the quoted values at the moment. \ No newline at end of file diff --git a/src/main/scala/com.github.mgifos.workouts/model/Step.scala b/src/main/scala/com.github.mgifos.workouts/model/Step.scala index 90db5bb..883209d 100644 --- a/src/main/scala/com.github.mgifos.workouts/model/Step.scala +++ b/src/main/scala/com.github.mgifos.workouts/model/Step.scala @@ -70,7 +70,7 @@ object Step { private def parseDurationStep(x: String)(implicit msys: MeasurementSystems.MeasurementSystem): DurationStep = x match { case StepHeader(name, params) => name match { case "warmup" => WarmupStep.tupled(expect(params)) - case "run" | "bike" => IntervalStep.tupled(expect(params)) + case "run" | "bike" | "go" => IntervalStep.tupled(expect(params)) case "recover" => RecoverStep.tupled(expect(params)) case "cooldown" => CooldownStep.tupled(expect(params)) case _ => throw new IllegalArgumentException(s"Duration step type was expected, $name") diff --git a/src/test/scala/com/github/mgifos/workouts/model/StepSpec.scala b/src/test/scala/com/github/mgifos/workouts/model/StepSpec.scala index ab2373c..5cce82e 100644 --- a/src/test/scala/com/github/mgifos/workouts/model/StepSpec.scala +++ b/src/test/scala/com/github/mgifos/workouts/model/StepSpec.scala @@ -14,6 +14,8 @@ class StepSpec extends FlatSpec with Matchers { Step.parse("- warmup: 5km") should be(WarmupStep(DistanceDuration(5, km))) Step.parse("- run: 2km @ 5:00-4:50") should be(IntervalStep(DistanceDuration(2, km), Some(PaceTarget(Pace(msys.distance, "5:00"), Pace(msys.distance, "4:50"))))) + Step.parse("- bike: 2km @ 20-30 kph") should be(IntervalStep(DistanceDuration(2, km), Some(SpeedTarget(Speed(msys.distance, "20"), Speed(msys.distance, "30"))))) + Step.parse("- go: 20km @ 9:00-11:00") should be(IntervalStep(DistanceDuration(20, km), Some(PaceTarget(Pace(msys.distance, "9:00"), Pace(msys.distance, "11:00"))))) Step.parse("- recover: 500m @z2") should be(RecoverStep(DistanceDuration(500, m), Some(HrZoneTarget(2)))) Step.parse("- cooldown: 05:00") should be(CooldownStep(TimeDuration(minutes = 5))) Step.parse("- repeat: 3\n - run: 10km\n - recover: 100m") should be(RepeatStep(3, List(