rubrowser 2.7.0 → 2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +4 -0
- data/.rubrowser +1 -1
- data/.travis.yml +0 -2
- data/Gemfile.lock +46 -38
- data/bin/rubrowser +5 -1
- data/lib/rubrowser/channel.rb +1 -1
- data/lib/rubrowser/connection.rb +1 -1
- data/lib/rubrowser/data.rb +1 -1
- data/lib/rubrowser/monitor.rb +1 -2
- data/lib/rubrowser/parser/definition/base.rb +4 -0
- data/lib/rubrowser/parser/relation/base.rb +1 -1
- data/lib/rubrowser/renderer.rb +6 -1
- data/lib/rubrowser/server.rb +3 -3
- data/lib/rubrowser/trace.rb +1 -1
- data/lib/rubrowser/version.rb +1 -1
- data/readme.md +11 -3
- data/rubrowser.gemspec +6 -6
- metadata +18 -25
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c46aa99d8a0d5732fc544caf791cb56bd9ff618116f11d561eac0f41be588724
|
|
4
|
+
data.tar.gz: 5886af6d77a53e74e2b278cd2c114c8e81e7b54061056dfef824945646e670ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a50e26cc079557c517adff17d0b4c680ebc9ce0a1d1f46dfbd61c9bae84e1e0957e25d1b7124255154051981ab74b36878fcb769c266254a549359f6ca799c6b
|
|
7
|
+
data.tar.gz: 21b22f8458af0f16e19fa391a7d99b9e5a50c4fb8a049d38c0a80f677ec70862b0f715c6ccf7844ab6eb2ff8f104df7e7be21baa7551714aefb860b6a0ea4f82
|
data/.rubocop.yml
CHANGED
data/.rubrowser
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"id":"Rubrowser::Data","x":905.0088057752334,"y":437.04147016200284},{"id":"Rubrowser","x":712.6220053486966,"y":770.3251873644217},{"id":"Rubrowser::
|
|
1
|
+
[{"id":"A","x":3145.151252107328,"y":1255.7202242818169},{"id":"B","x":3041.815436574058,"y":1133.5156582815155},{"id":"C","x":3199.274701857475,"y":1105.1153162475819},{"id":"ClassWithOneClassDependency","x":1557.2872222716092,"y":-43.47687773940923},{"id":"ModuleWithNoRelations","x":1306.9528557451522,"y":1102.2650375990502},{"id":"ClassWithOneIncludedMixin","x":1498.1264029065396,"y":1151.463703990889},{"id":"ClassWithOneExtendedMixin","x":1505.8925222231119,"y":1066.3427953527182},{"id":"ModuleWithOneClassDependency","x":1506.2730755201367,"y":108.22508398850451},{"id":"ClassWithNoRelations","x":1400.4239271808685,"y":-11.760907506717134},{"id":"Rubrowser::Data","x":905.0088057752334,"y":437.04147016200284},{"id":"Rubrowser","x":712.6220053486966,"y":770.3251873644217},{"id":"Rubrowser::Trace","x":197.20494882540459,"y":735.0751347963624},{"id":"Rubrowser::Monitor","x":430.7305845891392,"y":680.3256207864202},{"id":"Graph","x":1115.7752854976002,"y":436.6211350242928},{"id":"Rubrowser::Connection","x":4.873283667279907,"y":680.4067753374231},{"id":"Rubrowser::Channel","x":1366.414402671432,"y":185.96446885474367},{"id":"Rubrowser::Renderer","x":905.2158605930458,"y":560.8807631671766},{"id":"Rubrowser::Server","x":208.96464998862217,"y":631.2323207047698},{"id":"Rubrowser::Formatter::JSON","x":1114.4368770370438,"y":560.0312580369882},{"id":"Rubrowser::Formatter","x":1113.6584254066838,"y":601.6487084046246},{"id":"Rubrowser::Parser::Definition::Module","x":188.36911863082037,"y":324.35744429623855},{"id":"Rubrowser::Parser::Definition","x":-191.1839782278871,"y":318.6377197576412},{"id":"Rubrowser::Parser","x":713.688310910547,"y":660.9646559993857},{"id":"Rubrowser::Parser::Definition::Base","x":-8.218934126737395,"y":322.74585638398685},{"id":"Rubrowser::Parser::Definition::Class","x":186.15033111747857,"y":246.30753307276427},{"id":"Rubrowser::Parser::Relation::Base","x":185.12905462589924,"y":402.5519743127113},{"id":"Rubrowser::Parser::Relation","x":187.0097719718301,"y":461.8654698954514},{"id":"Rubrowser::Parser::Factory","x":788.0050388528484,"y":325.70343641742613},{"id":"Rubrowser::Parser::File::Builder","x":506.8969046429671,"y":189.48025894394402},{"id":"Rubrowser::Parser::File","x":505.82216034587793,"y":322.6733725221146},{"id":"Rubrowser::Parser::Directory","x":786.9998045114313,"y":239.74214301898786}]
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,63 +1,71 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
rubrowser (2.
|
|
4
|
+
rubrowser (2.10)
|
|
5
5
|
litecable
|
|
6
|
-
parser
|
|
6
|
+
parser
|
|
7
7
|
puma
|
|
8
8
|
websocket
|
|
9
9
|
|
|
10
10
|
GEM
|
|
11
11
|
remote: https://rubygems.org/
|
|
12
12
|
specs:
|
|
13
|
-
anyway_config (1.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
rspec-
|
|
33
|
-
|
|
13
|
+
anyway_config (2.1.0)
|
|
14
|
+
ruby-next-core (>= 0.11.0)
|
|
15
|
+
ast (2.4.2)
|
|
16
|
+
byebug (11.1.3)
|
|
17
|
+
diff-lcs (1.4.4)
|
|
18
|
+
litecable (0.7.1)
|
|
19
|
+
anyway_config (>= 1.0)
|
|
20
|
+
nio4r (2.5.7)
|
|
21
|
+
parallel (1.20.1)
|
|
22
|
+
parser (3.0.1.0)
|
|
23
|
+
ast (~> 2.4.1)
|
|
24
|
+
puma (5.2.2)
|
|
25
|
+
nio4r (~> 2.0)
|
|
26
|
+
rainbow (3.0.0)
|
|
27
|
+
rake (13.0.3)
|
|
28
|
+
regexp_parser (2.1.1)
|
|
29
|
+
rexml (3.2.5)
|
|
30
|
+
rspec (3.10.0)
|
|
31
|
+
rspec-core (~> 3.10.0)
|
|
32
|
+
rspec-expectations (~> 3.10.0)
|
|
33
|
+
rspec-mocks (~> 3.10.0)
|
|
34
|
+
rspec-core (3.10.1)
|
|
35
|
+
rspec-support (~> 3.10.0)
|
|
36
|
+
rspec-expectations (3.10.1)
|
|
34
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
35
|
-
rspec-support (~> 3.
|
|
36
|
-
rspec-mocks (3.
|
|
38
|
+
rspec-support (~> 3.10.0)
|
|
39
|
+
rspec-mocks (3.10.2)
|
|
37
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
38
|
-
rspec-support (~> 3.
|
|
39
|
-
rspec-support (3.
|
|
40
|
-
rubocop (
|
|
41
|
+
rspec-support (~> 3.10.0)
|
|
42
|
+
rspec-support (3.10.2)
|
|
43
|
+
rubocop (1.13.0)
|
|
41
44
|
parallel (~> 1.10)
|
|
42
|
-
parser (>=
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
parser (>= 3.0.0.0)
|
|
46
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
47
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
48
|
+
rexml
|
|
49
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
|
45
50
|
ruby-progressbar (~> 1.7)
|
|
46
|
-
unicode-display_width (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
52
|
+
rubocop-ast (1.4.1)
|
|
53
|
+
parser (>= 2.7.1.5)
|
|
54
|
+
ruby-next-core (0.12.0)
|
|
55
|
+
ruby-progressbar (1.11.0)
|
|
56
|
+
unicode-display_width (2.0.0)
|
|
57
|
+
websocket (1.2.9)
|
|
50
58
|
|
|
51
59
|
PLATFORMS
|
|
52
60
|
ruby
|
|
53
61
|
|
|
54
62
|
DEPENDENCIES
|
|
55
|
-
bundler
|
|
63
|
+
bundler
|
|
56
64
|
byebug
|
|
57
|
-
rake
|
|
65
|
+
rake
|
|
58
66
|
rspec
|
|
59
67
|
rubocop
|
|
60
68
|
rubrowser!
|
|
61
69
|
|
|
62
70
|
BUNDLED WITH
|
|
63
|
-
1.
|
|
71
|
+
2.1.4
|
data/bin/rubrowser
CHANGED
|
@@ -12,7 +12,7 @@ options = {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
OptionParser.new do |opts|
|
|
15
|
-
opts.banner = "Usage: #{__FILE__} [options] [file] ..."
|
|
15
|
+
opts.banner = "Usage: #{File.basename(__FILE__)} [options] [file] ..."
|
|
16
16
|
|
|
17
17
|
opts.on(
|
|
18
18
|
'-oFILE',
|
|
@@ -36,6 +36,10 @@ OptionParser.new do |opts|
|
|
|
36
36
|
options[:toolbox] = false
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
+
opts.on('-j', '--json', 'Do export data as JSON instead of HTML') do
|
|
40
|
+
options[:json] = true
|
|
41
|
+
end
|
|
42
|
+
|
|
39
43
|
opts.on('-v', '--version', 'Print Rubrowser version') do
|
|
40
44
|
puts "Rubrowser #{Rubrowser::VERSION}"
|
|
41
45
|
exit
|
data/lib/rubrowser/channel.rb
CHANGED
data/lib/rubrowser/connection.rb
CHANGED
data/lib/rubrowser/data.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Rubrowser
|
|
|
15
15
|
def parse
|
|
16
16
|
parsers.each(&:parse)
|
|
17
17
|
|
|
18
|
-
@definitions ||= parsers.map(&:definitions).reduce(:+).to_a
|
|
18
|
+
@definitions ||= parsers.map(&:definitions).reduce(:+).sort{|a,b| b<=>a}.to_a
|
|
19
19
|
@relations ||= parsers.map(&:relations).reduce(:+).to_a
|
|
20
20
|
|
|
21
21
|
mark_circular_dependencies
|
data/lib/rubrowser/monitor.rb
CHANGED
data/lib/rubrowser/renderer.rb
CHANGED
|
@@ -12,7 +12,11 @@ module Rubrowser
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def call
|
|
15
|
-
|
|
15
|
+
if @json
|
|
16
|
+
output.write(data)
|
|
17
|
+
else
|
|
18
|
+
output.write(erb(:index))
|
|
19
|
+
end
|
|
16
20
|
end
|
|
17
21
|
|
|
18
22
|
private
|
|
@@ -27,6 +31,7 @@ module Rubrowser
|
|
|
27
31
|
@server = options[:server]
|
|
28
32
|
@files = options[:files]
|
|
29
33
|
@toolbox = options[:toolbox]
|
|
34
|
+
@json = !!options[:json]
|
|
30
35
|
end
|
|
31
36
|
|
|
32
37
|
def output_file(path)
|
data/lib/rubrowser/server.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require 'lite_cable'
|
|
2
2
|
require 'lite_cable/server'
|
|
3
|
-
require 'puma
|
|
3
|
+
require 'puma'
|
|
4
4
|
require 'rubrowser/connection'
|
|
5
5
|
|
|
6
6
|
module Rubrowser
|
|
@@ -33,8 +33,8 @@ module Rubrowser
|
|
|
33
33
|
def rack_app
|
|
34
34
|
@app ||= Rack::Builder.new do
|
|
35
35
|
map '/' do
|
|
36
|
-
use LiteCable::Server::Middleware, connection_class:
|
|
37
|
-
run
|
|
36
|
+
use LiteCable::Server::Middleware, connection_class: Connection
|
|
37
|
+
run(proc { |_| [200, { 'Content-Type' => 'text/plain' }, ['OK']] })
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
end
|
data/lib/rubrowser/trace.rb
CHANGED
data/lib/rubrowser/version.rb
CHANGED
data/readme.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Rubrowser
|
|
1
|
+
# Rubrowser (Ruby Browser)
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/rb/rubrowser)
|
|
4
4
|
[](https://travis-ci.org/emad-elsaid/rubrowser)
|
|
@@ -17,7 +17,7 @@ documentation
|
|
|
17
17
|
|
|
18
18
|
this project is so small that the visualization looks like so
|
|
19
19
|
|
|
20
|
-

|
|
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
|
|
@@ -51,11 +51,12 @@ gem install rubrowser
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
```
|
|
54
|
-
Usage:
|
|
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
57
|
-s, --server=SERVER:PORT rubrowser server for execution monitoring
|
|
58
58
|
-T, --no-toolbox Don't display toolbox on the page
|
|
59
|
+
-j, --json Do export data as JSON instead of HTML
|
|
59
60
|
-v, --version Print Rubrowser version
|
|
60
61
|
-h, --help Prints this help
|
|
61
62
|
```
|
|
@@ -119,6 +120,13 @@ rubrowser -l .rubrowser
|
|
|
119
120
|
So that in the future probably rubrowser can pick the file automatically, if you
|
|
120
121
|
follow that naming, your project will be ready in that case.
|
|
121
122
|
|
|
123
|
+
## Export data for use in external tools
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
rubrowser -j|jq '.'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
|
|
122
130
|
## Features
|
|
123
131
|
|
|
124
132
|
* trace your execution in realtime on the graph
|
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,13 +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'
|
|
22
|
+
s.add_runtime_dependency 'parser'
|
|
23
23
|
s.add_runtime_dependency 'puma'
|
|
24
24
|
s.add_runtime_dependency 'litecable'
|
|
25
25
|
s.add_runtime_dependency 'websocket'
|
|
26
26
|
|
|
27
|
-
s.add_development_dependency 'bundler'
|
|
28
|
-
s.add_development_dependency 'rake'
|
|
27
|
+
s.add_development_dependency 'bundler'
|
|
28
|
+
s.add_development_dependency 'rake'
|
|
29
29
|
s.add_development_dependency 'byebug'
|
|
30
30
|
s.add_development_dependency 'rubocop'
|
|
31
31
|
s.add_development_dependency 'rspec'
|
metadata
CHANGED
|
@@ -1,35 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rubrowser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: '2.10'
|
|
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: 2021-04-23 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
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.3'
|
|
20
17
|
- - ">="
|
|
21
18
|
- !ruby/object:Gem::Version
|
|
22
|
-
version:
|
|
19
|
+
version: '0'
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
|
-
- - "~>"
|
|
28
|
-
- !ruby/object:Gem::Version
|
|
29
|
-
version: '2.3'
|
|
30
24
|
- - ">="
|
|
31
25
|
- !ruby/object:Gem::Version
|
|
32
|
-
version:
|
|
26
|
+
version: '0'
|
|
33
27
|
- !ruby/object:Gem::Dependency
|
|
34
28
|
name: puma
|
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -76,30 +70,30 @@ dependencies:
|
|
|
76
70
|
name: bundler
|
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
|
78
72
|
requirements:
|
|
79
|
-
- - "
|
|
73
|
+
- - ">="
|
|
80
74
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: '
|
|
75
|
+
version: '0'
|
|
82
76
|
type: :development
|
|
83
77
|
prerelease: false
|
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
85
79
|
requirements:
|
|
86
|
-
- - "
|
|
80
|
+
- - ">="
|
|
87
81
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: '
|
|
82
|
+
version: '0'
|
|
89
83
|
- !ruby/object:Gem::Dependency
|
|
90
84
|
name: rake
|
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|
|
92
86
|
requirements:
|
|
93
|
-
- - "
|
|
87
|
+
- - ">="
|
|
94
88
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: '
|
|
89
|
+
version: '0'
|
|
96
90
|
type: :development
|
|
97
91
|
prerelease: false
|
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
93
|
requirements:
|
|
100
|
-
- - "
|
|
94
|
+
- - ">="
|
|
101
95
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
96
|
+
version: '0'
|
|
103
97
|
- !ruby/object:Gem::Dependency
|
|
104
98
|
name: byebug
|
|
105
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -144,7 +138,7 @@ dependencies:
|
|
|
144
138
|
version: '0'
|
|
145
139
|
description: A ruby interactive dependency graph visualizer
|
|
146
140
|
email:
|
|
147
|
-
-
|
|
141
|
+
- emad.elsaid.hamed@gmail.com
|
|
148
142
|
executables:
|
|
149
143
|
- rubrowser
|
|
150
144
|
extensions: []
|
|
@@ -189,11 +183,11 @@ files:
|
|
|
189
183
|
- rubrowser.gemspec
|
|
190
184
|
- views/index.erb
|
|
191
185
|
- views/toolbox.erb
|
|
192
|
-
homepage: https://github.com/
|
|
186
|
+
homepage: https://github.com/emad-elsaid/rubrowser
|
|
193
187
|
licenses:
|
|
194
188
|
- MIT
|
|
195
189
|
metadata: {}
|
|
196
|
-
post_install_message:
|
|
190
|
+
post_install_message:
|
|
197
191
|
rdoc_options: []
|
|
198
192
|
require_paths:
|
|
199
193
|
- lib
|
|
@@ -208,9 +202,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
208
202
|
- !ruby/object:Gem::Version
|
|
209
203
|
version: '0'
|
|
210
204
|
requirements: []
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
signing_key:
|
|
205
|
+
rubygems_version: 3.1.2
|
|
206
|
+
signing_key:
|
|
214
207
|
specification_version: 4
|
|
215
208
|
summary: A ruby interactive dependency graph visualizer
|
|
216
209
|
test_files: []
|