basic_math 0.0.1 → 0.0.2

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: 023f8c80f7fe0994aa892cd8f77ada071865659e1c8a943d6261db47dfea1b0b
4
- data.tar.gz: 999fc1ad80132a9b58594c6b68a70cdeb7dc0c1d1afc7bb2dbc753db2d3afd52
3
+ metadata.gz: 3c073d35816a7df0c781a8c540861fd4cda1bba9fda2fc370b7782cfbe6e33eb
4
+ data.tar.gz: 4179f76467013bb9bab18bfcaebc7f9cd3d16e62b3b9037102dac08edb066363
5
5
  SHA512:
6
- metadata.gz: a70e9c6c1e77073345388e58419c129e42e7f4dc3127de8a51c9e5a110eda0eb12c76763e97de4fca0fdd57886008a0c859d31d5cbf798df3ef928afbd2ac38b
7
- data.tar.gz: f4809be510ed85ebabe1097a7debe7d5c75b0519fabaf988307d2751d06f9b1f1d18f1b926798bbb7c29b648a21a922711ab120f787d1b1e0362ffd0f83fa465
6
+ metadata.gz: 914191ea9f0b14af71ec7141a9076acadd5a57a551acda77333821d766c1bd3c71801376eb3a95ebab1db52a4812ec398e7560e15b16ddcd598a2ea0af4ab5aa
7
+ data.tar.gz: 16277b2dd1860eaaba8eb0f2af7c53b4dd9df096a1bdf10f219b966bfbff7daa5b8ae4d23bec1fbbd6275b31958dd89d82ec8e4e28dfbc4ae8b6137e76e8a175
data/bin/basic_math.rb ADDED
@@ -0,0 +1,14 @@
1
+ require 'basic_math'
2
+
3
+ @parameter1 = Integer(ARGV[0]) rescue nil
4
+ @parameter2 = Integer(ARGV[2]) rescue nil
5
+
6
+ begin
7
+ if (@parameter1.is_a? Numeric) && (@parameter2.is_a? Numeric)
8
+ puts BasicMath.cal @parameter1, ARGV[1], @parameter2
9
+ else
10
+ raise
11
+ end
12
+ rescue
13
+ puts "The first and last parameter must be a number"
14
+ end
@@ -21,7 +21,7 @@ class Basic
21
21
  when "/"
22
22
  begin
23
23
  if @parameter2 != 0
24
- @parameter1/@parameter2
24
+ @parameter1/@parameter2.to_f
25
25
  else
26
26
  raise
27
27
  end
metadata CHANGED
@@ -1,24 +1,26 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: basic_math
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tran Nguyen Kha
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-28 00:00:00.000000000 Z
11
+ date: 2021-12-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: 'Basic Math: Plus, Subtract, multiplication, Divide'
14
14
  email: khatn@neo-lab.vn
15
- executables: []
15
+ executables:
16
+ - basic_math.rb
16
17
  extensions: []
17
18
  extra_rdoc_files: []
18
19
  files:
20
+ - bin/basic_math.rb
19
21
  - lib/basic_math.rb
20
22
  - lib/basic_math/basic.rb
21
- homepage: https://rubygems.org/gems/hola
23
+ homepage: https://rubygems.org/gems/basic_math
22
24
  licenses:
23
25
  - MIT
24
26
  metadata: {}