calculator7 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/calculator7.rb +2 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 597d714970164868c27ee146da78188dafd0f43c
4
- data.tar.gz: c4df2253ed578c29c52f5f08ef481229532ab36f
3
+ metadata.gz: 40211eb9c733da716a3293644f7f37e2eb0359e8
4
+ data.tar.gz: 872356cfed078745997a82ffb418481df99c9fa2
5
5
  SHA512:
6
- metadata.gz: a1fc2193282bbef7f920c4b25d7f594f5e36018600416fd584441557d39e1d3b0dda725af872c6fa0d228d51c621d2f49856da10f3d8405e971e6512c29f0d53
7
- data.tar.gz: 47ed9f7ba6edc6e35080afc2c31c7a62fce732ade77f457452e3dfccc484f27de6898a29f18d8223af45e87181b3a04093418e26d9a923e6ce173120c5bfd25e
6
+ metadata.gz: 07d5e9632568fdda114290d5656eefe6ec2afabe2774390c0e3589ebdd48bd1f10abf68be4652f68d9ce42d1779ceeb896efa2cb270f720e4238d70e9936ff02
7
+ data.tar.gz: fd3d2c5c2489157322055b1daaab184fd7c963ae5b50c19c65ad066d495ddab6c4899d489b955d28b0c0ea27e68f7f2b0fe7559edebd27084a0e727e2a2dafc6
data/lib/calculator7.rb CHANGED
@@ -3,7 +3,7 @@ class Calculator7
3
3
  puts "Hello world!"
4
4
  end
5
5
 
6
- def self.execute(str)
6
+ def self.compute(str)
7
7
  enable = true
8
8
  str.chars.each do |c|
9
9
  if !"+-*/0123456789 ".include?(c)
@@ -15,7 +15,7 @@ class Calculator7
15
15
  ret = nil
16
16
  if enable
17
17
  begin
18
- ret = '=' + eval(str).to_s
18
+ ret = eval(str).to_s
19
19
  rescue SyntaxError
20
20
  # do nothing
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calculator7
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
  - Jianfeng