symbolic 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,20 +5,9 @@ begin
5
5
  require 'jeweler'
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "symbolic"
8
- gem.version = '0.3.5'
8
+ gem.version = '0.3.6'
9
9
  gem.summary = 'Symbolic math for ruby'
10
- gem.description = <<TEXT
11
- Symbolic math for ruby.
12
-
13
-
14
- This gem can help you
15
- - if you want to get a simplified form of a big equation
16
- - if you want to speed up similar calculations
17
- - if you need an abstraction layer for math.
18
-
19
-
20
- Symbolic doesn't have any external dependencies. It uses only pure ruby (less than 400 LOC (lines of code)).
21
- TEXT
10
+ gem.description = 'Symbolic math for ruby. This gem can help if you want to get a simplified form of a big equation or to speed up similar calculations or you need an abstraction layer for math. Symbolic does not have any external dependencies. It uses only pure ruby (less than 400 lines of code).'
22
11
  gem.email = "ravwar@gmail.com"
23
12
  gem.homepage = "http://brainopia.github.com/symbolic"
24
13
  gem.authors = ["brainopia"]
@@ -74,7 +74,9 @@ module Symbolic
74
74
  end
75
75
 
76
76
  def value
77
- @symbolic.inject(numeric) {|value, (base, exp)| value * base.value ** exp.value }
77
+ if variables.all? &:value
78
+ @symbolic.inject(numeric) {|value, (base, exp)| value * base.value ** exp.value }
79
+ end
78
80
  end
79
81
 
80
82
  def to_s
@@ -13,7 +13,7 @@ class Symbolic::Function
13
13
  end
14
14
 
15
15
  def value
16
- ::Math.send @operation, @argument.value if variables.any? {|it| it.value.nil? }
16
+ ::Math.send @operation, @argument.value if variables.all? &:value
17
17
  end
18
18
 
19
19
  def variables
@@ -36,7 +36,9 @@ module Symbolic
36
36
  end
37
37
 
38
38
  def value
39
- symbolic.inject(numeric) {|value, (base, coef)| value + base.value * coef.value }
39
+ if variables.all? &:value
40
+ symbolic.inject(numeric) {|value, (base, coef)| value + base.value * coef.value }
41
+ end
40
42
  end
41
43
 
42
44
  def to_s
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: symbolic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - brainopia
@@ -22,18 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.2.9
24
24
  version:
25
- description: |
26
- Symbolic math for ruby.
27
-
28
-
29
- This gem can help you
30
- - if you want to get a simplified form of a big equation
31
- - if you want to speed up similar calculations
32
- - if you need an abstraction layer for math.
33
-
34
-
35
- Symbolic doesn't have any external dependencies. It uses only pure ruby (less than 400 LOC (lines of code)).
36
-
25
+ description: Symbolic math for ruby. This gem can help if you want to get a simplified form of a big equation or to speed up similar calculations or you need an abstraction layer for math. Symbolic does not have any external dependencies. It uses only pure ruby (less than 400 lines of code).
37
26
  email: ravwar@gmail.com
38
27
  executables: []
39
28