daengine 0.1.3 → 0.1.4

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/daengine.rb CHANGED
@@ -24,7 +24,6 @@ module Daengine
24
24
 
25
25
  def self.log(message, level)
26
26
  message = "[#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}] #{message}"
27
-
28
27
  puts "#{message}"
29
28
  case level
30
29
  when "warn"
@@ -38,7 +37,7 @@ module Daengine
38
37
 
39
38
  # yaml file config
40
39
  def self.configure(config_options)
41
- config_options.each {|k,v| @config[k.to_sym] = v}
40
+ config_options.each {|k,v| @config[k.to_sym] = v}
42
41
  config_options.each {|k,v|
43
42
  @mongoid_config[k] = v if @valid_mongoid_keys.include? k
44
43
  }
@@ -57,7 +56,11 @@ module Daengine
57
56
  self.set_logger()
58
57
  self.log("Daengine: ### Loading application config ###", "info")
59
58
  config_options.each { |key, value| self.log("CONFIG #{key}\t#{value}", "info")}
60
- return DigitalAssetProcessor.process_tuple_directory # start the thread daemon
59
+ begin
60
+ DigitalAssetProcessor.process_tuple_directory # start the thread daemon
61
+ rescue Exception => e
62
+ self.log(e.message, "error")
63
+ end
61
64
  end
62
65
 
63
66
  def self.set_logger
@@ -58,7 +58,7 @@ module Daengine
58
58
  }.sort_by { |f| File.mtime("#{path}/#{f}") }
59
59
 
60
60
  if deploy_files.empty?
61
- Daengine.log("DigitalAssetProcessor: No digital asset deployment files found to process under #{path}", "warn")
61
+ Daengine.log("WARN: DigitalAssetProcessor: No digital asset deployment files found to process under #{path}", "warn")
62
62
  else
63
63
  Daengine.log("DigitalAssetProcessor: Reading digital asset deployment files from #{path}", "info")
64
64
  deploy_files.each do |filename|
@@ -83,7 +83,7 @@ module Daengine
83
83
  f.write(content)
84
84
  end
85
85
  rescue Exception => e
86
- Daengine.log("DigitalAssetProcessor: Failed to write to #{target}.", "warn")
86
+ Daengine.log("ERROR: DigitalAssetProcessor: Failed to write to #{target}.", "error")
87
87
  end
88
88
  end
89
89
 
@@ -94,7 +94,7 @@ module Daengine
94
94
  property = YAML.load_file(target)
95
95
  time = property['last_read_time']
96
96
  rescue Exception => e
97
- Daengine.log("DigitalAssetProcessor: Failed to read from #{target}", "warn")
97
+ Daengine.log("ERROR: DigitalAssetProcessor: Failed to read from #{target}", "error")
98
98
  end
99
99
  time
100
100
  end
@@ -1,3 +1,3 @@
1
1
  module Daengine
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: daengine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.3
5
+ version: 0.1.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - sbhatia
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-06-25 00:00:00.000000000Z
13
+ date: 2012-06-26 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails