shinq 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 655d145ff88397bca387abccd196c36888428e21
4
- data.tar.gz: 41df3f27cc6b3af3fa50a5fa2d3d0ab0da24293d
3
+ metadata.gz: 792190c7626e32ef84a9df82f9a0fb6502ae936a
4
+ data.tar.gz: 5a9183334a17fe91af641bfc18d30f049b42edb3
5
5
  SHA512:
6
- metadata.gz: 10c3396b0201a6d678c8be2fb172c885e58ef13a14c56ffc7f5c4af37f95e9af579c60bda6a3236112bf3b95fd98d27ac4b07f88fc2250736a7b964113aa77c8
7
- data.tar.gz: 6307bd0ce80f84e26b4e9cbfd11f2e463ba9f933bffa3149d9f275117bb5103ebf9174a7d632d6f83445516f10699ed91e2eef20accaefb2882e0df9e117e667
6
+ metadata.gz: 57bbdaa11b9f39ce503bb1f845c74cdae2cda448ebf8a3709200e5f7bc9b4bc7d128710a23e71ef6563a82d205158085ff949f3ceacfb795adfcea6c52035673
7
+ data.tar.gz: '08b5390c1bc3aa2d38cfe3fafb5a9ceae784f8535a2a45bb1a6f3124ca8f1e33a57b3aa87f4250910695051a058457bbc94cd68784c22e6c79cd5174adb3d5a3'
data/lib/shinq/cli.rb CHANGED
@@ -6,6 +6,7 @@ require 'shinq/statistics'
6
6
  require 'shinq/configuration'
7
7
  require 'shinq/logger'
8
8
  require 'serverengine'
9
+ require 'active_support/inflector'
9
10
 
10
11
  module Shinq
11
12
  class OptionParseError < StandardError; end
@@ -29,8 +30,11 @@ module Shinq
29
30
  opts[:daemonize] = v
30
31
  end
31
32
 
32
- opt.on('-w', '--worker value', 'Name of worker class') do |v|
33
+ opt.on('-w', '--worker VALUE', 'Name of worker class') do |v|
34
+ worker_class = v.camelize.safe_constantize
35
+ raise OptionParseError, "worker class #{v.camelize} corresponding to #{v} does not exist" unless worker_class
33
36
  opts[:worker_name] = v
37
+ opts[:worker_class] = worker_class
34
38
  end
35
39
 
36
40
  opt.on('-p', '--process VALUE', 'Number of workers') do |v|
@@ -10,7 +10,7 @@ module Shinq
10
10
  # You may need to set it +false+ for jobs which take very long time to proceed.
11
11
  # You may also need to handle performing error manually then.
12
12
  class Configuration
13
- attr_accessor :require, :worker_name, :db_config, :queue_db, :default_db, :process, :queue_timeout, :daemonize, :statistics, :lifecycle, :abort_on_error
13
+ attr_accessor :require, :worker_name, :worker_class, :db_config, :queue_db, :default_db, :process, :queue_timeout, :daemonize, :statistics, :lifecycle, :abort_on_error
14
14
 
15
15
  DEFAULT = {
16
16
  require: '.',
@@ -7,7 +7,7 @@ module Shinq
7
7
  # @see Shinq::Configuration#abort_on_error
8
8
  def run
9
9
  worker_name = Shinq.configuration.worker_name
10
- worker_class = worker_name.camelize.constantize
10
+ worker_class = Shinq.configuration.worker_class
11
11
 
12
12
  @loop_count = 0
13
13
 
data/shinq.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "shinq"
7
- spec.version = '0.7.0'
7
+ spec.version = '0.7.1'
8
8
  spec.authors = ["Ryoichi SEKIGUCHI"]
9
9
  spec.email = ["ryopeko@gmail.com"]
10
10
  spec.summary = %q{Worker and enqueuer for Q4M using the interface of ActiveJob.}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shinq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryoichi SEKIGUCHI
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -238,7 +238,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
238
238
  version: '0'
239
239
  requirements: []
240
240
  rubyforge_project:
241
- rubygems_version: 2.5.1
241
+ rubygems_version: 2.6.8
242
242
  signing_key:
243
243
  specification_version: 4
244
244
  summary: Worker and enqueuer for Q4M using the interface of ActiveJob.