onering-client 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/onering.rb +1 -1
- data/lib/onering/plugins/reporter.rb +5 -4
- metadata +1 -1
data/lib/onering.rb
CHANGED
@@ -177,7 +177,7 @@ module Onering
|
|
177
177
|
}
|
178
178
|
|
179
179
|
# loads plugins and populates @_report
|
180
|
-
load_plugins
|
180
|
+
load_plugins()
|
181
181
|
|
182
182
|
return @_report.stringify_keys()
|
183
183
|
end
|
@@ -210,8 +210,7 @@ module Onering
|
|
210
210
|
|
211
211
|
if options[:cacheregen] == true
|
212
212
|
Onering::Logger.debug("Forcing cache regeneration", "Onering::Reporter")
|
213
|
-
_update_cache_file(cachefile)
|
214
|
-
return _generated_report()
|
213
|
+
cache = _update_cache_file(cachefile)
|
215
214
|
end
|
216
215
|
|
217
216
|
# remove cached_at key
|
@@ -230,6 +229,8 @@ module Onering
|
|
230
229
|
|
231
230
|
def _update_cache_file(cachefile=DEFAULT_CACHE_FILE)
|
232
231
|
begin
|
232
|
+
report = nil
|
233
|
+
|
233
234
|
File.open(cachefile, 'w+') do |file|
|
234
235
|
Onering::Logger.debug("Regenerating cache file at #{cachefile}", "Onering::Reporter")
|
235
236
|
report = _generated_report()
|
@@ -238,7 +239,7 @@ module Onering
|
|
238
239
|
file.puts(json)
|
239
240
|
end
|
240
241
|
|
241
|
-
return
|
242
|
+
return report
|
242
243
|
rescue Exception => e
|
243
244
|
Onering::Logger.info("Unable to write cache file #{cachefile}: #{e.class.name} - #{e.message}", "Onering::Reporter")
|
244
245
|
return false
|