code-explorer 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +2 -1
- data/VERSION +1 -1
- data/bin/code-explorer +4 -0
- data/lib/code_explorer/numbered_lines.rb +7 -15
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 727c00ca0eb3b407c3c652df498a3c144435c3f7
|
4
|
+
data.tar.gz: e2f631eabc5a8db7105ac431e25560cac7d2b7c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 862c73bfaac7f8b205a28b9fe48bf7567fe9ca7c44442dcead4e688d7d5b545b0bf2a5f9f103e025b43d612d1b1c432ea5035495aaa97c28995e0e78dbdc5771
|
7
|
+
data.tar.gz: ef2838e35109d04dec641eebf48932947c6156e3ccc2056038c1c40db1d13f900e7b0d937bfe63621f6f45338bc181741eecdfce15deff1280ed5c9131438445
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
<!-- -*- markdown -*- -->
|
2
|
+
## 0.2.6 (2017-08-16)
|
3
|
+
|
4
|
+
- Fixed running the web server from an installed gem.
|
5
|
+
- Using [CodeRay][] for syntag highlighting.
|
6
|
+
|
7
|
+
[CodeRay]: http://coderay.rubychan.de/
|
8
|
+
|
2
9
|
## 0.2.5 (2016-08-03)
|
3
10
|
|
4
11
|
- Respect PATH when running the Ruby programs (by frickler01).
|
data/README.md
CHANGED
@@ -24,6 +24,7 @@ Identifies fully qualified class names and makes an inheritance graph
|
|
24
24
|
- [Graphviz](http://www.graphviz.org/) (graph visualizer)
|
25
25
|
- [Sinatra](http://www.sinatrarb.com/) (a small web framework)
|
26
26
|
- [Cheetah](https://github.com/openSUSE/cheetah) (runs commands)
|
27
|
+
- [CodeRay](http://coderay.rubychan.de/) (syntax highlighting)
|
27
28
|
|
28
29
|
## License
|
29
30
|
|
@@ -33,7 +34,7 @@ MIT
|
|
33
34
|
|
34
35
|
```sh
|
35
36
|
bundle install --path vendor/bundle
|
36
|
-
bundle exec
|
37
|
+
bundle exec code-explorer
|
37
38
|
```
|
38
39
|
|
39
40
|
## Example
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/bin/code-explorer
CHANGED
@@ -14,6 +14,8 @@ end
|
|
14
14
|
configure do
|
15
15
|
mime_type :png, "image/png"
|
16
16
|
mime_type :svg, "image/svg+xml"
|
17
|
+
puts "Browse:"
|
18
|
+
puts " xdg-open http://localhost:#{settings.port}/"
|
17
19
|
end
|
18
20
|
|
19
21
|
get "/" do
|
@@ -73,3 +75,5 @@ get "/call-graph/*" do |path|
|
|
73
75
|
|
74
76
|
serve_dot(dot, format)
|
75
77
|
end
|
78
|
+
|
79
|
+
Sinatra::Application.run!
|
@@ -1,18 +1,10 @@
|
|
1
|
+
require "coderay"
|
1
2
|
|
2
|
-
#
|
3
|
-
|
4
|
-
# convert plain text to HTML where lines are hyperlinkable (emulate RFC 5147)
|
3
|
+
# Convert plain text to HTML where lines are hyperlinkable.
|
4
|
+
# Emulate RFC 5147 fragment identifier: #line=42
|
5
5
|
def numbered_lines(text)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
show_line_num = i.to_s.rjust(count_width).gsub(" ", " ")
|
12
|
-
escaped_line = escape_html(line.chomp).gsub(" ", " ")
|
13
|
-
id = "line=#{i}" # RFC 5147 fragment identifier
|
14
|
-
|
15
|
-
"<tt><a id='#{id}' href='##{id}'>#{show_line_num}</a></tt> " \
|
16
|
-
"<code>#{escaped_line}</code><br>\n"
|
17
|
-
end.join("")
|
6
|
+
# but CodeRay wants to remove the equal sign;
|
7
|
+
tag = "lI" + "-Ne" # avoid the literal tag if we process our own source
|
8
|
+
html = CodeRay.scan(text, :ruby).page(line_number_anchors: tag)
|
9
|
+
html.gsub(tag, "line=")
|
18
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code-explorer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Vidner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: coderay
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1'
|
55
69
|
description: Find your way around source code written in Ruby
|
56
70
|
email: martin@vidner.net
|
57
71
|
executables:
|
@@ -95,9 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
109
|
version: '0'
|
96
110
|
requirements: []
|
97
111
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.2.
|
112
|
+
rubygems_version: 2.2.5
|
99
113
|
signing_key:
|
100
114
|
specification_version: 4
|
101
115
|
summary: Explore Ruby code
|
102
116
|
test_files: []
|
103
|
-
has_rdoc:
|