rubrowser 0.1.4 → 0.1.5
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/Gemfile.lock +1 -1
- data/bin/rubrowser +27 -1
- data/lib/rubrowser.rb +1 -1
- data/lib/server.rb +5 -5
- data/readme.md +13 -5
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: badb6ddb134dfb84c78ca1f1fccf87adca07323e
|
|
4
|
+
data.tar.gz: 876d60b83c0df6d6edaee25064b141cb9ff05929
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6a178d00941b0ebb744f0c999cf5ca0f530c3e5f27b2c052279dc6e0bc4296c54d6d78200438ad0f5e7cee4b34fc3d6a8760e0c8bb4feab356195a87f25e5287
|
|
7
|
+
data.tar.gz: 8c2b27697a86960346f7e8c1edf04763166ddd02625a46974bb2862a6aba857c58e8d269f5f6a2f3a2c7bee7344079c7d59b0c69aad039857662f017147b3eff
|
data/Gemfile.lock
CHANGED
data/bin/rubrowser
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
2
|
$LOAD_PATH.push File.expand_path('../../lib', __FILE__)
|
|
3
3
|
|
|
4
|
+
require 'optparse'
|
|
5
|
+
require 'rubrowser'
|
|
6
|
+
|
|
7
|
+
OPTIONS = {
|
|
8
|
+
port: 9000,
|
|
9
|
+
files: ARGV.empty? ? ['.'] : ARGV
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
OptionParser.new do |opts|
|
|
13
|
+
opts.banner = "Usage: #{__FILE__} [options] [file] ..."
|
|
14
|
+
|
|
15
|
+
opts.on('-pPORT', '--port=PORT', 'Specify port number for server, default = 9000') do |port|
|
|
16
|
+
OPTIONS[:port] = port.to_i
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
opts.on('-v', '--version', 'Print Rubrowser version') do
|
|
20
|
+
puts "Rubrowser #{Rubrowser::VERSION}"
|
|
21
|
+
exit
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
opts.on('-h', '--help', 'Prints this help') do
|
|
25
|
+
puts opts
|
|
26
|
+
exit
|
|
27
|
+
end
|
|
28
|
+
end.parse!
|
|
29
|
+
|
|
4
30
|
require 'server'
|
|
5
|
-
Rubrowser::Server.start(
|
|
31
|
+
Rubrowser::Server.start(OPTIONS)
|
data/lib/rubrowser.rb
CHANGED
data/lib/server.rb
CHANGED
|
@@ -7,14 +7,14 @@ module Rubrowser
|
|
|
7
7
|
class Server < WEBrick::HTTPServer
|
|
8
8
|
include ERB::Util
|
|
9
9
|
|
|
10
|
-
def self.start(
|
|
11
|
-
new(
|
|
10
|
+
def self.start(options = {})
|
|
11
|
+
new(options).start
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
def initialize(
|
|
15
|
-
super Port:
|
|
14
|
+
def initialize(options)
|
|
15
|
+
super Port: options[:port]
|
|
16
16
|
|
|
17
|
-
@data = Rubrowser::Data.new(
|
|
17
|
+
@data = Rubrowser::Data.new(options[:files])
|
|
18
18
|
@data.parse
|
|
19
19
|
|
|
20
20
|
mount_proc '/' do |req, res|
|
data/readme.md
CHANGED
|
@@ -16,20 +16,28 @@ the idea is that the project opens every `.rb` file and parse it with `parser` g
|
|
|
16
16
|
* it statically analyze the code so meta programming is out of question in here
|
|
17
17
|
* rails associations are meta programming so forget it :smile:
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
20
21
|
|
|
21
22
|
```
|
|
22
23
|
gem install rubrowser
|
|
23
|
-
rubrowser /path/to/project/or/file
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
27
28
|
|
|
28
29
|
```
|
|
29
|
-
rubrowser
|
|
30
|
+
Usage: bin/rubrowser [options] [file] ...
|
|
31
|
+
-p, --port=PORT Specify port number for server, default = 9000
|
|
32
|
+
-v, --version Print Rubrowser version
|
|
33
|
+
-h, --help Prints this help
|
|
30
34
|
```
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
if you run it without any options
|
|
37
|
+
```
|
|
38
|
+
rubrowser
|
|
39
|
+
```
|
|
40
|
+
it'll analyze the current directory and open port 9000, so you can access the graph from `localhost:9000`
|
|
33
41
|
|
|
34
42
|
## Features
|
|
35
43
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Emad Elsaid
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-08-
|
|
11
|
+
date: 2016-08-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parser
|