opener-polarity-tagger 2.2.2 → 2.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: d29f0562ff7c7fe971573af3db79e9b08d009819
4
- data.tar.gz: 1f9b549e23ae7c3575cad7cf0e25fb0b5e859f6d
3
+ metadata.gz: 04f08fc45a527701ea10344f00ab966fddb560b7
4
+ data.tar.gz: 0835c475a48cc8b56825c3429f43ea83c9b3b9b3
5
5
  SHA512:
6
- metadata.gz: 2eabad947159c48811d7d594859a992303b7a45229fbad4210cd189da2e394e98b7b28f5350c18134e37d8f10fb372f68c67bbb2baa284dd4edd1d0fff47e0fe
7
- data.tar.gz: 78d621ce9a6a1f6d3379d49286175e4329b03de948438916fc582795510db79ba11e5abdcf708e6db3bf448767ca2a4c02cf2affc9547a88b65890fc8566d796
6
+ metadata.gz: 70bc84cf510877fa2a11fcb12ef343726ee04c56d7e4e01e057750e1a1aa3fb44c753048fdc8141cdb77fb0f9d2d48ebffecbc91fc95687874f2bc3891569048
7
+ data.tar.gz: 8af7b14b0f0384bb9549a8c0b86750ec24460f9ae1c34176687e43dfd18faae1c12f477fb94bf5f6229830baa539fc7ad6bde2850d4b3ee1fba01db797399665
@@ -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
- parser = OptionParser.new do |opts|
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
- show_help = true
18
+ abort option_parser.to_s
19
+ end
28
20
 
29
- puts parser
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
- switcher.bind(opts, switcher_opts)
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.separator "\nPuma Usage:\n\n"
35
- end
29
+ opts.on('--pidfile PATH', 'Use PATH as a pidfile') do |val|
30
+ puma_args += ['--pidfile', val]
31
+ end
36
32
 
37
- begin
38
- # Parse destructively so that Puma doesn't break on our custom options.
39
- parser.parse!(ARGV)
40
- rescue OptionParser::InvalidOption => error
41
- error.recover(ARGV)
42
- # Catch errors generated by Puma options and ignore them.
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
- # Trigger the Puma help message since we overwrite this option and parse
46
- # destructively.
47
- if show_help
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([rack_config] + ARGV).run
50
+ Puma::CLI.new(puma_args).run
@@ -1,5 +1,5 @@
1
1
  module Opener
2
2
  class PolarityTagger
3
- VERSION = '2.2.2'
3
+ VERSION = '2.2.3'
4
4
  end # PolarityTagger
5
5
  end # Opener
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-polarity-tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - development@olery.com