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 +4 -4
- data/lib/mihari/commands/web.rb +9 -2
- data/lib/mihari/version.rb +1 -1
- data/lib/mihari/web/app.rb +2 -2
- data/lib/mihari/web/public/assets/index-cbe1734c.js +50 -0
- data/lib/mihari/web/public/assets/index-eed1bcd8.css +5 -0
- data/lib/mihari/web/public/index.html +2 -2
- data/mihari.gemspec +6 -6
- metadata +16 -16
- data/lib/mihari/web/public/assets/index-9948ee35.js +0 -50
- data/lib/mihari/web/public/assets/index-d88cc3f1.css +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce7e22d3d54cc3e66fec62b494ce5f9def9107129513cd51803c71b8ae48b18
|
4
|
+
data.tar.gz: fd85f33a666a77a8b43d12dc3234ab2656cd843c8f7e23025c1a5f076947fbcf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a17809e3c6f52e7d37f6df2fc92b0ad5a1d134556e6ef13cb64b3802074a44f2ecd0c2475ab632e5da0f57e7c68a44fca15f722f31124fbb9e8af512f46aa2ac
|
7
|
+
data.tar.gz: d777cac77ceeb2a98c8f37a8e001d9240403b47a1e2326a6f1bc42c3cf48e7813dd69ab2260ce5a29a34b7b9b3e0ef54fa541785f8b5dbc82b787381e549525e
|
data/lib/mihari/commands/web.rb
CHANGED
@@ -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!(
|
21
|
-
|
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
|
data/lib/mihari/version.rb
CHANGED
data/lib/mihari/web/app.rb
CHANGED
@@ -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
|