feedupdater 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +2 -0
- data/lib/feed_updater.rb +77 -2
- data/lib/feed_updater/version.rb +1 -1
- metadata +54 -50
data/CHANGELOG
CHANGED
data/lib/feed_updater.rb
CHANGED
@@ -23,6 +23,28 @@
|
|
23
23
|
|
24
24
|
require 'feed_updater/version'
|
25
25
|
|
26
|
+
# :stopdoc:
|
27
|
+
# ROFLCOPTERS?
|
28
|
+
# This mainly exists because of the approximately 1 billion different
|
29
|
+
# ways to deploy this script.
|
30
|
+
class FileStalker
|
31
|
+
def self.hunt(paths)
|
32
|
+
for path in paths
|
33
|
+
if File.exists?(File.expand_path(path))
|
34
|
+
return File.expand_path(path)
|
35
|
+
elsif File.exists?(File.expand_path(
|
36
|
+
File.dirname(__FILE__) + path))
|
37
|
+
return File.expand_path(File.dirname(__FILE__) + path)
|
38
|
+
elsif File.exists?(File.expand_path(
|
39
|
+
File.dirname(__FILE__) + "/" + path))
|
40
|
+
return File.expand_path(File.dirname(__FILE__) + "/" + path)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
return nil
|
44
|
+
end
|
45
|
+
end
|
46
|
+
# :startdoc:
|
47
|
+
|
26
48
|
$:.unshift(File.dirname(__FILE__))
|
27
49
|
$:.unshift(File.dirname(__FILE__) + "/feed_updater/vendor")
|
28
50
|
|
@@ -308,18 +330,71 @@ module FeedTools
|
|
308
330
|
# Reestablish correct location
|
309
331
|
Dir.chdir(File.expand_path(self.initial_directory))
|
310
332
|
|
333
|
+
sleep(1)
|
334
|
+
|
311
335
|
self.restart_logger()
|
336
|
+
self.logger.info("Using environment: #{FEED_TOOLS_ENV}")
|
312
337
|
|
313
338
|
if FeedTools.configurations[:feed_cache].nil?
|
314
339
|
FeedTools.configurations[:feed_cache] =
|
315
340
|
"FeedTools::DatabaseFeedCache"
|
316
341
|
end
|
342
|
+
|
317
343
|
if !FeedTools.feed_cache.connected?
|
344
|
+
FeedTools.configurations[:feed_cache] =
|
345
|
+
"FeedTools::DatabaseFeedCache"
|
318
346
|
FeedTools.feed_cache.initialize_cache()
|
347
|
+
begin
|
348
|
+
ActiveRecord::Base.default_timezone = :utc
|
349
|
+
ActiveRecord::Base.connection
|
350
|
+
rescue Exception
|
351
|
+
config_path = FileStalker.hunt([
|
352
|
+
"./config/database.yml",
|
353
|
+
"../config/database.yml",
|
354
|
+
"../../config/database.yml",
|
355
|
+
"./database.yml",
|
356
|
+
"../database.yml",
|
357
|
+
"../../database.yml"
|
358
|
+
])
|
359
|
+
if config_path != nil
|
360
|
+
require 'yaml'
|
361
|
+
config_hash = File.open(config_path) do |file|
|
362
|
+
config_hash = YAML.load(file.read)
|
363
|
+
unless config_hash[FEED_TOOLS_ENV].nil?
|
364
|
+
config_hash = config_hash[FEED_TOOLS_ENV]
|
365
|
+
end
|
366
|
+
config_hash
|
367
|
+
end
|
368
|
+
self.logger.info(
|
369
|
+
"Attempting to manually load the database " +
|
370
|
+
"connection described in:")
|
371
|
+
self.logger.info(config_path)
|
372
|
+
begin
|
373
|
+
ActiveRecord::Base.configurations = config_hash
|
374
|
+
ActiveRecord::Base.establish_connection(config_hash)
|
375
|
+
ActiveRecord::Base.connection
|
376
|
+
rescue Exception => error
|
377
|
+
self.logger.fatal(
|
378
|
+
"Error initializing database:")
|
379
|
+
self.logger.fatal(error)
|
380
|
+
exit
|
381
|
+
end
|
382
|
+
else
|
383
|
+
self.logger.fatal(
|
384
|
+
"The database.yml file does not appear " +
|
385
|
+
"to exist.")
|
386
|
+
exit
|
387
|
+
end
|
388
|
+
end
|
319
389
|
end
|
320
390
|
if !FeedTools.feed_cache.connected?
|
321
|
-
self.logger.fatal(
|
322
|
-
|
391
|
+
self.logger.fatal("Not connected to the feed cache.")
|
392
|
+
if FeedTools.feed_cache.respond_to?(:table_exists?)
|
393
|
+
if !FeedTools.feed_cache.table_exists?
|
394
|
+
self.logger.fatal(
|
395
|
+
"The FeedTools cache table is missing.")
|
396
|
+
end
|
397
|
+
end
|
323
398
|
exit
|
324
399
|
end
|
325
400
|
|
data/lib/feed_updater/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.
|
2
|
+
rubygems_version: 0.9.0
|
3
3
|
specification_version: 1
|
4
4
|
name: feedupdater
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.2.
|
7
|
-
date: 2006-
|
6
|
+
version: 0.2.3
|
7
|
+
date: 2006-09-14 00:00:00 -04:00
|
8
8
|
summary: Automatic feed updater daemon.
|
9
9
|
require_paths:
|
10
|
-
|
10
|
+
- lib
|
11
11
|
email: bob@sporkmonger.com
|
12
12
|
homepage: http://sporkmonger.com/projects/feedupdater
|
13
13
|
rubyforge_project: feedtools
|
@@ -18,62 +18,66 @@ bindir: bin
|
|
18
18
|
has_rdoc: false
|
19
19
|
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
20
|
requirements:
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
version: 0.0.0
|
21
|
+
- - ">"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.0
|
25
24
|
version:
|
26
25
|
platform: ruby
|
27
26
|
signing_key:
|
28
27
|
cert_chain:
|
28
|
+
post_install_message:
|
29
29
|
authors:
|
30
|
-
|
30
|
+
- Bob Aman
|
31
31
|
files:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
32
|
+
- bin
|
33
|
+
- CHANGELOG
|
34
|
+
- config
|
35
|
+
- doc
|
36
|
+
- example
|
37
|
+
- lib
|
38
|
+
- log
|
39
|
+
- pkg
|
40
|
+
- rakefile
|
41
|
+
- README
|
42
|
+
- bin/feed_updater
|
43
|
+
- lib/feed_updater
|
44
|
+
- lib/feed_updater.rb
|
45
|
+
- lib/feed_updater/vendor
|
46
|
+
- lib/feed_updater/version.rb
|
47
|
+
- lib/feed_updater/vendor/daemons
|
48
|
+
- lib/feed_updater/vendor/daemons.rb
|
49
|
+
- lib/feed_updater/vendor/daemons/application.rb
|
50
|
+
- lib/feed_updater/vendor/daemons/application_group.rb
|
51
|
+
- lib/feed_updater/vendor/daemons/cmdline.rb
|
52
|
+
- lib/feed_updater/vendor/daemons/controller.rb
|
53
|
+
- lib/feed_updater/vendor/daemons/daemonize.rb
|
54
|
+
- lib/feed_updater/vendor/daemons/exceptions.rb
|
55
|
+
- lib/feed_updater/vendor/daemons/monitor.rb
|
56
|
+
- lib/feed_updater/vendor/daemons/pid.rb
|
57
|
+
- lib/feed_updater/vendor/daemons/pidfile.rb
|
58
|
+
- lib/feed_updater/vendor/daemons/pidmem.rb
|
59
|
+
- config/feed_updater.yml
|
60
|
+
- example/custom_updater.rb
|
60
61
|
test_files: []
|
62
|
+
|
61
63
|
rdoc_options:
|
62
|
-
|
63
|
-
|
64
|
+
- --exclude
|
65
|
+
- .
|
64
66
|
extra_rdoc_files: []
|
67
|
+
|
65
68
|
executables:
|
66
|
-
|
69
|
+
- feed_updater
|
67
70
|
extensions: []
|
71
|
+
|
68
72
|
requirements: []
|
73
|
+
|
69
74
|
dependencies:
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
version:
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: feedtools
|
77
|
+
version_requirement:
|
78
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.2.24
|
83
|
+
version:
|