math_engine 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/math_engine.rb +6 -0
- metadata +3 -4
- data/math_engine.rb +0 -6
data/lib/math_engine.rb
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'lexr'
|
3
|
+
|
4
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'math_lexer'))
|
5
|
+
require File.expand_path(File.join(File.dirname(__FILE__), 'math_parser'))
|
6
|
+
|
1
7
|
class MathEngine
|
2
8
|
def evaluate(expression)
|
3
9
|
MathParser.new(MathLexer.new(expression)).parse.evaluate
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: math_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Baldry
|
@@ -57,7 +57,6 @@ extensions: []
|
|
57
57
|
extra_rdoc_files:
|
58
58
|
- README.md
|
59
59
|
files:
|
60
|
-
- math_engine.rb
|
61
60
|
- README.md
|
62
61
|
- lib/math_engine.rb
|
63
62
|
- lib/math_lexer.rb
|
data/math_engine.rb
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'lexr'
|
3
|
-
|
4
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'math_lexer'))
|
5
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'math_parser'))
|
6
|
-
require File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'math_engine'))
|