calcpace 1.1.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08aafc87c8fa3b75db3dfac8e186f803cbfec584991945e9849648a0d91c7341'
4
- data.tar.gz: 886d0b4b83bc2bbc07b3f2dc5d4b3b605459cc15df13a51c22e4ba87f2620ff4
3
+ metadata.gz: 8d2fca26e59f2126bc2c6912786ea9808f8e73af4bc2860de63c5ab85ccf4b01
4
+ data.tar.gz: 11907a7faff02d37df75a1db8d2540f114f46afe70bdb6a426ed3ed6f6bd1a81
5
5
  SHA512:
6
- metadata.gz: 0e3b69e165c445f5c2885c91a8b866020095ba3de87431817eed0d75df2f6f3e65da15cb73205904cff8c3844d590ce3b3edeabdf91cd74f31bbeafe84ac085c
7
- data.tar.gz: 311f84fa56b4f5d3bec6e0c16cac2d6650a488828058f169c8bf1f12c410bff8a91c9be667ffd30ed6dcf40a856f5c64a63aa4b9386095f9a0fdbd7c83548844
6
+ metadata.gz: 451d2883e1b75c140bf5fbd85e9d1ec5b03dc770a471a173a8698ad6243b025736221ea157288c0ad23e5796287db4941f9177dfb3c7130deed50ac0bac6e126
7
+ data.tar.gz: 7141e05845a0d88fcd52fb50dfef307ab3f8c73bbc8b332108fb3dfd13d4a3294ae3ae93b1eb983b98b2134ec67407aa8ba49659e38b169eddce342381bfd8c0
@@ -1,42 +1,52 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bigdecimal'
4
-
5
- module Calculator
6
- def pace(time, distance, bigdecimal = false)
7
- pace_in_seconds = pace_seconds(time, distance, bigdecimal)
8
- convert_to_clocktime(pace_in_seconds)
9
- end
10
-
11
- def pace_seconds(time, distance, bigdecimal = false)
12
- check_time(time)
13
- check_distance(distance)
14
- seconds = convert_to_seconds(time)
15
- bigdecimal ? seconds / BigDecimal(distance.to_s) : seconds / distance
16
- end
17
-
18
- def total_time(pace, distance, bigdecimal = false)
19
- total_time_in_seconds = total_time_seconds(pace, distance, bigdecimal)
20
- convert_to_clocktime(total_time_in_seconds)
21
- end
22
-
23
- def total_time_seconds(pace, distance, bigdecimal = false)
24
- check_time(pace)
25
- check_distance(distance)
26
- pace_seconds = convert_to_seconds(pace)
27
- bigdecimal ? pace_seconds * BigDecimal(distance.to_s) : pace_seconds * distance
28
- end
29
-
30
- def distance(time, pace, bigdecimal = false)
31
- check_time(time)
32
- check_time(pace)
33
- if bigdecimal
34
- time_seconds = BigDecimal(convert_to_seconds(time).to_s)
35
- pace_seconds = BigDecimal(convert_to_seconds(pace).to_s)
36
- else
37
- time_seconds = convert_to_seconds(time)
38
- pace_seconds = convert_to_seconds(pace)
39
- end
40
- time_seconds / pace_seconds
41
- end
42
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'bigdecimal'
4
+
5
+ # Module to calculate time, distance and velocity
6
+ module Calculator
7
+ def velocity(time, distance)
8
+ time / distance
9
+ end
10
+
11
+ def checked_velocity(time, distance)
12
+ check_time(time)
13
+ check_positive(distance)
14
+ distance_to_calc = convert_to_bigdecimal(distance)
15
+ seconds = convert_to_bigdecimal(convert_to_seconds(time))
16
+ velocity(seconds, distance_to_calc)
17
+ end
18
+
19
+ def clock_velocity(time, distance)
20
+ velocity_in_seconds = checked_velocity(time, distance)
21
+ convert_to_clocktime(velocity_in_seconds)
22
+ end
23
+
24
+ def time(velocity, distance)
25
+ velocity * distance
26
+ end
27
+
28
+ def checked_time(velocity, distance)
29
+ check_time(velocity)
30
+ check_positive(distance)
31
+ distance_to_calc = convert_to_bigdecimal(distance)
32
+ velocity_seconds = convert_to_bigdecimal(convert_to_seconds(velocity))
33
+ time(velocity_seconds, distance_to_calc)
34
+ end
35
+
36
+ def clock_time(velocity, distance)
37
+ total_time_in_seconds = checked_time(velocity, distance)
38
+ convert_to_clocktime(total_time_in_seconds)
39
+ end
40
+
41
+ def distance(time, velocity)
42
+ time / velocity
43
+ end
44
+
45
+ def checked_distance(time, velocity)
46
+ check_time(time)
47
+ check_time(velocity)
48
+ time_seconds = convert_to_bigdecimal(convert_to_seconds(time))
49
+ velocity_seconds = convert_to_bigdecimal(convert_to_seconds(velocity))
50
+ distance(time_seconds, velocity_seconds)
51
+ end
52
+ end
@@ -1,19 +1,12 @@
1
- # frozen_string_literal: true
2
-
3
- module Checker
4
- def check_distance(distance)
5
- raise 'It must be a X.X positive number' unless distance.positive?
6
- end
7
-
8
- def check_time(time_string)
9
- raise 'It must be a XX:XX:XX time' unless time_string =~ /\d{0,2}(:)*?\d{1,2}(:)\d{1,2}/
10
- end
11
-
12
- def check_integer(second)
13
- raise 'It must be a positive number' unless second.is_a?(Integer) && second.positive?
14
- end
15
-
16
- def check_unit(unit)
17
- raise 'It must be km or mi' unless %w[km mi].include?(unit)
18
- end
19
- end
1
+ # frozen_string_literal: true
2
+
3
+ # Module to check if the input is valid
4
+ module Checker
5
+ def check_positive(number)
6
+ raise 'It must be a X.X positive number' unless number.positive?
7
+ end
8
+
9
+ def check_time(time_string)
10
+ raise 'It must be a XX:XX:XX time' unless time_string =~ /\d{0,2}(:)*?\d{1,2}(:)\d{1,2}/
11
+ end
12
+ end
@@ -2,25 +2,42 @@
2
2
 
3
3
  require 'bigdecimal'
4
4
 
5
+ # Module to convert units
5
6
  module Converter
6
- KM_TO_MI = BigDecimal('0.621371')
7
- MI_TO_KM = BigDecimal('1.60934')
7
+ KM_TO_MI = 0.621371
8
+ MI_TO_KM = 1.60934
9
+ NAUTICAL_MI_TO_KM = 1.852
10
+ KM_TO_NAUTICAL_MI = 0.539957
11
+ METERS_TO_KM = 0.001
12
+ KM_TO_METERS = 1000
13
+ METERS_TO_MI = 0.000621371
14
+ MI_TO_METERS = 1609.34
15
+ METERS_TO_FEET = 3.28084
16
+ FEET_TO_METERS = 0.3048
17
+ METERS_TO_YARDS = 1.09361
18
+ YARDS_TO_METERS = 0.9144
19
+ METERS_TO_INCHES = 39.3701
20
+ INCHES_TO_METERS = 0.0254
8
21
 
9
- def to_seconds(time)
10
- check_time(time)
11
- convert_to_seconds(time)
12
- end
13
-
14
- def to_clocktime(seconds)
15
- check_integer(seconds)
16
- convert_to_clocktime(seconds)
17
- end
22
+ M_S_TO_KM_H = 3.6
23
+ KM_H_TO_M_S = 0.277778
24
+ M_S_TO_MI_H = 2.23694
25
+ MI_H_TO_M_S = 0.44704
26
+ M_S_TO_NAUTICAL_MI_H = 1.94384
27
+ NAUTICAL_MI_H_TO_M_S = 0.514444
28
+ M_S_TO_FEET_S = 3.28084
29
+ FEET_S_TO_M_S = 0.3048
30
+ M_S_TO_KNOTS = 1.94384
31
+ KNOTS_TO_M_S = 0.514444
32
+ KM_H_TO_MI_H = 0.621371
33
+ MI_H_TO_KM_H = 1.60934
18
34
 
19
- def convert(distance, unit, round_limit = 2)
20
- check_distance(distance)
21
- check_unit(unit)
22
- check_integer(round_limit)
23
- convert_the_distance(BigDecimal(distance.to_s), unit, round_limit)
35
+ def convert(value, unit)
36
+ check_positive(value)
37
+ unit_constant = constant(unit)
38
+ value_to_convert = convert_to_bigdecimal(value)
39
+ unit_to_convert = convert_to_bigdecimal(unit_constant)
40
+ value_to_convert * unit_to_convert
24
41
  end
25
42
 
26
43
  def convert_to_seconds(time)
@@ -33,12 +50,15 @@ module Converter
33
50
  Time.at(seconds.to_i).utc.strftime(format)
34
51
  end
35
52
 
36
- def convert_the_distance(distance, unit, round_limit = 2)
37
- case unit
38
- when 'km'
39
- (distance * KM_TO_MI).round(round_limit)
40
- when 'mi'
41
- (distance * MI_TO_KM).round(round_limit)
42
- end
53
+ def convert_to_bigdecimal(value)
54
+ bigdecimal ? BigDecimal(value.to_s) : value
55
+ end
56
+
57
+ def constant(string)
58
+ Converter.const_get(string.upcase.gsub(' ', '_'))
59
+ end
60
+
61
+ def list_constants
62
+ Converter.constants
43
63
  end
44
64
  end
data/lib/calcpace.rb CHANGED
@@ -1,13 +1,18 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'calcpace/calculator'
4
- require_relative 'calcpace/checker'
5
- require_relative 'calcpace/converter'
6
-
7
- class Calcpace
8
- include Calculator
9
- include Checker
10
- include Converter
11
-
12
- def initialize; end
13
- end
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'calcpace/calculator'
4
+ require_relative 'calcpace/checker'
5
+ require_relative 'calcpace/converter'
6
+
7
+ # Main class to calculate velocity, time, distance and velocity
8
+ class Calcpace
9
+ include Calculator
10
+ include Checker
11
+ include Converter
12
+
13
+ attr_reader :bigdecimal
14
+
15
+ def initialize(bigdecimal = false)
16
+ @bigdecimal = bigdecimal
17
+ end
18
+ end
@@ -7,62 +7,77 @@ require_relative '../../lib/calcpace'
7
7
  class TestCalculator < Minitest::Test
8
8
  def setup
9
9
  @checker = Calcpace.new
10
+ @checker_bigdecimal = Calcpace.new(true)
10
11
  end
11
12
 
12
- def test_pace
13
- assert_raises(RuntimeError) { @checker.pace('', 10) }
14
- assert_raises(RuntimeError) { @checker.pace('invalid', 10) }
15
- assert_raises(RuntimeError) { @checker.pace('00:00:00', 0) }
16
- assert_raises(RuntimeError) { @checker.pace('00:00:00', -1) }
17
- assert_equal '00:06:00', @checker.pace('01:00:00', 10)
18
- assert_equal '00:07:54', @checker.pace('01:37:21', 12.3)
13
+ def test_velocity
14
+ assert_equal 300, @checker.velocity(3600, 12)
15
+ assert_equal 122.81076923076924, @checker.velocity(71_844.3, 585.0)
19
16
  end
20
17
 
21
- def test_pace_without_bigdecimal_precision
22
- assert_equal '00:07:54', @checker.pace('01:37:21', 12.3, false)
18
+ def test_checked_velocity
19
+ assert_raises(RuntimeError) { @checker.checked_velocity('', 10) }
20
+ assert_raises(RuntimeError) { @checker.checked_velocity('invalid', 10) }
21
+ assert_raises(RuntimeError) { @checker.checked_velocity('00:00:00', 0) }
22
+ assert_raises(RuntimeError) { @checker.checked_velocity('00:00:00', -1) }
23
+ assert_equal 360, @checker.checked_velocity('01:00:00', 10)
24
+ assert_equal 474.8780487804878, @checker.checked_velocity('01:37:21', 12.3)
23
25
  end
24
26
 
25
- def test_pace_seconds
26
- assert_raises(RuntimeError) { @checker.pace_seconds('', 10) }
27
- assert_raises(RuntimeError) { @checker.pace_seconds('invalid', 10) }
28
- assert_raises(RuntimeError) { @checker.pace_seconds('00:00:00', 0) }
29
- assert_raises(RuntimeError) { @checker.pace_seconds('00:00:00', -1) }
30
- assert_equal BigDecimal('474.8780487804878'), @checker.pace_seconds('01:37:21', 12.3)
27
+ def test_checked_velocity_with_bigdecimal_precision
28
+ assert_equal BigDecimal('0.474878048780487804878048780487804878049e3'),
29
+ @checker_bigdecimal.checked_velocity('01:37:21', 12.3)
31
30
  end
32
31
 
33
- def test_pace_seconds_with_bigdecimal_precision
34
- assert_equal BigDecimal('0.474878048780487804878048780487804878049e3'), @checker.pace_seconds('01:37:21', 12.3, true)
32
+ def test_clock_velocity
33
+ assert_raises(RuntimeError) { @checker.clock_velocity('', 10) }
34
+ assert_raises(RuntimeError) { @checker.clock_velocity('invalid', 10) }
35
+ assert_raises(RuntimeError) { @checker.clock_velocity('00:00:00', 0) }
36
+ assert_raises(RuntimeError) { @checker.clock_velocity('00:00:00', -1) }
37
+ assert_equal '00:06:00', @checker.clock_velocity('01:00:00', 10)
38
+ assert_equal '00:07:54', @checker.clock_velocity('01:37:21', 12.3)
35
39
  end
36
40
 
37
- def test_total_time
38
- assert_raises(RuntimeError) { @checker.total_time('', 10) }
39
- assert_raises(RuntimeError) { @checker.total_time('invalid', 10) }
40
- assert_raises(RuntimeError) { @checker.total_time('00:00:00', 0) }
41
- assert_raises(RuntimeError) { @checker.total_time('00:00:00', -1) }
42
- assert_equal '01:00:00', @checker.total_time('00:05:00', 12)
41
+ def test_time
42
+ assert_equal 43_200, @checker.time(3600, 12)
43
+ assert_equal 5841.0, @checker.time(12.3, 474.8780487804878)
43
44
  end
44
45
 
45
- def test_total_time_seconds
46
- assert_raises(RuntimeError) { @checker.total_time_seconds('', 10) }
47
- assert_raises(RuntimeError) { @checker.total_time_seconds('invalid', 10) }
48
- assert_raises(RuntimeError) { @checker.total_time_seconds('00:00:00', 0) }
49
- assert_raises(RuntimeError) { @checker.total_time_seconds('00:00:00', -1) }
50
- assert_equal 3600, @checker.total_time_seconds('00:05:00', 12)
51
- assert_equal 71_844.3, @checker.total_time_seconds('01:37:21', 12.3)
46
+ def test_checked_time
47
+ assert_raises(RuntimeError) { @checker.checked_time('', 10) }
48
+ assert_raises(RuntimeError) { @checker.checked_time('invalid', 10) }
49
+ assert_raises(RuntimeError) { @checker.checked_time('00:00:00', 0) }
50
+ assert_raises(RuntimeError) { @checker.checked_time('00:00:00', -1) }
51
+ assert_equal 3600, @checker.checked_time('00:05:00', 12)
52
+ assert_equal 71_844.3, @checker.checked_time('01:37:21', 12.3)
52
53
  end
53
54
 
54
- def test_total_time_seconds_with_bigdecimal_precision
55
- assert_equal BigDecimal('0.718443e5'), @checker.total_time_seconds('01:37:21', 12.3, true)
55
+ def test_checked_time_with_bigdecimal_precision
56
+ assert_equal BigDecimal('0.718443e5'), @checker_bigdecimal.checked_time('01:37:21', 12.3)
57
+ end
58
+
59
+ def test_clock_time
60
+ assert_raises(RuntimeError) { @checker.clock_time('', 10) }
61
+ assert_raises(RuntimeError) { @checker.clock_time('invalid', 10) }
62
+ assert_raises(RuntimeError) { @checker.clock_time('00:00:00', 0) }
63
+ assert_raises(RuntimeError) { @checker.clock_time('00:00:00', -1) }
64
+ assert_equal '01:00:00', @checker.clock_time('00:05:00', 12)
56
65
  end
57
66
 
58
67
  def test_distance
59
- assert_raises(RuntimeError) { @checker.distance('', '00:05:00') }
60
- assert_raises(RuntimeError) { @checker.distance('01:00:00', '') }
61
- assert_equal 18.0, @checker.distance('01:30:00', '00:05:00')
62
- assert_equal 15.0, @checker.distance('01:37:21', '00:06:17')
68
+ assert_equal 30, @checker.distance(3600, 120)
69
+ assert_equal 12.3, @checker.distance(5841.0, 474.8780487804878)
70
+ end
71
+
72
+ def test_checked_distance
73
+ assert_raises(RuntimeError) { @checker.checked_distance('', '00:05:00') }
74
+ assert_raises(RuntimeError) { @checker.checked_distance('01:00:00', '') }
75
+ assert_equal 18.0, @checker.checked_distance('01:30:00', '00:05:00')
76
+ assert_equal 15.0, @checker.checked_distance('01:37:21', '00:06:17')
63
77
  end
64
78
 
65
- def test_distance_with_bigdecimal_precision
66
- assert_equal BigDecimal('0.15493368700265251989389920424403183024e2'), @checker.distance('01:37:21', '00:06:17', true)
79
+ def test_checked_distance_with_bigdecimal_precision
80
+ assert_equal BigDecimal('0.15493368700265251989389920424403183024e2'),
81
+ @checker_bigdecimal.checked_distance('01:37:21', '00:06:17')
67
82
  end
68
83
  end
@@ -1,27 +1,21 @@
1
- # frozen_string_literal: true
2
-
3
- require 'minitest/autorun'
4
- require_relative '../../lib/calcpace'
5
-
6
- class TestChecker < Minitest::Test
7
- def setup
8
- @checker = Calcpace.new
9
- end
10
-
11
- def test_check_distance
12
- assert_raises(RuntimeError) { @checker.check_distance(-1) }
13
- assert_raises(RuntimeError) { @checker.check_distance(0) }
14
- assert_nil @checker.check_distance(1)
15
- end
16
-
17
- def test_check_time
18
- assert_raises(RuntimeError) { @checker.check_time('') }
19
- assert_nil @checker.check_time('00:00:00')
20
- end
21
-
22
- def test_check_integer
23
- assert_raises(RuntimeError) { @checker.check_integer(-1) }
24
- assert_raises(RuntimeError) { @checker.check_integer(0) }
25
- assert_nil @checker.check_integer(1)
26
- end
27
- end
1
+ # frozen_string_literal: true
2
+
3
+ require 'minitest/autorun'
4
+ require_relative '../../lib/calcpace'
5
+
6
+ class TestChecker < Minitest::Test
7
+ def setup
8
+ @checker = Calcpace.new
9
+ end
10
+
11
+ def test_check_positive
12
+ assert_raises(RuntimeError) { @checker.check_positive(-1) }
13
+ assert_raises(RuntimeError) { @checker.check_positive(0) }
14
+ assert_nil @checker.check_positive(1)
15
+ end
16
+
17
+ def test_check_time
18
+ assert_raises(RuntimeError) { @checker.check_time('') }
19
+ assert_nil @checker.check_time('00:00:00')
20
+ end
21
+ end
@@ -6,44 +6,54 @@ require_relative '../../lib/calcpace'
6
6
  class TestConverter < Minitest::Test
7
7
  def setup
8
8
  @checker = Calcpace.new
9
+ @checker_bigdecimal = Calcpace.new(true)
9
10
  end
10
11
 
11
12
  def test_convert_to_seconds
12
13
  assert_equal 4262, @checker.convert_to_seconds('01:11:02')
13
14
  end
14
15
 
15
- def test_to_seconds
16
- assert_equal 3600, @checker.to_seconds('01:00:00')
17
- assert_raises(RuntimeError) { @checker.to_seconds('invalid') }
18
- end
19
-
20
16
  def test_convert_to_clocktime
21
17
  assert_equal '01:11:02', @checker.convert_to_clocktime(4262)
22
18
  end
23
19
 
24
- def test_to_clocktime
25
- assert_equal '01:00:00', @checker.to_clocktime(3600)
26
- assert_equal '02 01:00:00', @checker.to_clocktime(90_000)
27
- assert_raises(RuntimeError) { @checker.to_clocktime(-1) }
28
- assert_raises(RuntimeError) { @checker.to_clocktime(0) }
29
- assert_raises(RuntimeError) { @checker.to_clocktime('invalid') }
20
+ def test_convert_distance
21
+ assert_equal 0.621371, @checker.convert(1, 'KM_TO_MI')
22
+ assert_equal 1.60934, @checker.convert(1, 'MI_TO_KM')
23
+ assert_equal 1.852, @checker.convert(1, 'NAUTICAL_MI_TO_KM')
24
+ assert_equal 0.539957, @checker.convert(1, 'KM_TO_NAUTICAL_MI')
25
+ assert_equal 0.001, @checker.convert(1, 'METERS_TO_KM')
26
+ assert_equal 1000, @checker.convert(1, 'KM_TO_METERS')
27
+ assert_equal 0.000621371, @checker.convert(1, 'METERS_TO_MI')
28
+ assert_equal 1609.34, @checker.convert(1, 'MI_TO_METERS')
29
+ assert_equal 3.28084, @checker.convert(1, 'METERS_TO_FEET')
30
+ assert_equal 0.3048, @checker.convert(1, 'FEET_TO_METERS')
31
+ assert_equal 1.09361, @checker.convert(1, 'METERS_TO_YARDS')
32
+ assert_equal 0.9144, @checker.convert(1, 'YARDS_TO_METERS')
33
+ assert_equal 39.3701, @checker.convert(1, 'METERS_TO_INCHES')
34
+ assert_equal 0.0254, @checker.convert(1, 'INCHES_TO_METERS')
35
+ end
36
+
37
+ def test_convert_velocity
38
+ assert_equal 3.60, @checker.convert(1, 'M_S_TO_KM_H')
39
+ assert_equal 0.277778, @checker.convert(1, 'KM_H_TO_M_S')
40
+ assert_equal 2.23694, @checker.convert(1, 'M_S_TO_MI_H')
41
+ assert_equal 0.44704, @checker.convert(1, 'MI_H_TO_M_S')
42
+ assert_equal 1.94384, @checker.convert(1, 'M_S_TO_NAUTICAL_MI_H')
43
+ assert_equal 0.514444, @checker.convert(1, 'NAUTICAL_MI_H_TO_M_S')
44
+ assert_equal 0.621371, @checker.convert(1, 'KM_H_TO_MI_H')
45
+ assert_equal 1.60934, @checker.convert(1, 'MI_H_TO_KM_H')
46
+ assert_equal 1.94384, @checker.convert(1, 'M_S_TO_KNOTS')
47
+ assert_equal 0.514444, @checker.convert(1, 'KNOTS_TO_M_S')
30
48
  end
31
49
 
32
- def test_convert_the_distance
33
- assert_equal 6.21, @checker.convert_the_distance(10, 'km')
34
- assert_equal 6.2, @checker.convert_the_distance(10, 'km', 1)
35
- assert_equal 6.214, @checker.convert_the_distance(10, 'km', 3)
36
- assert_equal 16.09, @checker.convert_the_distance(10, 'mi')
50
+ def test_constant
51
+ assert_equal 0.621371, @checker.constant('KM_TO_MI')
52
+ assert_equal 1.60934, @checker.constant('MI_TO_KM')
53
+ assert_equal 1.852, @checker.constant('NAUTICAL_MI_TO_KM')
37
54
  end
38
55
 
39
- def test_convert
40
- assert_equal 6.21, @checker.convert(10, 'km')
41
- assert_equal 16.09, @checker.convert(10, 'mi')
42
- assert_equal 6.2, @checker.convert(10, 'km', 1)
43
- assert_raises(RuntimeError) { @checker.convert(10, 'invalid') }
44
- assert_raises(RuntimeError) { @checker.convert(-1, 'km') }
45
- assert_raises(RuntimeError) { @checker.convert(10, 'km', -2) }
46
- assert_raises(RuntimeError) { @checker.convert(10, 'km', 0) }
47
- assert_raises(RuntimeError) { @checker.convert(10, 'km', 'invalid') }
56
+ def test_list_constants
57
+ assert_equal 26, @checker.list_constants.size
48
58
  end
49
59
  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.1.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joao Gilberto Saraiva
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-21 00:00:00.000000000 Z
11
+ date: 2024-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -72,34 +72,17 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.79'
75
+ version: '1.66'
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: '0.79'
83
- - !ruby/object:Gem::Dependency
84
- name: rubocop-minitest
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.11'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.11'
97
- description: 'Calcpace is a Ruby gem that helps with calculations related to running/cycling
98
- activities or general purposes involving distance and time. It can calculate pace,
99
- total time, and distance. It also converts distances between miles and kilometers
100
- and check formats of time and distance. The results are provided in a readable format,
101
- with times in HH:MM:SS or seconds and distances in X.X format. If you need, the
102
- gem supports BigDecimal to handle the calculations, '
82
+ version: '1.66'
83
+ description: Calcpace is a Ruby gem that helps with calculations related to distance
84
+ and time. It can calculate velocity, total time, and distance. It also converts
85
+ distance and velocity, check formats of time and can handle calculus with BigDecimal.
103
86
  email: joaogilberto@tuta.io
104
87
  executables: []
105
88
  extensions: []
@@ -133,10 +116,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
116
  version: '0'
134
117
  requirements: []
135
118
  rubygems_version: 3.5.16
136
- signing_key:
119
+ signing_key:
137
120
  specification_version: 4
138
- summary: 'Calcpace: calculate time, distance, pace, velocity and convert distances
139
- in an easy and precise way.'
121
+ summary: 'Calcpace: calculate total, distance, velocity and convert distances in an
122
+ easy and precise way.'
140
123
  test_files:
141
124
  - test/calcpace/test_calculator.rb
142
125
  - test/calcpace/test_checker.rb