calc_ruby_test_gem 0.2.0 → 0.2.2
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 +4 -4
- data/Gemfile.lock +19 -0
- data/README.md +5 -3
- data/lib/calc_ruby_test_gem/version.rb +1 -1
- data/lib/calc_ruby_test_gem.rb +1 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad09f44faa67b75bcd5507365604bfdb321397b13a0e8baa1fbadb4e777c9d4
|
4
|
+
data.tar.gz: b7ef8708f0624f0d60aabe3435398de7be7b5e365cc47005a56c0303afd29aed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80bcb0f63fbb146bf57f05565d54f3a52244baf1a1c2a957cf16b2d3b395da3a46d647c14c7f209e974eeb20209b19a0544457ee17f5fddcf6dfd36423724a5a
|
7
|
+
data.tar.gz: 1312cc424a43fea0d0f98ae77eb58a5d90c81cb8c9a33368d9bd0bf327fbc54eb837123b01dde4806fa9d109435a92cd0019bf10389b9b539424f86d5f970c39
|
data/Gemfile.lock
ADDED
data/README.md
CHANGED
@@ -17,9 +17,11 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
17
17
|
To test the calculator through irb:
|
18
18
|
# Launch IRB and load this file calc_ruby_test_gem.rb
|
19
19
|
irb -r ./lib/calc_ruby_test_gem
|
20
|
-
#
|
21
|
-
CalcRubyTestGem
|
22
|
-
|
20
|
+
# Now you can pass examples in that sequance: (first_operand, second_operand, "operation")
|
21
|
+
CalcRubyTestGem::calculate(1,2,"+")
|
22
|
+
=> "1 + 2 = 3"
|
23
|
+
CalcRubyTestGem::calculate(1,2,"-")
|
24
|
+
=> "1 - 2 = -1"
|
23
25
|
|
24
26
|
## Development
|
25
27
|
|
data/lib/calc_ruby_test_gem.rb
CHANGED
@@ -15,8 +15,7 @@ module CalcRubyTestGem
|
|
15
15
|
raise UnsupportedOperation unless ALLOWED_OPERATIONS.include? operation
|
16
16
|
|
17
17
|
begin
|
18
|
-
"#{first_operand} #{operation} #{second_operand} = #{first_operand.send(operation, second_operand)}"
|
19
|
-
puts "Test"
|
18
|
+
"#{first_operand} #{operation} #{second_operand} = #{first_operand.send(operation, second_operand)}"
|
20
19
|
rescue ZeroDivisionError => e
|
21
20
|
"Division by zero is not allowed."
|
22
21
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: calc_ruby_test_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex
|
@@ -19,6 +19,7 @@ extensions: []
|
|
19
19
|
extra_rdoc_files: []
|
20
20
|
files:
|
21
21
|
- Gemfile
|
22
|
+
- Gemfile.lock
|
22
23
|
- README.md
|
23
24
|
- Rakefile
|
24
25
|
- calc_ruby_test_gem.gemspec
|