rubrowser 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c00a8f96b4234e3126fb912dc5e16b91867db034
4
- data.tar.gz: fe569abb2aca1ef762f8dae59d02d0517ae0d268
3
+ metadata.gz: 66b465f4952d44dbd2141eb12066017e16a65a2d
4
+ data.tar.gz: da121cdfe98febb25db3bc057e55d4c9a200179a
5
5
  SHA512:
6
- metadata.gz: 57fbbf57070c4d09d6b24ed74d749f065c9bb3e6aaa713793e8f3566dae3d1187d9fec80ed5e6ddb46ae96800747febc9cb62a9168f7a2ad443f03583edd4893
7
- data.tar.gz: efdde91ea7fbeeb5d8de14c3f7ec45d36d3bbc41b90e76c039120aa4f57700bc82e7d4e2881134065cb8753bf2dfd39cf752bfe528fe9524fe71ae5717a8962c
6
+ metadata.gz: ca739a897ac010919307c214e7b5c7d824f04003f7f228b5d13137ce4b2091cb24d667b9b0c2ce39a66ffee4781d4302fe8b48c1bb6be8515a195e26777b8640
7
+ data.tar.gz: 7f70f2724171b73abb3d82391da021015b1d6f235868046a204e33e50036f947dc31cb93ae28404a6d4804813cc5a6277a0a7088354fca85abfdb18b4787fd2c
data/bin/rubrowser CHANGED
@@ -1,6 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require 'bundler/setup'
3
- Bundler.require(:default)
2
+ $LOAD_PATH.push File.expand_path('../../lib', __FILE__)
4
3
 
5
4
  require 'server'
6
5
  Rubrowser::Server.start
data/lib/rubrowser.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Rubrowser
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
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/EqyxF8F.png)
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
- ## Usage
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
- for now you can clone it, get inside the directory and
19
+ ## Usage
13
20
 
14
21
  ```
15
- bundle install
16
- ruby rubrowser.rb /path/of/project/or/file
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.0
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: