mihari 5.2.0 → 5.2.1

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
  SHA256:
3
- metadata.gz: 0c98bfd494945e88b92bbf939e9ea94d5d4161cc35ae7d7a0d01ead7a30a1f09
4
- data.tar.gz: 4794020ea3ad71fe70016030abd52063d523c7bbf7a31d9129fe8a2b76f43bc5
3
+ metadata.gz: 5ce7e22d3d54cc3e66fec62b494ce5f9def9107129513cd51803c71b8ae48b18
4
+ data.tar.gz: fd85f33a666a77a8b43d12dc3234ab2656cd843c8f7e23025c1a5f076947fbcf
5
5
  SHA512:
6
- metadata.gz: aff9062a772dd86fd202e9112d92c923c815dba5d15b83b567c8ff00a72803ece1674201daeffc2934beba54f7d9ff2e929e1d570de9fe21c503bd89c6648c13
7
- data.tar.gz: 8ab4db7d0385ac7301c158c95cba0855cc002c9e115911e497011e0705c97fdc5205a6f47e07917d867ba5270f3e4b24f80c38a407c34a2a3db717b9fd5ef732
6
+ metadata.gz: a17809e3c6f52e7d37f6df2fc92b0ad5a1d134556e6ef13cb64b3802074a44f2ecd0c2475ab632e5da0f57e7c68a44fca15f722f31124fbb9e8af512f46aa2ac
7
+ data.tar.gz: d777cac77ceeb2a98c8f37a8e001d9240403b47a1e2326a6f1bc42c3cf48e7813dd69ab2260ce5a29a34b7b9b3e0ef54fa541785f8b5dbc82b787381e549525e
@@ -13,12 +13,19 @@ module Mihari
13
13
  method_option :worker_timeout, type: :numeric, default: 60, desc: "Worker timeout value (in seconds)"
14
14
  method_option :hide_config_values, type: :boolean, default: false,
15
15
  desc: "Whether to hide config values or not"
16
+ method_option :open, type: :boolean, default: true, desc: "Whether to open the app in browser or not"
16
17
  def web
17
18
  Mihari.config.hide_config_values = options["hide_config_values"]
18
19
  # set rack env as production
19
20
  ENV["RACK_ENV"] ||= "production"
20
- Mihari::App.run!(port: options["port"], host: options["host"], threads: options["threads"],
21
- verbose: options["verbose"], worker_timeout: options["worker_timeout"])
21
+ Mihari::App.run!(
22
+ port: options["port"],
23
+ host: options["host"],
24
+ threads: options["threads"],
25
+ verbose: options["verbose"],
26
+ worker_timeout: options["worker_timeout"],
27
+ open: options["open"]
28
+ )
22
29
  end
23
30
  end
24
31
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "5.2.0"
4
+ VERSION = "5.2.1"
5
5
  end
@@ -44,7 +44,7 @@ module Mihari
44
44
  end.to_app
45
45
  end
46
46
 
47
- def run!(port: 9292, host: "localhost", threads: "0:5", verbose: false, worker_timeout: 60)
47
+ def run!(port: 9292, host: "localhost", threads: "0:5", verbose: false, worker_timeout: 60, open: true)
48
48
  url = "http://#{host}:#{port}"
49
49
 
50
50
  # set maximum number of threads to use as PARALLEL_PROCESSOR_COUNT (if it is not set)
@@ -60,7 +60,7 @@ module Mihari
60
60
  Verbose: verbose,
61
61
  worker_timeout: worker_timeout
62
62
  ) do |_|
63
- Launchy.open(url) if ENV["RACK_ENV"] != "development"
63
+ Launchy.open(url) if ENV["RACK_ENV"] != "development" && open
64
64
  rescue Launchy::CommandNotFoundError
65
65
  # ref. https://github.com/ninoseki/mihari/issues/477
66
66
  # do nothing