rorvswild 1.5.10 → 1.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/rorvswild/local.rb +2 -2
- data/lib/rorvswild/local/{local.html → local.html.erb} +1 -1
- data/lib/rorvswild/local/middleware.rb +7 -1
- data/lib/rorvswild/local/stylesheet/local.css +24 -0
- data/lib/rorvswild/rails_loader.rb +9 -10
- data/lib/rorvswild/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: 35897aa29faf0bcc0fe63db30ef4e837ce9a29fea2527b830bdd81c22f28b3b5
|
4
|
+
data.tar.gz: 8c2f951e47e9a4834ed97068651077d5672b2cc909799c240ab41e4eb7f6145d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f94a20f60b6967ded361bc37a695fe9cef4f2b79d5d63d7a4ff658189eadd351dd9e587a25950bb9fe2a3dd353a55dbf9b095cdd96ba43a276796abad589e2cb
|
7
|
+
data.tar.gz: f89fb8baf1d6db2d7d1d6af631740423402df53112c60474061fd1514744bc727f79cd4e8c07c7ddd3a98ea236723b74cffcf175593f829b022e7ac442ce4e45
|
data/README.md
CHANGED
@@ -58,6 +58,20 @@ It shows most of the requests performances insights *RoRvsWild.com* displays. **
|
|
58
58
|
|
59
59
|
*RoRvsWild Local* renders a small button in the bottom left corner of your page showing the runtime of the current request. If you click on it, you get all the profiled sections ordered by impact, which is depending on the sections average runtime and the calls count. As on RoRvsWild.com, the bottleneck is always on the top of the list.
|
60
60
|
|
61
|
+
Sometimes the widget displayed in the bottom left corner can be annoying depending on your site layout. You can change its position like in the example below with the `widget` option :
|
62
|
+
|
63
|
+
|
64
|
+
```yaml
|
65
|
+
# config/rorvswild.yml
|
66
|
+
|
67
|
+
development:
|
68
|
+
widget: top-right # Default is bottom-left
|
69
|
+
# All possition values :
|
70
|
+
# top-left, top-right, bottom-right, bottom-left, hidden
|
71
|
+
```
|
72
|
+
|
73
|
+
If you choose to hide the widget, you can still see request profilings via the following URL http://localhost:3000/rorvswild.
|
74
|
+
|
61
75
|
Be aware that the performances on your development machine may vary from the production server. Obviously because of the different hardware and database size. Also, Rails is reloading all the code in development environment and this takes quite a lot of time.
|
62
76
|
To prevent this behaviour and better match the production, turn on cache_classes in your config/environments/development.rb:
|
63
77
|
|
data/lib/rorvswild/local.rb
CHANGED
@@ -3,9 +3,9 @@ require "rorvswild/local/queue"
|
|
3
3
|
|
4
4
|
module RorVsWild
|
5
5
|
module Local
|
6
|
-
def self.start
|
6
|
+
def self.start(config = {})
|
7
7
|
Rails.application.config.middleware.unshift(RorVsWild::Local::Middleware, nil)
|
8
|
-
RorVsWild.start(queue: RorVsWild::Local::Queue.new)
|
8
|
+
RorVsWild.start(config.merge(queue: RorVsWild::Local::Queue.new))
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -56,9 +56,15 @@ module RorVsWild
|
|
56
56
|
|
57
57
|
private
|
58
58
|
|
59
|
+
def widget_css
|
60
|
+
config = RorVsWild.agent.config
|
61
|
+
config && config[:widget] && "is-#{config[:widget]}"
|
62
|
+
end
|
63
|
+
|
59
64
|
def inject_into(html)
|
60
65
|
if index = html.index("</body>")
|
61
|
-
markup = File.read(File.join(LOCAL_FOLDER, "local.html"))
|
66
|
+
markup = File.read(File.join(LOCAL_FOLDER, "local.html.erb"))
|
67
|
+
markup = ERB.new(markup).result(binding)
|
62
68
|
markup = markup.html_safe if markup.respond_to?(:html_safe)
|
63
69
|
html.insert(index, markup)
|
64
70
|
end
|
@@ -25,6 +25,30 @@
|
|
25
25
|
display: inline-block !important;
|
26
26
|
}
|
27
27
|
|
28
|
+
/************* TOGGLER POSITION OPTION(default bottom-left)**********************/
|
29
|
+
|
30
|
+
.is-top-right .rorvswild-local-toggler {
|
31
|
+
bottom: auto !important;
|
32
|
+
left: auto !important;
|
33
|
+
right: 12px !important;
|
34
|
+
top: 12px !important;
|
35
|
+
}
|
36
|
+
|
37
|
+
.is-top-left .rorvswild-local-toggler {
|
38
|
+
bottom: auto !important;
|
39
|
+
top: 12px !important;
|
40
|
+
}
|
41
|
+
|
42
|
+
.is-bottom-right .rorvswild-local-toggler {
|
43
|
+
bottom: 12px !important;
|
44
|
+
left: auto !important;
|
45
|
+
right: 12px !important;
|
46
|
+
}
|
47
|
+
|
48
|
+
.is-hidden .rorvswild-local-toggler {
|
49
|
+
display: none;
|
50
|
+
}
|
51
|
+
|
28
52
|
/********************************************/
|
29
53
|
/*************** PANEL **********************/
|
30
54
|
/********************************************/
|
@@ -10,20 +10,19 @@ module RorVsWild
|
|
10
10
|
def self.start
|
11
11
|
return if RorVsWild.agent
|
12
12
|
|
13
|
-
if (
|
14
|
-
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
if !RorVsWild.agent && Rails.env.development?
|
13
|
+
if (config = load_config) && config["api_key"]
|
14
|
+
RorVsWild.start(config)
|
15
|
+
elsif Rails.env.development?
|
20
16
|
require "rorvswild/local"
|
21
|
-
RorVsWild::Local.start
|
17
|
+
RorVsWild::Local.start(config || {})
|
22
18
|
end
|
23
19
|
end
|
24
20
|
|
25
|
-
def self.
|
26
|
-
|
21
|
+
def self.load_config
|
22
|
+
if (path = Rails.root.join("config/rorvswild.yml")).exist?
|
23
|
+
hash = YAML.load(ERB.new(path.read).result)[Rails.env]
|
24
|
+
hash && hash.deep_symbolize_keys
|
25
|
+
end
|
27
26
|
end
|
28
27
|
end
|
29
28
|
end
|
data/lib/rorvswild/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rorvswild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Bernard
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Performances and errors insights for rails developers.
|
15
15
|
email:
|
@@ -34,7 +34,7 @@ files:
|
|
34
34
|
- lib/rorvswild/local/javascript/vendor/barber.js
|
35
35
|
- lib/rorvswild/local/javascript/vendor/mustache.js
|
36
36
|
- lib/rorvswild/local/javascript/vendor/prism.js
|
37
|
-
- lib/rorvswild/local/local.html
|
37
|
+
- lib/rorvswild/local/local.html.erb
|
38
38
|
- lib/rorvswild/local/middleware.rb
|
39
39
|
- lib/rorvswild/local/queue.rb
|
40
40
|
- lib/rorvswild/local/stylesheet/local.css
|