old_sql 0.57.0 → 0.58.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 +7 -9
- metadata +2 -2
@@ -100,7 +100,7 @@ module OldSql
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
end
|
103
|
-
report_row << eval_expression(expression) unless expression.length==0
|
103
|
+
report_row << eval_expression(expression) unless expression.length==0
|
104
104
|
end
|
105
105
|
|
106
106
|
add_row(nil, report_row)
|
@@ -108,21 +108,19 @@ module OldSql
|
|
108
108
|
end
|
109
109
|
|
110
110
|
def eval_expression expression
|
111
|
+
result = "0.0"
|
111
112
|
begin
|
112
|
-
Rails.logger.debug "Evalutating Expression: #{expression}"
|
113
113
|
result = eval(expression)
|
114
|
-
|
115
|
-
Rails.logger.debug "result.to_s!='NaN' #{result.to_s!="NaN"}"
|
116
|
-
if result.to_s!="Infinity" || result.to_s!="NaN"
|
114
|
+
if result.to_s!="Infinity" && result.to_s!="NaN"
|
117
115
|
return result
|
118
|
-
else
|
119
|
-
return "0.0"
|
120
116
|
end
|
121
117
|
rescue ZeroDivisionError => e
|
122
|
-
|
118
|
+
Rails.logger.info "Catching Divide by Zero"
|
123
119
|
rescue Exception => e
|
124
|
-
|
120
|
+
Rails.logger.error e
|
125
121
|
end
|
122
|
+
|
123
|
+
result
|
126
124
|
end
|
127
125
|
|
128
126
|
def new_data(page=1, total=1, records=1)
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: old_sql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.58.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: -4234118978509127894
|
204
204
|
segments:
|
205
205
|
- 0
|
206
206
|
version: "0"
|