deadpool 0.1.2 → 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/deadpool/generator.rb +3 -2
- data/lib/deadpool/helper.rb +16 -4
- data/lib/deadpool/server.rb +11 -0
- metadata +6 -6
data/lib/deadpool/generator.rb
CHANGED
@@ -147,7 +147,8 @@ exec #{ruby_path} #{deadpool_admin_path} --foreground #{config_params}
|
|
147
147
|
# mkdir path/lib/deadpool/failover_protocol
|
148
148
|
# path/lib/deadpool/failover_protocol
|
149
149
|
def generate_configuration(options)
|
150
|
-
|
150
|
+
config_path = options[:config_path]
|
151
|
+
path = config_path
|
151
152
|
FileUtils.mkdir_p(File.join(path, 'config/pools'))
|
152
153
|
FileUtils.mkdir_p(File.join(path, 'lib/deadpool/monitor'))
|
153
154
|
FileUtils.mkdir_p(File.join(path, 'lib/deadpool/failover_protocol'))
|
@@ -204,7 +205,7 @@ failover_protocol_configs:
|
|
204
205
|
# admin_port: 5507
|
205
206
|
|
206
207
|
EOF
|
207
|
-
if File.exists?
|
208
|
+
if File.exists? environment_config_path
|
208
209
|
puts "#{environment_config_path} already exists. Here's what we would have copied there."
|
209
210
|
puts environment_conf
|
210
211
|
else
|
data/lib/deadpool/helper.rb
CHANGED
@@ -20,11 +20,15 @@ module Deadpool
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def self.configure(options)
|
23
|
-
default_config
|
24
|
-
|
25
|
-
config = Deadpool::Helper.symbolize_keys default_config.merge(user_config).merge(options)
|
23
|
+
default_config = YAML.load(File.read(File.join(File.dirname(__FILE__), '../../config/default_environment.yml')))
|
24
|
+
environment_config_path = File.join(options[:config_path], 'config/environment.yml')
|
26
25
|
|
27
|
-
|
26
|
+
if File.exists? environment_config_path
|
27
|
+
user_config = YAML.load(File.read(File.join(options[:config_path], 'config/environment.yml')))
|
28
|
+
return Deadpool::Helper.symbolize_keys default_config.merge(user_config).merge(options)
|
29
|
+
else
|
30
|
+
return default_config
|
31
|
+
end
|
28
32
|
end
|
29
33
|
|
30
34
|
def self.setup_logger(config)
|
@@ -33,6 +37,14 @@ module Deadpool
|
|
33
37
|
|
34
38
|
return logger
|
35
39
|
end
|
40
|
+
|
41
|
+
def self.camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)
|
42
|
+
if first_letter_in_uppercase
|
43
|
+
lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
44
|
+
else
|
45
|
+
lower_case_and_underscored_word.to_s[0].chr.downcase + camelize(lower_case_and_underscored_word)[1..1]
|
46
|
+
end
|
47
|
+
end
|
36
48
|
|
37
49
|
end
|
38
50
|
|
data/lib/deadpool/server.rb
CHANGED
@@ -40,6 +40,17 @@ module Deadpool
|
|
40
40
|
schedule_system_check
|
41
41
|
}
|
42
42
|
end
|
43
|
+
|
44
|
+
def load_plugins
|
45
|
+
failover_plugin_dir = File.join @options[:config_path], 'lib', 'deadpool', 'failover_protocol'
|
46
|
+
monitor_plugin_dir = File.join @options[:config_path], 'lib', 'deadpool', 'monitor'
|
47
|
+
|
48
|
+
[failover_plugin_dir, monitor_plugin_dir].each do |plugin_dir|
|
49
|
+
Dir[plugin_dir + '/*.rb'].each do |filename|
|
50
|
+
require filename
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
43
54
|
|
44
55
|
def load_handlers
|
45
56
|
@handlers = {}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deadpool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kirt Fitzpatrick
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-01-
|
18
|
+
date: 2011-01-19 00:00:00 -08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: 1.4.6
|
51
51
|
type: :runtime
|
52
52
|
version_requirements: *id002
|
53
|
-
description: "
|
53
|
+
description: " Non VIP based failover service for MySQL and others in the cloud.\n Nagios monitoring built in.\n Designed to let you add custom monitoring and failover plugins.\n"
|
54
54
|
email: kirt.fitzpatrick@akqa.com
|
55
55
|
executables:
|
56
56
|
- deadpool_admin
|
@@ -120,6 +120,6 @@ rubyforge_project:
|
|
120
120
|
rubygems_version: 1.4.2
|
121
121
|
signing_key:
|
122
122
|
specification_version: 3
|
123
|
-
summary:
|
123
|
+
summary: Non VIP based failover service for MySQL and others in the cloud.
|
124
124
|
test_files: []
|
125
125
|
|