sdoc 0.4.0.rc.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/bin/sdoc +1 -2
- data/bin/sdoc-merge +0 -1
- data/lib/sdoc.rb +3 -1
- data/lib/sdoc/generator.rb +8 -8
- data/lib/sdoc/helpers.rb +2 -2
- data/lib/sdoc/merge.rb +4 -4
- data/lib/sdoc/templatable.rb +20 -20
- data/sdoc.gemspec +5 -4
- metadata +7 -8
- data/.rake_tasks~ +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 067a0e0ce20ba977d36da7bb1973265df51a9e82
|
4
|
+
data.tar.gz: 9ace3bdb783a389d48fb306f2cb889c48e561512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74a0a0ed5885d5a5476e0aeab695a8290e48021be825f012b3222609726f79314504d78b2845b9a0c8810cee95340a648800efc3dd876aa87a7a7c6aa41963a6
|
7
|
+
data.tar.gz: 5800a6d342566ee966a76c88d0ff51ffd834dda6954b6fb281cb54b4b2c8de7a44e967084ff281830cfff9ffd9f04956f2b3b31975aabe189614e461bb97c8b5
|
data/.gitignore
CHANGED
data/bin/sdoc
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
require 'sdoc'
|
3
3
|
|
4
4
|
begin
|
5
|
-
ARGV.
|
5
|
+
ARGV.unshift('--format=sdoc') if ARGV.grep(/\A(-f|--fmt|--format|-r|-R|--ri|--ri-site)\b/).empty?
|
6
6
|
r = RDoc::RDoc.new
|
7
7
|
r.document ARGV
|
8
8
|
rescue SystemExit
|
@@ -24,4 +24,3 @@ rescue Exception => e
|
|
24
24
|
|
25
25
|
exit 1
|
26
26
|
end
|
27
|
-
|
data/bin/sdoc-merge
CHANGED
data/lib/sdoc.rb
CHANGED
data/lib/sdoc/generator.rb
CHANGED
@@ -134,19 +134,19 @@ class RDoc::Generator::SDoc
|
|
134
134
|
opt.separator "SDoc generator options:"
|
135
135
|
opt.separator nil
|
136
136
|
opt.on("--github", "-g",
|
137
|
-
|
137
|
+
"Generate links to github.") do |value|
|
138
138
|
options.github = true
|
139
139
|
end
|
140
140
|
opt.separator nil
|
141
141
|
|
142
142
|
opt.on("--without-search", "-s",
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
143
|
+
"Do not generated index file for search engines.",
|
144
|
+
"SDoc uses javascript to refrence individual documentation pages.",
|
145
|
+
"Search engine crawlers are not smart enough to find all the",
|
146
|
+
"referenced pages.",
|
147
|
+
"To help them SDoc generates a static file with links to every",
|
148
|
+
"documentation page. This file is not shown to the user."
|
149
|
+
) do
|
150
150
|
options.search_index = false
|
151
151
|
end
|
152
152
|
opt.separator nil
|
data/lib/sdoc/helpers.rb
CHANGED
data/lib/sdoc/merge.rb
CHANGED
@@ -27,7 +27,7 @@ class SDoc::Merge
|
|
27
27
|
def merge(options)
|
28
28
|
parse_options options
|
29
29
|
|
30
|
-
|
30
|
+
@outputdir = Pathname.new( @op_dir )
|
31
31
|
|
32
32
|
check_directories
|
33
33
|
setup_output_dir
|
@@ -56,8 +56,8 @@ class SDoc::Merge
|
|
56
56
|
end
|
57
57
|
|
58
58
|
opt.on("-u", "--urls [URLS]", "Paths to merged docs. If you",
|
59
|
-
|
60
|
-
|
59
|
+
"set this files and classes won't be actualy",
|
60
|
+
"copied to merged build") do |v|
|
61
61
|
@urls = v.split(' ').map{|name| name.strip }
|
62
62
|
end
|
63
63
|
end
|
@@ -198,7 +198,7 @@ class SDoc::Merge
|
|
198
198
|
|
199
199
|
def setup_output_dir
|
200
200
|
if File.exists? @op_dir
|
201
|
-
error "#{@op_dir}
|
201
|
+
error "#{@op_dir} already exists"
|
202
202
|
end
|
203
203
|
FileUtils.mkdir_p @op_dir
|
204
204
|
end
|
data/lib/sdoc/templatable.rb
CHANGED
@@ -2,13 +2,13 @@ require 'erb'
|
|
2
2
|
require "sdoc"
|
3
3
|
|
4
4
|
module SDoc::Templatable
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
### Load and render the erb template in the given +templatefile+ within the
|
6
|
+
### specified +context+ (a Binding object) and return output
|
7
|
+
### Both +templatefile+ and +outfile+ should be Pathname-like objects.
|
8
8
|
def eval_template(templatefile, context)
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
template_src = templatefile.read
|
10
|
+
template = ERB.new( template_src, nil, '<>' )
|
11
|
+
template.filename = templatefile.to_s
|
12
12
|
|
13
13
|
begin
|
14
14
|
template.result( context )
|
@@ -29,10 +29,10 @@ module SDoc::Templatable
|
|
29
29
|
eval("#{source};eval_template(templatefile, binding)")
|
30
30
|
end
|
31
31
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
### Load and render the erb template in the given +templatefile+ within the
|
33
|
+
### specified +context+ (a Binding object) and write it out to +outfile+.
|
34
|
+
### Both +templatefile+ and +outfile+ should be Pathname-like objects.
|
35
|
+
def render_template( templatefile, context, outfile )
|
36
36
|
output = eval_template(templatefile, context)
|
37
37
|
|
38
38
|
# TODO delete this dirty hack when documentation for example for GeneratorMethods will not be cutted off by <script> tag
|
@@ -47,14 +47,14 @@ module SDoc::Templatable
|
|
47
47
|
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
50
|
+
unless $dryrun
|
51
|
+
outfile.dirname.mkpath
|
52
|
+
outfile.open( 'w', 0644 ) do |file|
|
53
|
+
file.print( output )
|
54
|
+
end
|
55
|
+
else
|
56
|
+
debug_msg " would have written %d bytes to %s" %
|
57
|
+
[ output.length, outfile ]
|
58
|
+
end
|
59
|
+
end
|
60
60
|
end
|
data/sdoc.gemspec
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
require_relative 'lib/sdoc.rb'
|
2
3
|
|
3
4
|
Gem::Specification.new do |s|
|
4
5
|
s.name = "sdoc"
|
5
|
-
s.version =
|
6
|
+
s.version = SDoc::VERSION
|
6
7
|
|
7
8
|
s.authors = ["Vladimir Kolesnikov", "Nathan Broadbent", "Jean Mertz", "Zachary Scott"]
|
8
9
|
s.description = %q{rdoc generator html with javascript search index.}
|
9
10
|
s.summary = %q{rdoc html with javascript search index.}
|
10
11
|
s.homepage = %q{http://github.com/voloko/sdoc}
|
11
|
-
s.email = %q{voloko@gmail.com}
|
12
|
+
s.email = %q{voloko@gmail.com zachary@zacharyscott.net}
|
12
13
|
s.license = 'MIT'
|
13
14
|
|
14
15
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.6") if
|
@@ -21,9 +22,9 @@ Gem::Specification.new do |s|
|
|
21
22
|
|
22
23
|
if defined?(JRUBY_VERSION)
|
23
24
|
s.platform = Gem::Platform.new(['universal', 'java', nil])
|
24
|
-
s.add_runtime_dependency("json_pure", "
|
25
|
+
s.add_runtime_dependency("json_pure", "~> 1.8")
|
25
26
|
else
|
26
|
-
s.add_runtime_dependency("json", "
|
27
|
+
s.add_runtime_dependency("json", "~> 1.8")
|
27
28
|
end
|
28
29
|
|
29
30
|
s.add_development_dependency "bundler", "~> 1.3"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.0
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Kolesnikov
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2014-01-10 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rdoc
|
@@ -37,16 +37,16 @@ dependencies:
|
|
37
37
|
name: json
|
38
38
|
requirement: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- - "
|
40
|
+
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: 1.
|
42
|
+
version: '1.8'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - "
|
47
|
+
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 1.
|
49
|
+
version: '1.8'
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: bundler
|
52
52
|
requirement: !ruby/object:Gem::Requirement
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '4.0'
|
92
92
|
description: rdoc generator html with javascript search index.
|
93
|
-
email: voloko@gmail.com
|
93
|
+
email: voloko@gmail.com zachary@zacharyscott.net
|
94
94
|
executables:
|
95
95
|
- sdoc
|
96
96
|
- sdoc-merge
|
@@ -99,7 +99,6 @@ extra_rdoc_files:
|
|
99
99
|
- README.md
|
100
100
|
files:
|
101
101
|
- ".gitignore"
|
102
|
-
- ".rake_tasks~"
|
103
102
|
- ".travis.yml"
|
104
103
|
- Gemfile
|
105
104
|
- LICENSE
|
data/.rake_tasks~
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
build
|
2
|
-
check_dependencies
|
3
|
-
check_dependencies:development
|
4
|
-
check_dependencies:runtime
|
5
|
-
gem_file_list
|
6
|
-
gemspec
|
7
|
-
gemspec:debug
|
8
|
-
gemspec:generate
|
9
|
-
gemspec:validate
|
10
|
-
ghost
|
11
|
-
git:release
|
12
|
-
github:release
|
13
|
-
install
|
14
|
-
release
|
15
|
-
test
|
16
|
-
version
|
17
|
-
version:bump:major
|
18
|
-
version:bump:minor
|
19
|
-
version:bump:patch
|
20
|
-
version:write
|