opener-opinion-detector 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/opinion-detector-server +26 -29
- data/lib/opener/opinion_detector/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4dce5b1a9a3888005c12068e17b688e22ae9a59
|
4
|
+
data.tar.gz: b11fdc456f1fceff08699263333e5f7305e30dc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b29925a2426e06194159b1e17645749f3acc2a8e50cef8827bd6dcf9bec73723a78ddf3e817edaf48863e38f55c3617092a426a507fda2ee487fc6ec88cb5d8
|
7
|
+
data.tar.gz: 83229e5298bf70f5e3d35f3921d090d0525d9fa8a248c6dcbd1d31e041d88ff9889b5aa9deafa83f9c106e335a690d2da001942ec45dee0129fde3b2b276ad2b
|
data/bin/opinion-detector-server
CHANGED
@@ -4,50 +4,47 @@ require 'puma/cli'
|
|
4
4
|
require 'optparse'
|
5
5
|
require 'opener/core/resource_switcher'
|
6
6
|
|
7
|
-
# Puma sadly does not provide a system that allows us to cleanly inject custom
|
8
|
-
# options into their CLI. At the same time Puma doesn't provide an easy system
|
9
|
-
# of starting it *without* using the `Puma::CLI` class.
|
10
|
-
#
|
11
|
-
# To work around these problems we create our own parser and ignore any invalid
|
12
|
-
# option errors it throws up. This parser is used to handle options for the
|
13
|
-
# resource switcher.
|
14
|
-
|
15
7
|
rack_config = File.expand_path('../../config.ru', __FILE__)
|
16
8
|
switcher = Opener::Core::ResourceSwitcher.new
|
9
|
+
puma_args = [rack_config]
|
17
10
|
switcher_opts = {}
|
18
|
-
show_help = false
|
19
11
|
|
20
|
-
|
12
|
+
option_parser = OptionParser.new do |opts|
|
21
13
|
opts.banner = "Usage: #{File.basename($0)} [OPTIONS]"
|
22
14
|
|
23
|
-
opts.separator "\nOptions:\n"
|
15
|
+
opts.separator "\nOptions:\n\n"
|
24
16
|
|
25
|
-
# Don't abort in this block as we otherwise can't show Puma's help message.
|
26
17
|
opts.on('-h', '--help', 'Shows this help message') do
|
27
|
-
|
18
|
+
abort option_parser.to_s
|
19
|
+
end
|
28
20
|
|
29
|
-
|
21
|
+
opts.on('-S', '--state PATH', 'Where to store the state details') do |val|
|
22
|
+
puma_args += ['--state', val]
|
30
23
|
end
|
31
24
|
|
32
|
-
|
25
|
+
opts.on('-b', '--bind URI', 'URI to bind to (tcp://, unix://, ssl://)') do |val|
|
26
|
+
puma_args += ['--bind', val]
|
27
|
+
end
|
33
28
|
|
34
|
-
opts.
|
35
|
-
|
29
|
+
opts.on('--pidfile PATH', 'Use PATH as a pidfile') do |val|
|
30
|
+
puma_args += ['--pidfile', val]
|
31
|
+
end
|
36
32
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
33
|
+
opts.on('--daemon', 'Daemonize the server into the background') do |val|
|
34
|
+
puma_args << '--daemon'
|
35
|
+
end
|
36
|
+
|
37
|
+
opts.on('-e', '--environment ENVIRONMENT', 'The environment to use') do |val|
|
38
|
+
puma_args += ['--environment', val]
|
39
|
+
end
|
44
40
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
ARGV << '--help'
|
41
|
+
opts.separator "\nResource Options:\n\n"
|
42
|
+
|
43
|
+
switcher.bind(opts, switcher_opts)
|
49
44
|
end
|
50
45
|
|
46
|
+
option_parser.parse!(ARGV)
|
47
|
+
|
51
48
|
switcher.install(switcher_opts)
|
52
49
|
|
53
|
-
Puma::CLI.new(
|
50
|
+
Puma::CLI.new(puma_args).run
|