copy_tuner_client 0.2.2 → 0.2.3

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: d2cf1ed09f1f51f0d3e6f168bd0fd7e19bff7df1
4
- data.tar.gz: 150a65decb162a749bb69e471227313bdf43ba55
3
+ metadata.gz: 4776a7f970369d47eba083c2c2e81a0362970968
4
+ data.tar.gz: d08c3a482222973eaa1c92c69bd55a855c2739ac
5
5
  SHA512:
6
- metadata.gz: 67b1baedb50d075307e816bd341358190e47749a5024d70b452abbc07a01ae7f7e96f6c5a5d86e2851c1e0dc5085b493e75b577a37711da5fabc87afc4af6a3e
7
- data.tar.gz: 67fe0482b1940d611d9ec31c9e9c18da07c60e5a0438a71cdbe4a7a575211a0d99304475c8d261e462262d52683863219e4d881a3774b64830c0ad5dd499429d
6
+ metadata.gz: a2ff8480739ff495314fe784c7abbb1a8badda4c617501946fa600d0af100443dc5a9a1e14a2aac8a26786cc59c1c96779d29e5c0158a7ee9dc48c357a89958b
7
+ data.tar.gz: 74d0ca26099480f98b68d76d7009aa9705c22d16467f848628ab6f7be44378a039994c5251c47ffc8b6b69b3ffdfe5d1417deaa04bd67ccb33baf41554f1901b
data/.travis.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  rvm:
2
- - 1.9
3
2
  - 2.0
4
3
  - 2.1
5
4
  - 2.2
@@ -9,3 +8,6 @@ gemfile:
9
8
  - gemfiles/4.0.gemfile
10
9
  - gemfiles/4.1.gemfile
11
10
  - gemfiles/4.2.gemfile
11
+
12
+ before_install:
13
+ - gem update bundler
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- copy_tuner_client (0.2.2)
4
+ copy_tuner_client (0.2.3)
5
5
  i18n (>= 0.5.0)
6
6
  json
7
7
 
@@ -30,7 +30,7 @@ module CopyTunerClient
30
30
  end
31
31
 
32
32
  def spawner?
33
- passenger_spawner? || unicorn_spawner? || delayed_job_spawner?
33
+ passenger_spawner? || unicorn_spawner? || delayed_job_spawner? || puma_spawner?
34
34
  end
35
35
 
36
36
  def passenger_spawner?
@@ -45,6 +45,10 @@ module CopyTunerClient
45
45
  $0.include?('delayed_job')
46
46
  end
47
47
 
48
+ def puma_spawner?
49
+ $0.include?('puma')
50
+ end
51
+
48
52
  def register_spawn_hooks
49
53
  if defined?(PhusionPassenger)
50
54
  register_passenger_hook
@@ -52,6 +56,8 @@ module CopyTunerClient
52
56
  register_unicorn_hook
53
57
  elsif defined?(Delayed::Worker)
54
58
  register_delayed_hook
59
+ elsif defined?(Puma::Cluster)
60
+ register_puma_hook
55
61
  end
56
62
  end
57
63
 
@@ -77,7 +83,6 @@ module CopyTunerClient
77
83
  def register_delayed_hook
78
84
  @logger.info("Registered Delayed::Job start hook")
79
85
  poller = @poller
80
-
81
86
  Delayed::Worker.class_eval do
82
87
  alias_method :start_without_copy_tuner, :start
83
88
  define_method :start do
@@ -87,6 +92,18 @@ module CopyTunerClient
87
92
  end
88
93
  end
89
94
 
95
+ def register_puma_hook
96
+ @logger.info("Registered Puma fork hook")
97
+ poller = @poller
98
+ Puma::Cluster.class_eval do
99
+ alias_method :worker_without_copy_tuner, :worker
100
+ define_method :worker do |index, master|
101
+ poller.start
102
+ worker_without_copy_tuner(index, master)
103
+ end
104
+ end
105
+ end
106
+
90
107
  def register_exit_hooks
91
108
  at_exit do
92
109
  @cache.flush
@@ -1,6 +1,6 @@
1
1
  module CopyTunerClient
2
2
  # Client version
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
4
4
 
5
5
  # API version being used to communicate with the server
6
6
  API_VERSION = '2.0'.freeze
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy_tuner_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - SonicGarden
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n