perfectsched 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,5 +1,11 @@
1
1
 
2
- == 2011-09-03 version 0.7.0
2
+ == 2011-09-16 version 0.7.1
3
3
 
4
- * Initial release
4
+ * Supports to read multiple configuration files
5
+ * Fixed command-line launcher
6
+
7
+
8
+ == 2011-09-02 version 0.7.0
9
+
10
+ * First release
5
11
 
@@ -5,8 +5,7 @@ module PerfectSched
5
5
  class SimpleDBBackend < Backend
6
6
  def initialize(key_id, secret_key, domain)
7
7
  super()
8
- gem "aws-sdk"
9
- require 'aws'
8
+ require 'aws-sdk'
10
9
  @consistent_read = false
11
10
 
12
11
  @db = AWS::SimpleDB.new(
@@ -103,7 +103,7 @@ begin
103
103
  type ||= :run
104
104
 
105
105
  case type
106
- case :add
106
+ when :add
107
107
  if ARGV.length != 2
108
108
  usage nil
109
109
  end
@@ -184,7 +184,7 @@ conf[:timeout] ||= 60
184
184
  conf[:poll_interval] ||= 1
185
185
 
186
186
  # backend
187
- bconf = yaml['backend']
187
+ bconf = conf[:backend]
188
188
  if domain = bconf['simpledb']
189
189
  require 'perfectsched/backend/simpledb'
190
190
  key_id = bconf['aws_key_id'] || ENV['AWS_ACCESS_KEY_ID']
@@ -205,21 +205,23 @@ else
205
205
  end
206
206
 
207
207
  # queue
208
- bconf = yaml['queue']
209
- if domain = bconf['simpledb']
210
- require 'perfectqueue/backend/simpledb'
211
- key_id = bconf['aws_key_id'] || ENV['AWS_ACCESS_KEY_ID']
212
- secret_key = bconf['aws_secret_key'] || ENV['AWS_SECRET_ACCESS_KEY']
213
- queue = PerfectQueue::SimpleDBBackend.new(key_id, secret_key, domain)
214
-
215
- elsif uri = bconf['database']
216
- require 'perfectqueue/backend/rdb'
217
- table = bconf['table'] || "perfectqueue"
218
- queue = PerfectQueue::RDBBackend.new(uri, table)
208
+ make_queue = Proc.new do
209
+ bconf = conf[:queue]
210
+ if domain = bconf['simpledb']
211
+ require 'perfectqueue/backend/simpledb'
212
+ key_id = bconf['aws_key_id'] || ENV['AWS_ACCESS_KEY_ID']
213
+ secret_key = bconf['aws_secret_key'] || ENV['AWS_SECRET_ACCESS_KEY']
214
+ queue = PerfectQueue::SimpleDBBackend.new(key_id, secret_key, domain)
215
+
216
+ elsif uri = bconf['database']
217
+ require 'perfectqueue/backend/rdb'
218
+ table = bconf['table'] || "perfectqueue"
219
+ queue = PerfectQueue::RDBBackend.new(uri, table)
219
220
 
220
- else
221
- $stderr.puts "Invalid configuration file: queue section is required"
222
- exit 1
221
+ else
222
+ $stderr.puts "Invalid configuration file: queue section is required"
223
+ exit 1
224
+ end
223
225
  end
224
226
 
225
227
  require 'logger'
@@ -313,6 +315,7 @@ when :run
313
315
  log.level = Logger::INFO
314
316
  end
315
317
 
318
+ queue = make_queue.call
316
319
  engine = PerfectSched::Engine.new(backend, queue, log, conf)
317
320
 
318
321
  trap :INT do
@@ -1,5 +1,5 @@
1
1
  module PerfectSched
2
2
 
3
- VERSION = '0.7.0'
3
+ VERSION = '0.7.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perfectsched
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
- version: 0.7.0
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sadayuki Furuhashi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-03 00:00:00 +09:00
18
+ date: 2011-09-16 00:00:00 +09:00
19
19
  default_executable: perfectsched
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency