feed_us_grabber 0.1.6 → 0.1.7
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/app/models/feed_us_grabber.rb +13 -10
- metadata +2 -2
@@ -115,20 +115,22 @@ class FeedUsGrabber
|
|
115
115
|
strResults
|
116
116
|
end
|
117
117
|
|
118
|
-
def autoCacheToFile
|
119
|
-
|
118
|
+
def autoCacheToFile
|
119
|
+
puts "trace: start autoCacheToFile. bIsPostBack = #{@bIsPostBack}"
|
120
|
+
if @bIsPostBack
|
120
121
|
return
|
121
122
|
end
|
122
123
|
|
124
|
+
puts "trace: mstrCacheCommand = #{@mstrCacheCommand}"
|
123
125
|
if @mstrCacheCommand.nil? || @mstrCacheCommand == ''
|
124
126
|
if (!self.cachedFileExists) or self.cacheFileIsExpired
|
125
127
|
self.createCacheFile
|
126
128
|
end
|
127
129
|
else
|
128
130
|
if @mstrCacheCommand == "clear"
|
129
|
-
|
130
|
-
|
131
|
-
|
131
|
+
if @mstrCacheGroup != ''
|
132
|
+
self.clearCacheGroupFiles(@mstrCacheGroup)
|
133
|
+
end
|
132
134
|
end
|
133
135
|
if @mstrCacheCommand == 'clearall' || @mstrCacheCommand == CACHE_COMMAND_FORCE
|
134
136
|
self.clearAllCachedFiles
|
@@ -256,11 +258,11 @@ class FeedUsGrabber
|
|
256
258
|
|
257
259
|
def clearAllCachedFiles
|
258
260
|
# For testing heroku logging
|
259
|
-
puts "
|
260
|
-
logfile = File.open(File.join(Rails.root.to_s,'log','FeedUsGrabber.log'),'a');
|
261
|
-
|
262
|
-
|
263
|
-
|
261
|
+
puts "Trace: Clearing all caches at path = #{@mstrCacheFolder}"
|
262
|
+
#logfile = File.open(File.join(Rails.root.to_s,'log','FeedUsGrabber.log'),'a');
|
263
|
+
grabber_logger = FeedUsGrabberLogger.new(STDOUT)
|
264
|
+
grabber_logger.info("Clearing all caches at path #{@mstrCacheFolder}")
|
265
|
+
logfile.close
|
264
266
|
self.clearCacheFolder(@mstrCacheFolder);
|
265
267
|
end
|
266
268
|
|
@@ -268,6 +270,7 @@ class FeedUsGrabber
|
|
268
270
|
canConnect = canConnectToFeedUs()
|
269
271
|
|
270
272
|
if canConnect == true
|
273
|
+
puts "Trace: clear cache folder can connect"
|
271
274
|
FileUtils.rm_r Dir.glob("#{folder}/*")
|
272
275
|
else
|
273
276
|
logError("Unable to connect to Feed.Us. Cache will not be cleared. URL that was checked: #{@mstrDynURL}")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feed_us_grabber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -124,7 +124,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
segments:
|
126
126
|
- 0
|
127
|
-
hash:
|
127
|
+
hash: 47466173
|
128
128
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|