calcpace 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/calcpace/checker.rb +15 -12
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae4cf16a59e2220323b0ad4b7439b7abdd7484e994db1aae7f61970843b20cd6
|
4
|
+
data.tar.gz: c9158b0f6bddd20ae5569d7341cc2fe2521e11664795b39c685f1a600b1f9401
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c895388ab6788533432c5f556c4bad4db174079538b6e9b0f81ce27fe2c5266f96c0c364fbfc0335effa9e4ea86989df81eccc5d219ac786b472901b28ea8a9a
|
7
|
+
data.tar.gz: bc709904b89da4b81aba7253c27c0caec29e1d54faad929b8ab82b020d3b6e2d3b1c9394be67c62b74cc569d950df61af83961483e4f009e049595074e807b17
|
data/lib/calcpace/checker.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Module to check if the input is valid or of the correct type
|
4
|
-
module Checker
|
5
|
-
def check_positive(number)
|
6
|
-
raise ArgumentError, 'It must be a positive number' unless number.is_a?(Numeric) && number.positive?
|
7
|
-
end
|
8
|
-
|
9
|
-
def check_time(time_string)
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Module to check if the input is valid or of the correct type
|
4
|
+
module Checker
|
5
|
+
def check_positive(number)
|
6
|
+
raise ArgumentError, 'It must be a positive number' unless number.is_a?(Numeric) && number.positive?
|
7
|
+
end
|
8
|
+
|
9
|
+
def check_time(time_string)
|
10
|
+
return if time_string =~ /\A\d{1,2}:\d{2}:\d{2}\z/
|
11
|
+
|
12
|
+
raise ArgumentError,
|
13
|
+
'It must be a valid time in the format XX:XX:XX'
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calcpace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joao Gilberto Saraiva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '5.
|
19
|
+
version: '5.25'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '5.
|
26
|
+
version: '5.25'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '13.
|
33
|
+
version: '13.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '13.
|
40
|
+
version: '13.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake-compiler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,14 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1.
|
75
|
+
version: '1.69'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1.
|
82
|
+
version: '1.69'
|
83
83
|
description: It is designed for calculations related to distance, speed and time.
|
84
84
|
The gem also supports conversion to 42 different units of distance and velocity,
|
85
85
|
including metric, nautical and imperial units.
|