ast-tdl 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +44 -30
- data/lib/interval.rb +11 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz: '
|
3
|
+
metadata.gz: 7e1cae6b9c56c969808cd16ff2d58ec838db46745cf3f6b9b1eb3583536ad93b
|
4
|
+
data.tar.gz: '0841bfa32e170d22ec587d027086ce4816a86d8116627c8f365000010ebd224a'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 179ff4d41c5e51f81f2298bd6363fdbd58afe24b729274a4fc50eb04ffacb3eec453726da1817f4995c55d9923d5202e15c1083f5a7e762993fb7aab08edba48
|
7
|
+
data.tar.gz: 9e644b6a2f48ec60038a31c503a7d65fbfa4cc8bc89c19f8e9f2da31700f6299794eb292f37cfc2df72b05c9c8d92f8beb420f94c779055761d5fabfe9ca154c
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
ast-dsl is intended to be a small DSL for practical definition and description of sports training that can be automatically or manually defined and used in conjunction with Artificial Sport Trainer.
|
5
5
|
|
6
6
|
## Feature diagram
|
7
|
-
![scheme](https://user-images.githubusercontent.com/73126820/
|
7
|
+
![scheme](https://user-images.githubusercontent.com/73126820/177509075-977b2e18-ebb7-40ce-9af9-ed7715717bf3.png)
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
$ gem install ast-tdl
|
@@ -14,40 +14,54 @@ Training Description Language (TDL) is implemented in Ruby. Currently, the descr
|
|
14
14
|
|
15
15
|
## Examples
|
16
16
|
```ruby
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
17
|
+
Ast.build('My first training') do
|
18
|
+
session('Short swimming session') do
|
19
|
+
sport :swim
|
20
|
+
info :"Very easy training"
|
21
|
+
average_heart_rate :"130"
|
22
|
+
total_duration :"30"
|
23
|
+
end
|
24
|
+
|
25
|
+
session('Bike ride') do
|
26
|
+
sport :cycling
|
27
|
+
info :"Endurance ride with intervals"
|
28
|
+
average_heart_rate :"140"
|
29
|
+
total_duration :"120"
|
30
|
+
end
|
31
|
+
|
32
|
+
interval('Sample interval') do
|
33
|
+
sport :cycling
|
34
|
+
info :Moderate
|
35
|
+
speed_duration :"5"
|
36
|
+
recovery_duration :"5"
|
37
|
+
speed_heart_rate :"180"
|
38
|
+
recovery_heart_rate :"90"
|
39
|
+
repetitions :"10"
|
40
|
+
end
|
40
41
|
end
|
41
42
|
```
|
42
43
|
|
43
44
|
### Session
|
44
45
|
```ruby
|
45
|
-
session(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
session('Bike ride') do
|
47
|
+
sport :cycling
|
48
|
+
info :"Endurance ride with intervals"
|
49
|
+
average_heart_rate :"140"
|
50
|
+
total_duration :"120"
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
### Interval
|
55
|
+
```ruby
|
56
|
+
interval('Sample interval') do
|
57
|
+
sport :cycling
|
58
|
+
info :Moderate
|
59
|
+
speed_duration :"5"
|
60
|
+
recovery_duration :"5"
|
61
|
+
speed_heart_rate :"180"
|
62
|
+
recovery_heart_rate :"90"
|
63
|
+
repetitions :"10"
|
64
|
+
end
|
51
65
|
```
|
52
66
|
|
53
67
|
## License
|
data/lib/interval.rb
CHANGED
@@ -16,6 +16,7 @@ class Interval
|
|
16
16
|
@speed_heart_rate = 0
|
17
17
|
@recovery_heart_rate = 0
|
18
18
|
@repetitions = 0
|
19
|
+
@type = ''
|
19
20
|
end
|
20
21
|
|
21
22
|
##
|
@@ -74,6 +75,14 @@ class Interval
|
|
74
75
|
@repetitions = repetitions.to_s.to_i
|
75
76
|
end
|
76
77
|
|
78
|
+
##
|
79
|
+
# Adding an interval type to the object.
|
80
|
+
# Params:
|
81
|
+
# +type+:: interval type
|
82
|
+
def type(type)
|
83
|
+
@type = type
|
84
|
+
end
|
85
|
+
|
77
86
|
##
|
78
87
|
# Converting an interval to a string.
|
79
88
|
def to_s
|
@@ -91,7 +100,8 @@ class Interval
|
|
91
100
|
recovery_duration: @recovery_duration,
|
92
101
|
speed_heart_rate: @speed_heart_rate,
|
93
102
|
recovery_heart_rate: @recovery_heart_rate,
|
94
|
-
repetitions: @repetitions
|
103
|
+
repetitions: @repetitions,
|
104
|
+
type: @type
|
95
105
|
}
|
96
106
|
|
97
107
|
hash[:info] = @info if @info
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ast-tdl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- firefly-cpp
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-07-
|
12
|
+
date: 2022-07-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|