rubrowser 2.7.1 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 91d410f73b3d150b46b273288aada88f725b5930
4
- data.tar.gz: 68df2480d4fee326331fa0780148a8b9990f9dd3
2
+ SHA256:
3
+ metadata.gz: 0cd72a9befbe0f68dd5f621293bada3019cb1b90485c0c0ad5fc1d1cb65ce4d2
4
+ data.tar.gz: 64acf277b54af3aea188f3b20d1459993291699384035823c04a060a5a585ab4
5
5
  SHA512:
6
- metadata.gz: c41ba1c8999c8d726d469133ec071824d9fe4dde3b400d2371fbb7f3c38201c5c1e897290984e852887cea026d344bad659fcf8f0b52bc03d8c212fb9d6e4c6b
7
- data.tar.gz: 9b1ee6d91f5174368e457d699ba2ebae56a3d81039ca411412c99868d53e9938d62ff5b3e8e7b090963e06c4a45c64debca59b5a5dc9f727cff4a32bd4f7a623
6
+ metadata.gz: '06697adf5a5ec51981d10b106c97e355450ce5b42f7dc8b7f9417c1ffdec8ecb817b0a449e1a84f9bf83ba8f800d5267a46abf3b50667b113e050a951dcb70f1'
7
+ data.tar.gz: 3e3ad492e2819c763603163dc21eef80819b9a59ecbf5acc990445e8a5eb15de36071c99e0d606ed23af8af5ad2d7c21a4ff08743fdadbc0f1707acd35edaa81
@@ -5,3 +5,7 @@ Style/Documentation:
5
5
  Enabled: false
6
6
  Style/FrozenStringLiteralComment:
7
7
  Enabled: false
8
+ Style/GlobalVars:
9
+ Enabled: false
10
+ Metrics/BlockLength:
11
+ Enabled: false
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::Formatter::JSON","x":1114.4368770370438,"y":560.0312580369882},{"id":"Rubrowser::Formatter","x":1113.6584254066838,"y":601.6487084046246},{"id":"Graph","x":1115.7752854976002,"y":436.6211350242928},{"id":"Rubrowser::Parser::Definition::Base","x":-8.218934126737395,"y":322.74585638398685},{"id":"Rubrowser::Parser::Definition","x":-191.1839782278871,"y":318.6377197576412},{"id":"Rubrowser::Parser","x":713.688310910547,"y":660.9646559993857},{"id":"Rubrowser::Parser::Definition::Class","x":186.15033111747857,"y":246.30753307276427},{"id":"Rubrowser::Parser::Definition::Module","x":188.36911863082037,"y":324.35744429623855},{"id":"Rubrowser::Parser::Directory","x":786.9998045114313,"y":239.74214301898786},{"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::Relation::Base","x":185.12905462589924,"y":402.5519743127113},{"id":"Rubrowser::Parser::Relation","x":187.0097719718301,"y":461.8654698954514},{"id":"Rubrowser::Renderer","x":905.2158605930458,"y":560.8807631671766}]
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}]
@@ -1,7 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0
4
- - 2.1
5
3
  - 2.2
6
4
  - 2.3
7
5
  - 2.4
@@ -16,14 +16,16 @@ GEM
16
16
  diff-lcs (1.3)
17
17
  litecable (0.5.0)
18
18
  anyway_config (~> 1.0)
19
+ nio4r (2.5.2)
19
20
  parallel (1.12.0)
20
21
  parser (2.4.0.0)
21
22
  ast (~> 2.2)
22
23
  powerpack (0.1.1)
23
- puma (3.11.3)
24
+ puma (4.3.3)
25
+ nio4r (~> 2.0)
24
26
  rainbow (2.2.2)
25
27
  rake
26
- rake (10.4.2)
28
+ rake (13.0.1)
27
29
  rspec (3.6.0)
28
30
  rspec-core (~> 3.6.0)
29
31
  rspec-expectations (~> 3.6.0)
@@ -54,7 +56,7 @@ PLATFORMS
54
56
  DEPENDENCIES
55
57
  bundler (~> 1.14)
56
58
  byebug
57
- rake (~> 10.0)
59
+ rake (~> 13.0)
58
60
  rspec
59
61
  rubocop
60
62
  rubrowser!
@@ -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
@@ -3,7 +3,7 @@ module Rubrowser
3
3
  identifier :classes
4
4
 
5
5
  def subscribed
6
- stream_from "classes"
6
+ stream_from 'classes'
7
7
  end
8
8
  end
9
9
  end
@@ -5,7 +5,7 @@ module Rubrowser
5
5
  identified_by :id
6
6
 
7
7
  def connect
8
- @id = rand(100000)
8
+ @id = rand(100_000)
9
9
  self.class.initiate_reader
10
10
  end
11
11
 
@@ -1,12 +1,11 @@
1
1
  require 'rubrowser/trace'
2
2
  require 'rubrowser/server'
3
3
 
4
-
5
4
  module Rubrowser
6
5
  module Monitor
7
6
  module_function
8
7
 
9
- def run(path: "", port: 8080)
8
+ def run(path: '', port: 8080)
10
9
  $rd, $wr = IO.pipe
11
10
 
12
11
  if fork
@@ -12,7 +12,11 @@ module Rubrowser
12
12
  end
13
13
 
14
14
  def call
15
- output.write(erb(:index))
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)
@@ -34,8 +34,8 @@ module Rubrowser
34
34
  def rack_app
35
35
  @app ||= Rack::Builder.new do
36
36
  map '/' do
37
- use LiteCable::Server::Middleware, connection_class: Rubrowser::Connection
38
- run proc { |_| [200, { 'Content-Type' => 'text/plain' }, ['OK']] }
37
+ use LiteCable::Server::Middleware, connection_class: Connection
38
+ run(proc { |_| [200, { 'Content-Type' => 'text/plain' }, ['OK']] })
39
39
  end
40
40
  end
41
41
  end
@@ -1,6 +1,6 @@
1
1
  module Rubrowser
2
2
  class Trace
3
- def initialize(path: "")
3
+ def initialize(path: '')
4
4
  @path = path
5
5
  end
6
6
 
@@ -1,3 +1,3 @@
1
1
  module Rubrowser
2
- VERSION = '2.7.1'.freeze
2
+ VERSION = '2.8.0'.freeze
3
3
  end
data/readme.md CHANGED
@@ -1,4 +1,4 @@
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)
@@ -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/2tWrl2s.png)
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
@@ -51,11 +51,12 @@ gem install rubrowser
51
51
 
52
52
 
53
53
  ```
54
- Usage: /home/emad/code/rubrowser/bin/rubrowser [options] [file] ...
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
@@ -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 = ['blazeeboy@gmail.com']
10
- s.homepage = 'https://github.com/blazeeboy/rubrowser'
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'
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.add_runtime_dependency 'websocket'
26
26
 
27
27
  s.add_development_dependency 'bundler', '~> 1.14'
28
- s.add_development_dependency 'rake', '~> 10.0'
28
+ s.add_development_dependency 'rake', '~> 13.0'
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,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubrowser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emad Elsaid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-08 00:00:00.000000000 Z
11
+ date: 2020-04-30 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
19
  version: 2.3.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.3'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '2.3'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 2.3.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.3'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: puma
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -92,14 +92,14 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '10.0'
95
+ version: '13.0'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '10.0'
102
+ version: '13.0'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: byebug
105
105
  requirement: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ dependencies:
144
144
  version: '0'
145
145
  description: A ruby interactive dependency graph visualizer
146
146
  email:
147
- - blazeeboy@gmail.com
147
+ - emad.elsaid.hamed@gmail.com
148
148
  executables:
149
149
  - rubrowser
150
150
  extensions: []
@@ -189,7 +189,7 @@ files:
189
189
  - rubrowser.gemspec
190
190
  - views/index.erb
191
191
  - views/toolbox.erb
192
- homepage: https://github.com/blazeeboy/rubrowser
192
+ homepage: https://github.com/emad-elsaid/rubrowser
193
193
  licenses:
194
194
  - MIT
195
195
  metadata: {}
@@ -208,8 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubyforge_project:
212
- rubygems_version: 2.6.10
211
+ rubygems_version: 3.0.3
213
212
  signing_key:
214
213
  specification_version: 4
215
214
  summary: A ruby interactive dependency graph visualizer