rdoc-view 0.0.7 → 0.0.8
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.
- data/README.rdoc +1 -1
- data/lib/rdoc-view/version.rb +1 -1
- data/lib/rdoc-view.rb +4 -3
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -12,7 +12,7 @@ RDocView is a real-time viewer of RDoc/Markdown/Textile which used WebSocket.
|
|
12
12
|
|
13
13
|
-p port set the port (default is 4567)
|
14
14
|
-o addr set the host (default is 0.0.0.0)
|
15
|
-
-t type set the document type (rdoc
|
15
|
+
-t type set the document type (rdoc,textile,md or markdown)
|
16
16
|
if omits, judging from the extension
|
17
17
|
-h, --html convert to html.
|
18
18
|
|
data/lib/rdoc-view/version.rb
CHANGED
data/lib/rdoc-view.rb
CHANGED
@@ -19,7 +19,7 @@ module RDocView
|
|
19
19
|
html = ""
|
20
20
|
text = open(file){|f|f.read}
|
21
21
|
case type
|
22
|
-
when "md"
|
22
|
+
when "md", "markdown"
|
23
23
|
uri = URI.parse("https://api.github.com/markdown/raw")
|
24
24
|
https = Net::HTTP.new(uri.host, uri.port)
|
25
25
|
https.use_ssl = true
|
@@ -44,9 +44,10 @@ module RDocView
|
|
44
44
|
opt_html = false
|
45
45
|
opt_type = nil
|
46
46
|
OptionParser.new { |op |
|
47
|
+
op.version = VERSION
|
47
48
|
op.on('-p port', 'set the port (default is 4567)') { |val| set :port, Integer(val) }
|
48
49
|
op.on('-o addr', 'set the host (default is 0.0.0.0)') { |val| set :bind, val }
|
49
|
-
op.on('-t type', 'set the document type (rdoc
|
50
|
+
op.on('-t type', 'set the document type (rdoc,textile,md or markdown)',
|
50
51
|
'if omits, judging from the extension') { |val| opt_type = val.downcase }
|
51
52
|
op.on('-h', '--html', 'convert to html.') { |val| opt_html = true }
|
52
53
|
}.parse!(ARGV)
|
@@ -59,7 +60,7 @@ module RDocView
|
|
59
60
|
set :server, "thin"
|
60
61
|
set :sockets, []
|
61
62
|
|
62
|
-
support_extensions = ["rdoc", "md", "textile"]
|
63
|
+
support_extensions = ["rdoc", "md", "markdown", "textile"]
|
63
64
|
set :type, opt_type
|
64
65
|
set :type, File.extname(ARGV[0]).downcase().slice(1..-1) unless support_extensions.include?(opt_type)
|
65
66
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc-view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|