inferno_core 0.4.0 → 0.4.1.pre2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/inferno/apps/web/router.rb +14 -3
- data/lib/inferno/config/boot/web.rb +3 -0
- data/lib/inferno/public/bundle.js +2 -2
- data/lib/inferno/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0aa38790217e6f50f65813af1eb2f4eb166b0fdcb1072c4abb722ba1348d852a
|
4
|
+
data.tar.gz: 5ecc8a350a4f2d036c099d18b477abc4e77d2ae90f8d90801cb14c9f49dc6f49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f82cb94c8a774d9ffc5fe1ae275adabc5af1aa8b784473bad100708350b48d04b371e6b26e61a4d195a36b1729285ec286da68b38b01baa1c60604e57fba1d2e
|
7
|
+
data.tar.gz: db8ce967f8bea92d0f357f989d862ca78c8922367f9c7bdec0cf9611fe473da9d1cf89341f96e837783f74b00b9842bfa7a625206436c649e3197aacfe061d14
|
@@ -7,10 +7,9 @@ module Inferno
|
|
7
7
|
client_page = ERB.new(File.read(File.join(Inferno::Application.root, 'lib', 'inferno', 'apps', 'web',
|
8
8
|
'index.html.erb'))).result
|
9
9
|
|
10
|
-
base_path = Application['base_path']
|
11
|
-
base_path = "/#{base_path.delete_prefix('/')}" if base_path.present?
|
10
|
+
base_path = Application['base_path']&.delete_prefix('/')
|
12
11
|
|
13
|
-
|
12
|
+
route_block = proc do
|
14
13
|
scope 'api' do
|
15
14
|
scope 'test_runs' do
|
16
15
|
post '/', to: Inferno::Web::Controllers::TestRuns::Create, as: :create
|
@@ -72,5 +71,17 @@ module Inferno
|
|
72
71
|
get suite_path, to: ->(_env) { [200, {}, [client_page]] }
|
73
72
|
end
|
74
73
|
end
|
74
|
+
|
75
|
+
Router = # rubocop:disable Naming/ConstantName
|
76
|
+
if base_path.present?
|
77
|
+
Hanami::Router.new do
|
78
|
+
scope("#{base_path}/") do
|
79
|
+
get '/', to: ->(_env) { [200, { 'Content-Type' => 'text/html' }, [client_page]] }
|
80
|
+
end
|
81
|
+
scope(base_path, &route_block)
|
82
|
+
end
|
83
|
+
else
|
84
|
+
Hanami::Router.new(&route_block)
|
85
|
+
end
|
75
86
|
end
|
76
87
|
end
|