rubrowser 2.5.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.rubrowser +1 -1
- data/.travis.yml +6 -0
- data/Gemfile.lock +49 -33
- data/bin/rubrowser +23 -9
- data/lib/rubrowser.rb +1 -0
- data/lib/rubrowser/channel.rb +9 -0
- data/lib/rubrowser/connection.rb +20 -0
- data/lib/rubrowser/monitor.rb +21 -0
- data/lib/rubrowser/renderer.rb +8 -2
- data/lib/rubrowser/server.rb +43 -0
- data/lib/rubrowser/trace.rb +21 -0
- data/lib/rubrowser/version.rb +1 -1
- data/public/css/application.css +37 -10
- data/public/javascript/websocket.js +613 -0
- data/readme.md +37 -3
- data/rubrowser.gemspec +10 -6
- data/views/index.erb +7 -0
- data/views/toolbox.erb +2 -6
- metadata +65 -23
data/readme.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# Rubrowser
|
1
|
+
# Rubrowser (Ruby Browser)
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/rubrowser.svg)](https://badge.fury.io/rb/rubrowser)
|
4
|
-
|
4
|
+
[![Build Status](https://travis-ci.org/emad-elsaid/rubrowser.svg?branch=master)](https://travis-ci.org/emad-elsaid/rubrowser)
|
5
5
|
|
6
6
|
|
7
7
|
a visualizer for ruby code (rails or otherwise), it analyze your code and
|
@@ -17,7 +17,7 @@ documentation
|
|
17
17
|
|
18
18
|
this project is so small that the visualization looks like so
|
19
19
|
|
20
|
-
![rubrowser visualization](https://i.imgur.com/
|
20
|
+
![rubrowser visualization](https://i.imgur.com/zKjc7G5.png)
|
21
21
|
|
22
22
|
the idea is that the project opens every `.rb` file and parse it with `parser`
|
23
23
|
gem then list all modules and classes definitions, and all constants that are
|
@@ -54,7 +54,9 @@ gem install rubrowser
|
|
54
54
|
Usage: rubrowser [options] [file] ...
|
55
55
|
-o, --output=FILE output file page, if not specified output will be written to stdout
|
56
56
|
-l, --layout=FILE layout file to apply on the resulting graph
|
57
|
+
-s, --server=SERVER:PORT rubrowser server for execution monitoring
|
57
58
|
-T, --no-toolbox Don't display toolbox on the page
|
59
|
+
-j, --json Do export data as JSON instead of HTML
|
58
60
|
-v, --version Print Rubrowser version
|
59
61
|
-h, --help Prints this help
|
60
62
|
```
|
@@ -71,6 +73,30 @@ it to a file, and open it in your browser
|
|
71
73
|
rubrowser > output.html
|
72
74
|
```
|
73
75
|
|
76
|
+
## Monitoring your application execution
|
77
|
+
|
78
|
+
Add rubrowser to your ruby project `Gemfile`
|
79
|
+
```
|
80
|
+
gem 'rubrowser'
|
81
|
+
```
|
82
|
+
|
83
|
+
Add the following code before your application runs, if it's a rails project
|
84
|
+
this should be an initializer
|
85
|
+
|
86
|
+
```
|
87
|
+
Rubrowser::Monitor.run(path: Rails.root.to_s, port: 8080)
|
88
|
+
```
|
89
|
+
|
90
|
+
path is your code path, and port is the execution websocket server port, the
|
91
|
+
server will open that port and announce any execution happens to the code inside
|
92
|
+
your project directory.
|
93
|
+
|
94
|
+
now generate a rubrowser HTML output that connect to your server
|
95
|
+
|
96
|
+
```
|
97
|
+
rubrowser -slocalhost:8080 > output.html
|
98
|
+
```
|
99
|
+
|
74
100
|
## Using a saved layout
|
75
101
|
|
76
102
|
When you move classes/modules in the graph to fix them in one place, then you
|
@@ -94,8 +120,16 @@ rubrowser -l .rubrowser
|
|
94
120
|
So that in the future probably rubrowser can pick the file automatically, if you
|
95
121
|
follow that naming, your project will be ready in that case.
|
96
122
|
|
123
|
+
## Export data for use in external tools
|
124
|
+
|
125
|
+
```
|
126
|
+
rubrowser -j|jq '.'
|
127
|
+
```
|
128
|
+
|
129
|
+
|
97
130
|
## Features
|
98
131
|
|
132
|
+
* trace your execution in realtime on the graph
|
99
133
|
* interactive graph, you can pull any node to fix it to some position
|
100
134
|
* to release node double click on it
|
101
135
|
* zoom and pan with mouse or touch pad
|
data/rubrowser.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
3
|
require 'rubrowser/version'
|
4
4
|
|
@@ -6,8 +6,8 @@ Gem::Specification.new do |s|
|
|
6
6
|
s.name = 'rubrowser'
|
7
7
|
s.version = Rubrowser::VERSION
|
8
8
|
s.authors = ['Emad Elsaid']
|
9
|
-
s.email = ['
|
10
|
-
s.homepage = 'https://github.com/
|
9
|
+
s.email = ['emad.elsaid.hamed@gmail.com']
|
10
|
+
s.homepage = 'https://github.com/emad-elsaid/rubrowser'
|
11
11
|
s.summary = 'A ruby interactive dependency graph visualizer'
|
12
12
|
s.description = 'A ruby interactive dependency graph visualizer'
|
13
13
|
s.license = 'MIT'
|
@@ -19,9 +19,13 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.executables = s.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
20
|
s.require_paths = ['lib']
|
21
21
|
|
22
|
-
s.add_runtime_dependency 'parser'
|
23
|
-
s.
|
24
|
-
s.
|
22
|
+
s.add_runtime_dependency 'parser'
|
23
|
+
s.add_runtime_dependency 'puma'
|
24
|
+
s.add_runtime_dependency 'litecable'
|
25
|
+
s.add_runtime_dependency 'websocket'
|
26
|
+
|
27
|
+
s.add_development_dependency 'bundler'
|
28
|
+
s.add_development_dependency 'rake'
|
25
29
|
s.add_development_dependency 'byebug'
|
26
30
|
s.add_development_dependency 'rubocop'
|
27
31
|
s.add_development_dependency 'rspec'
|
data/views/index.erb
CHANGED
@@ -26,5 +26,12 @@
|
|
26
26
|
<%= erb :toolbox %>
|
27
27
|
<script type='text/javascript'><%= file('javascript/toolbox.js') %></script>
|
28
28
|
<% end %>
|
29
|
+
|
30
|
+
<% if server %>
|
31
|
+
<script type='text/javascript'>
|
32
|
+
server = "ws://<%= server %>";
|
33
|
+
<%= file('javascript/websocket.js') %>
|
34
|
+
</script>
|
35
|
+
<% end %>
|
29
36
|
</body>
|
30
37
|
</html>
|
data/views/toolbox.erb
CHANGED
@@ -1,10 +1,4 @@
|
|
1
1
|
<div class="toolbox">
|
2
|
-
<div class="card ml-2 mt-2">
|
3
|
-
<div class="card-header">Node Details</div>
|
4
|
-
<div class="card-body" id="information_panel">
|
5
|
-
Please click on any node.
|
6
|
-
</div>
|
7
|
-
</div>
|
8
2
|
<div class="card ml-2 mt-2">
|
9
3
|
<div class="card-header">Search</div>
|
10
4
|
<div class="card-body">
|
@@ -69,3 +63,5 @@
|
|
69
63
|
</div>
|
70
64
|
</div>
|
71
65
|
</div>
|
66
|
+
|
67
|
+
<div id="information_panel" class="card"></div>
|
metadata
CHANGED
@@ -1,63 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubrowser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emad Elsaid
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
18
25
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: puma
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
20
31
|
- - ">="
|
21
32
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
33
|
+
version: '0'
|
23
34
|
type: :runtime
|
24
35
|
prerelease: false
|
25
36
|
version_requirements: !ruby/object:Gem::Requirement
|
26
37
|
requirements:
|
27
|
-
- - "
|
38
|
+
- - ">="
|
28
39
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: litecable
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
30
45
|
- - ">="
|
31
46
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: websocket
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
33
69
|
- !ruby/object:Gem::Dependency
|
34
70
|
name: bundler
|
35
71
|
requirement: !ruby/object:Gem::Requirement
|
36
72
|
requirements:
|
37
|
-
- - "
|
73
|
+
- - ">="
|
38
74
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
75
|
+
version: '0'
|
40
76
|
type: :development
|
41
77
|
prerelease: false
|
42
78
|
version_requirements: !ruby/object:Gem::Requirement
|
43
79
|
requirements:
|
44
|
-
- - "
|
80
|
+
- - ">="
|
45
81
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
82
|
+
version: '0'
|
47
83
|
- !ruby/object:Gem::Dependency
|
48
84
|
name: rake
|
49
85
|
requirement: !ruby/object:Gem::Requirement
|
50
86
|
requirements:
|
51
|
-
- - "
|
87
|
+
- - ">="
|
52
88
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
89
|
+
version: '0'
|
54
90
|
type: :development
|
55
91
|
prerelease: false
|
56
92
|
version_requirements: !ruby/object:Gem::Requirement
|
57
93
|
requirements:
|
58
|
-
- - "
|
94
|
+
- - ">="
|
59
95
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
96
|
+
version: '0'
|
61
97
|
- !ruby/object:Gem::Dependency
|
62
98
|
name: byebug
|
63
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,7 +138,7 @@ dependencies:
|
|
102
138
|
version: '0'
|
103
139
|
description: A ruby interactive dependency graph visualizer
|
104
140
|
email:
|
105
|
-
-
|
141
|
+
- emad.elsaid.hamed@gmail.com
|
106
142
|
executables:
|
107
143
|
- rubrowser
|
108
144
|
extensions: []
|
@@ -113,6 +149,7 @@ files:
|
|
113
149
|
- ".rspec"
|
114
150
|
- ".rubocop.yml"
|
115
151
|
- ".rubrowser"
|
152
|
+
- ".travis.yml"
|
116
153
|
- Gemfile
|
117
154
|
- Gemfile.lock
|
118
155
|
- MIT-LICENSE
|
@@ -120,9 +157,12 @@ files:
|
|
120
157
|
- _config.yml
|
121
158
|
- bin/rubrowser
|
122
159
|
- lib/rubrowser.rb
|
160
|
+
- lib/rubrowser/channel.rb
|
161
|
+
- lib/rubrowser/connection.rb
|
123
162
|
- lib/rubrowser/data.rb
|
124
163
|
- lib/rubrowser/formatter/json.rb
|
125
164
|
- lib/rubrowser/graph.rb
|
165
|
+
- lib/rubrowser/monitor.rb
|
126
166
|
- lib/rubrowser/parser/definition/base.rb
|
127
167
|
- lib/rubrowser/parser/definition/class.rb
|
128
168
|
- lib/rubrowser/parser/definition/module.rb
|
@@ -132,19 +172,22 @@ files:
|
|
132
172
|
- lib/rubrowser/parser/file/builder.rb
|
133
173
|
- lib/rubrowser/parser/relation/base.rb
|
134
174
|
- lib/rubrowser/renderer.rb
|
175
|
+
- lib/rubrowser/server.rb
|
176
|
+
- lib/rubrowser/trace.rb
|
135
177
|
- lib/rubrowser/version.rb
|
136
178
|
- public/css/application.css
|
137
179
|
- public/javascript/application.js
|
138
180
|
- public/javascript/toolbox.js
|
181
|
+
- public/javascript/websocket.js
|
139
182
|
- readme.md
|
140
183
|
- rubrowser.gemspec
|
141
184
|
- views/index.erb
|
142
185
|
- views/toolbox.erb
|
143
|
-
homepage: https://github.com/
|
186
|
+
homepage: https://github.com/emad-elsaid/rubrowser
|
144
187
|
licenses:
|
145
188
|
- MIT
|
146
189
|
metadata: {}
|
147
|
-
post_install_message:
|
190
|
+
post_install_message:
|
148
191
|
rdoc_options: []
|
149
192
|
require_paths:
|
150
193
|
- lib
|
@@ -159,9 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
202
|
- !ruby/object:Gem::Version
|
160
203
|
version: '0'
|
161
204
|
requirements: []
|
162
|
-
|
163
|
-
|
164
|
-
signing_key:
|
205
|
+
rubygems_version: 3.1.2
|
206
|
+
signing_key:
|
165
207
|
specification_version: 4
|
166
208
|
summary: A ruby interactive dependency graph visualizer
|
167
209
|
test_files: []
|