old_sql 1.0.0 → 1.1.0
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.
- data/lib/old_sql/report_processor/base.rb +9 -4
- metadata +2 -2
@@ -113,16 +113,21 @@ module OldSql
|
|
113
113
|
Rails.logger.debug "Evalutating Expression: #{expression}"
|
114
114
|
result = eval(expression)
|
115
115
|
Rails.logger.debug "EXPR RESULT #{result.to_s}"
|
116
|
-
Rails.logger.debug "result.to_s!='NaN' #{result.to_s!="NaN"}"
|
117
|
-
if result.to_s!="Infinity" && result.to_s!="NaN"
|
118
|
-
return result
|
119
|
-
end
|
120
116
|
rescue ZeroDivisionError => e
|
121
117
|
Rails.logger.error e
|
122
118
|
rescue Exception => e
|
123
119
|
Rails.logger.error e
|
124
120
|
end
|
125
121
|
|
122
|
+
if result.class == Float || result.class == Fixnum
|
123
|
+
result = result.to_s
|
124
|
+
end
|
125
|
+
|
126
|
+
if result == "Infinity" || result == "NaN"
|
127
|
+
result = "0.0"
|
128
|
+
end
|
129
|
+
|
130
|
+
puts "Result of the expression: #{result}"
|
126
131
|
Rails.logger.debug "Result of the expression: #{result}"
|
127
132
|
|
128
133
|
result
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: old_sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Eddie Gonzales
|
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
200
200
|
requirements:
|
201
201
|
- - ">="
|
202
202
|
- !ruby/object:Gem::Version
|
203
|
-
hash:
|
203
|
+
hash: -2514440904525593455
|
204
204
|
segments:
|
205
205
|
- 0
|
206
206
|
version: "0"
|