rubrowser 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rubrowser +1 -2
- data/lib/rubrowser.rb +1 -1
- data/readme.md +19 -5
- data/rubrowser.gemspec +22 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b465f4952d44dbd2141eb12066017e16a65a2d
|
4
|
+
data.tar.gz: da121cdfe98febb25db3bc057e55d4c9a200179a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca739a897ac010919307c214e7b5c7d824f04003f7f228b5d13137ce4b2091cb24d667b9b0c2ce39a66ffee4781d4302fe8b48c1bb6be8515a195e26777b8640
|
7
|
+
data.tar.gz: 7f70f2724171b73abb3d82391da021015b1d6f235868046a204e33e50036f947dc31cb93ae28404a6d4804813cc5a6277a0a7088354fca85abfdb18b4787fd2c
|
data/bin/rubrowser
CHANGED
data/lib/rubrowser.rb
CHANGED
data/readme.md
CHANGED
@@ -1,23 +1,37 @@
|
|
1
1
|
# Rubrowser
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rubrowser.svg)](https://badge.fury.io/rb/rubrowser)
|
4
|
+
|
3
5
|
a visualizer for ruby code (rails or otherwise), it analyze your code and extract the modules definitions and used classes/modules and render all these information as a directed force graph using D3.
|
4
6
|
|
5
7
|
this project is so small that the visualization looks like so
|
6
8
|
|
7
|
-
![rubrowser visualization](http://i.imgur.com/
|
9
|
+
![rubrowser visualization](http://i.imgur.com/O2tbOJZ.png)
|
8
10
|
|
11
|
+
the idea is that the project opens every `.rb` file and parse it with `parser` gem then list all modules and classes definitions, and all constants that are listed inside this module/class and link them together, there are couple things you need to keep in mind:
|
9
12
|
|
10
|
-
|
13
|
+
* if your file doesn't have a valid ruby syntax it won't be parsed and will cause the gem to stop
|
14
|
+
* if you reference a class that is not defined in your project it won't be in the graph, we only display the graph of classes/modules you defined
|
15
|
+
* the server analyze your code once upon the script starts if you changed your code you'll have to restart rubrowser
|
16
|
+
* it statically analyze the code so meta programming is out of question in here
|
17
|
+
* rails associations are meta programming to forget it :smile:
|
11
18
|
|
12
|
-
|
19
|
+
## Usage
|
13
20
|
|
14
21
|
```
|
15
|
-
|
16
|
-
|
22
|
+
gem install rubrowser
|
23
|
+
rubrowser /path/to/project/or/file
|
17
24
|
```
|
18
25
|
|
19
26
|
it'll analyze the project and open port 9000, so you can access the graph from `localhost:9000`
|
20
27
|
|
28
|
+
## Features
|
29
|
+
|
30
|
+
* interactive graph, you can pull any node to fix it to some position
|
31
|
+
* to release node double click on it
|
32
|
+
* zoom and pan with mouse or touch pad
|
33
|
+
|
34
|
+
|
21
35
|
## Tests?
|
22
36
|
|
23
37
|
what test? :D
|
data/rubrowser.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
2
|
+
require 'rubrowser'
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'rubrowser'
|
6
|
+
s.version = Rubrowser::VERSION
|
7
|
+
s.authors = ['Emad Elsaid']
|
8
|
+
s.email = ['blazeeboy@gmail.com']
|
9
|
+
s.homepage = 'https://github.com/blazeeboy/rubrowser'
|
10
|
+
s.summary = 'a ruby code dependency graph interactive visualizer'
|
11
|
+
s.description = 'a ruby code dependency graph interactive visualizer'
|
12
|
+
s.license = 'MIT'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
15
|
+
s.require_paths = ['../lib']
|
16
|
+
s.executables << 'rubrowser'
|
17
|
+
|
18
|
+
s.add_runtime_dependency 'sinatra', '~> 1.4', '>= 1.4.0'
|
19
|
+
s.add_runtime_dependency 'parser', '~> 2.3', '>= 2.3.0'
|
20
|
+
s.add_runtime_dependency 'parallel', '~> 1.9', '>= 1.9.0'
|
21
|
+
s.add_runtime_dependency 'haml', '~> 4.0', '>= 4.0.0'
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubrowser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emad Elsaid
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- public/javascript/d3.js
|
116
116
|
- public/javascript/jquery.js
|
117
117
|
- readme.md
|
118
|
+
- rubrowser.gemspec
|
118
119
|
- views/index.haml
|
119
120
|
homepage: https://github.com/blazeeboy/rubrowser
|
120
121
|
licenses:
|