sidekiq-runner 0.0.6 → 0.0.7

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: cbe36f244c002dcca25d52e425792fccd68d58af
4
- data.tar.gz: 9fb6e9c8fa405fdc7ad041fb5bca45c7b3d91732
3
+ metadata.gz: 025033989197d8f90e49cc3d314529f9a1e7bdc0
4
+ data.tar.gz: 3c395d4fac5b46bb4d016de49c5a234b8174d102
5
5
  SHA512:
6
- metadata.gz: 74a66c78b8fd0c97a65852c2617d84818eb61839bdb9c8a6605aa1e1bf8f4bf4a24bb2d32549f9fd70ba2f9545ebab5fd606e53f8d4f0c16a8f3b41c4265cae1
7
- data.tar.gz: 47833bd2adf8edc3080ac6ff73e685b163b9185a3e5ac4fdb0c199b03d2f3a7cde9938d25b37ec86c8f5fe318b0221fbc5b0851b23b1beef6957be4c4eb0ed61
6
+ metadata.gz: 94fe6f473ce4a652ee8be9cdb5b06cd9a79a6203a0c5eae69a526733b90f7dfc502f72f2e33eb568dfa5b5ec855be080a48b0a4c4046b882b4ebfa0eda2de58e
7
+ data.tar.gz: 019d1ccceb4147afa6c9b81231940f9e6a9ba7557e00adf85c10d6ed052eb45b0efec0d3b57f3f74834ea84ae19ea4131d945d3adc8f975de74051c70a1ca872
@@ -8,7 +8,7 @@ module SidekiqRunner
8
8
 
9
9
  def self.get
10
10
  config = default.dup
11
- config.send :merge_config_file!
11
+ config.merge_config_file!
12
12
  config
13
13
  end
14
14
 
@@ -36,6 +36,8 @@ module SidekiqRunner
36
36
  end
37
37
 
38
38
  def options
39
+ create_directories!
40
+
39
41
  {
40
42
  daemonize: @daemonize,
41
43
  port: @port,
@@ -46,8 +48,6 @@ module SidekiqRunner
46
48
  }
47
49
  end
48
50
 
49
- private
50
-
51
51
  def merge_config_file!
52
52
  if File.exist?(config_file)
53
53
  yml = YAML.load_file(config_file)
@@ -57,5 +57,9 @@ module SidekiqRunner
57
57
  end
58
58
  end
59
59
  end
60
+
61
+ def create_directories!
62
+ FileUtils.mkdir_p(File.dirname(log_file))
63
+ end
60
64
  end
61
65
  end
@@ -26,8 +26,8 @@ module SidekiqRunner
26
26
 
27
27
  def self.get
28
28
  config = default.dup
29
- config.send :merge_config_file!
30
- config.send :sane?
29
+ config.merge_config_file!
30
+ config.sane?
31
31
  config
32
32
  end
33
33
 
@@ -52,7 +52,7 @@ module SidekiqRunner
52
52
 
53
53
  # Top-level single instance configuration methods, partially for backward compatibility.
54
54
 
55
- SidekiqInstance::CONFIG_FILE_ATTRIBUTES.each do |meth|
55
+ (SidekiqInstance::CONFIG_FILE_ATTRIBUTES + SidekiqInstance::RUNNER_ATTRIBUTES).each do |meth|
56
56
  define_method("#{meth}=") do |val|
57
57
  ensure_default_sidekiq!
58
58
  @sidekiqs.each { |_, skiq| skiq.send("#{meth}=", val) }
@@ -81,8 +81,6 @@ module SidekiqRunner
81
81
  end
82
82
  end
83
83
 
84
- private
85
-
86
84
  def ensure_default_sidekiq!
87
85
  add_instance('sidekiq_default') if empty?
88
86
  end
@@ -1,7 +1,10 @@
1
1
  module SidekiqRunner
2
2
  class SidekiqInstance
3
3
 
4
- CONFIG_FILE_ATTRIBUTES = [:bundle_env, :chdir, :requirefile, :concurrency, :verbose, :pidfile, :logfile]
4
+ RUNNER_ATTRIBUTES = [:bundle_env, :chdir, :requirefile]
5
+ RUNNER_ATTRIBUTES.each { |att| attr_accessor att }
6
+
7
+ CONFIG_FILE_ATTRIBUTES = [:concurrency, :verbose, :pidfile, :logfile]
5
8
  CONFIG_FILE_ATTRIBUTES.each { |att| attr_accessor att }
6
9
 
7
10
  attr_reader :name, :queues
@@ -50,6 +53,8 @@ module SidekiqRunner
50
53
  end
51
54
 
52
55
  def build_start_command
56
+ create_directories!
57
+
53
58
  cmd = []
54
59
  cmd << (bundle_env ? 'bundle exec sidekiq' : 'sidekiq')
55
60
  cmd << '-d'
@@ -76,5 +81,12 @@ module SidekiqRunner
76
81
 
77
82
  cmd.join(' ')
78
83
  end
84
+
85
+ private
86
+
87
+ def create_directories!
88
+ FileUtils.mkdir_p(File.dirname(logfile))
89
+ FileUtils.mkdir_p(File.dirname(pidfile))
90
+ end
79
91
  end
80
92
  end
@@ -1,3 +1,3 @@
1
1
  module SidekiqRunner
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq-runner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - FlavourSys Technology GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-30 00:00:00.000000000 Z
11
+ date: 2014-07-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake