opener-property-tagger 2.2.1 → 2.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 085b45bdd5a5ed331d4bd1a26aa12f2fb190b868
4
- data.tar.gz: 87293fed9992e559c1e5585eaf23c50ae66207d7
3
+ metadata.gz: 82ca8f5699711207bc1d8e887283935485fbea9e
4
+ data.tar.gz: 6fd3356565e075bb6aa1090022d78c6acaf6440b
5
5
  SHA512:
6
- metadata.gz: 2984efb780e57144e170db49d09b924b96f9dd8008332d26d2728971b8b36d2e805be5d9703504bfb976cf9b09ef8ed167057d607f5776393700801b14214822
7
- data.tar.gz: 3270b38a1bffd451a4ada8251a0076553f4fd57398f70639cfca82f602586e42c55567ca4cc3a7ea79a03e6ded003a56b5251898e66069161d3050118ce8c7b6
6
+ metadata.gz: 74944c1fff030df12a81d22638e6045b6848d7527b04d1aeb04a12fc3cf4226694de371f698de7c9adb5f117a202d41c3a1406bf8aed0da5ef824644448df5db
7
+ data.tar.gz: b7748f186238dab3c8c70e35e46d279cffe7d88020aac9b377878e2fb8ef00aadc9cb1822b73a2e70bbe045cdcbaaf588b3b024a666af466b65e0d80f9e287e6
@@ -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 PropertyTagger
3
- VERSION = '2.2.1'
3
+ VERSION = '2.2.2'
4
4
  end # PropertyTagger
5
5
  end # Opener
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opener-property-tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - development@olery.com