gem_calculating 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68f2db5877d319f0a8d3724e6c10f9f6c7ed7200134b7484b4cc27d61e0c6073
4
- data.tar.gz: d648d2c5100c6db2516993476a9bbd356724e59a5c329eafe7d800af4915ffbb
3
+ metadata.gz: 8ce664514e1dc09e42690060836ce4d2d9b830050ff7b500abb9f769ceb778be
4
+ data.tar.gz: c1616271644c21a052cff8b4b279d498d97501baf14a3c6364f62d0e15c6dc1d
5
5
  SHA512:
6
- metadata.gz: 725e4ba2fd4dc07f25c26cbaea3b3e9e582e4d2101bfc6ae5c1400af3f93dc5544d3cd342f30c334f1cb40be31eada64688563069b7edfddfc664bd8377b3b98
7
- data.tar.gz: bea625510ec8c6267d6ccd87a1bc41370d0e755a76bb4007d851637bf63cf71e3773e9de998f139d2d9a58b68323a3e89cfa7e92a66335f0a83b2349bc7306f5
6
+ metadata.gz: 3e0fb602fa3a6daea2d6d4717025137f6bbda3df0ab77af654b2374aa647d4df31d95336e91e7da5e8f88e9bb354ef4e8dd0c95c096d14bb950a9cc8d2fd5a1e
7
+ data.tar.gz: 2a854e31f1574c956a46c53aef2e16ae1ac8a23ae28e94714f222ba0bb909ead6745a5149a6b005760c169e65f0732ade8cf93fe98f24d7393700b48c2bfbe59
data/CHANGELOG.md CHANGED
@@ -7,3 +7,11 @@
7
7
  ## [0.1.1] - 2022-10-19
8
8
 
9
9
  - Add tests
10
+
11
+ ## [0.1.2] - 2022-10-21
12
+
13
+ - Update performance
14
+
15
+ ## [0.1.3] - 2022-10-21
16
+
17
+ - Bug fixes
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gem_calculating (0.1.1)
4
+ gem_calculating (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -20,10 +20,10 @@ require 'gem_calculating'
20
20
 
21
21
  Then you can use the gem:
22
22
 
23
- GemCalculating::Calculator.add(2, 3)# => 5
24
- GemCalculating::Calculator.subtract(3, 2)# => 1
25
- GemCalculating::Calculator.multiply(2, 3)# => 6
26
- GemCalculating::Calculator.divide(4, 2)# => 2
23
+ Calculate.add(2, 3)# => 5
24
+ Calculate subtract(3, 2)# => 1
25
+ Calculate.multiply(2, 3)# => 6
26
+ Calculate.divide(4, 2)# => 2
27
27
 
28
28
  ## Development
29
29
 
@@ -4,7 +4,7 @@ require_relative "lib/gem_calculating/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "gem_calculating"
7
- spec.version = GemCalculating::VERSION
7
+ spec.version = Calculate::VERSION
8
8
  spec.authors = ["Oleksii Ostafiichuk"]
9
9
  spec.email = ["issimo333@gmail.com"]
10
10
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GemCalculating
4
- VERSION = "0.1.1"
3
+ module Calculate
4
+ VERSION = "0.1.3"
5
5
  end
@@ -1,44 +1,49 @@
1
1
  # frozen_string_literal: true
2
-
3
2
  require_relative "gem_calculating/version"
4
3
 
5
- # Calculator gem
6
- module GemCalculating
7
- # Class for calculating
8
- class Calculator
9
- # Adds two numbers
10
- def self.add(num1, num2)
11
- if validate_numbers(num1, num2) == true
12
- return puts "Numbers is not valid"
13
- end
14
- num1 + num2
15
- rescue StandardError
16
- nil
4
+ module Calculate
5
+ # Adds two numbers
6
+ def self.add(num1, num2)
7
+ if validate_numbers(num1, num2) == true
8
+ return puts "Numbers is not valid"
17
9
  end
18
- # Subtract two numbers
19
- def self.subtract(num1, num2)
20
- num1 - num2
21
- rescue StandardError
10
+ num1 + num2
11
+ rescue StandardError
22
12
  nil
13
+ end
14
+ # Subtract two numbers
15
+ def self.subtract(num1, num2)
16
+ if validate_numbers(num1, num2) == true
17
+ return puts "Numbers is not valid"
23
18
  end
24
- # Multiply two numbers
25
- def self.multiply(num1, num2)
26
- num1 * num2
27
- rescue StandardError
28
- nil
29
- end
30
- # Divide two numbers
31
- def self.divide(num1, num2)
32
- num1 / num2
33
- rescue StandardError
34
- nil
19
+ num1 - num2
20
+ rescue StandardError
21
+ nil
22
+ end
23
+ # Multiply two numbers
24
+ def self.multiply(num1, num2)
25
+ if validate_numbers(num1, num2) == true
26
+ return puts "Numbers is not valid"
35
27
  end
36
-
37
- private_class_method def self.validate_numbers(num1, num2)
38
- num1.is_a?(String) or num2.is_a?(String)
28
+ num1 * num2
29
+ rescue StandardError
30
+ nil
31
+ end
32
+ # Divide two numbers
33
+ def self.divide(num1, num2)
34
+ if validate_numbers(num1, num2) == true
35
+ return puts "Numbers is not valid"
39
36
  end
37
+ num1 / num2
38
+ rescue StandardError
39
+ nil
40
40
  end
41
41
 
42
- # class Error < StandardError; end
43
- # Your code goes here...
42
+ private_class_method def self.validate_numbers(num1, num2)
43
+ num1.is_a?(String) or num2.is_a?(String)
44
44
  end
45
+
46
+
47
+ class Error < StandardError; end
48
+ # Your code goes here...
49
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_calculating
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleksii Ostafiichuk
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-19 00:00:00.000000000 Z
11
+ date: 2022-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -79,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  requirements: []
82
- rubygems_version: 3.2.3
82
+ rubygems_version: 3.2.33
83
83
  signing_key:
84
84
  specification_version: 4
85
85
  summary: Simple calculator gem that can add, subtract, multiply, and divide.