voloko-sdoc 0.2.6 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 2
3
- :patch: 6
3
+ :patch: 7
4
4
  :major: 0
@@ -280,7 +280,7 @@ class RDoc::Generator::SHtml
280
280
  content = str.gsub(/^\s*(#+)\s*/, '')
281
281
  end
282
282
 
283
- content.sub(/^(.{100,}?)\s.*/m, "\\1").gsub(/\r?\n/m, ' ')
283
+ content = content.sub(/^(.{100,}?)\s.*/m, "\\1").gsub(/\r?\n/m, ' ')
284
284
 
285
285
  begin
286
286
  content.to_json
@@ -3,7 +3,7 @@
3
3
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=%charset%"/>
6
+ <meta http-equiv="Content-Type" content="text/html;"/>
7
7
 
8
8
  <title><%= @options.title %></title>
9
9
  </head>
@@ -3,7 +3,7 @@
3
3
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
4
4
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
5
  <head>
6
- <meta http-equiv="Content-Type" content="text/html; charset=%charset%"/>
6
+ <meta http-equiv="Content-Type" content="text/html;"/>
7
7
 
8
8
  <title><%= @options.title %></title>
9
9
  </head>
data/lib/sdoc/merge.rb CHANGED
@@ -12,6 +12,7 @@ class SDoc::Merge
12
12
 
13
13
  def initialize()
14
14
  @names = []
15
+ @urls = []
15
16
  @op_dir = 'doc'
16
17
  @title = ''
17
18
  @directories = []
@@ -28,6 +29,7 @@ class SDoc::Merge
28
29
  setup_output_dir
29
30
  setup_names
30
31
  copy_files
32
+ copy_docs if @urls.empty?
31
33
  merge_search_index
32
34
  merge_tree
33
35
  generate_index_file
@@ -48,6 +50,11 @@ class SDoc::Merge
48
50
  opt.on("-t", "--title [TITLE]", "Set the title of merged file") do |v|
49
51
  @title = v
50
52
  end
53
+
54
+ opt.on("-u", "--urls [URLS]", "Paths to merged docs. If you \n" +
55
+ "set this files and classes won't be actualy copied to merged build") do |v|
56
+ @urls = v.split(' ').map{|name| name.strip }
57
+ end
51
58
  end
52
59
  opts.parse! options
53
60
  @directories = options.dup
@@ -57,14 +64,15 @@ class SDoc::Merge
57
64
  tree = []
58
65
  @directories.each_with_index do |dir, i|
59
66
  name = @names[i]
67
+ url = @urls.empty? ? name : @urls[i]
60
68
  filename = File.join dir, RDoc::Generator::SHtml::TREE_FILE
61
69
  data = open(filename).read.sub(/var tree =\s*/, '')
62
70
  subtree = JSON.parse data
63
71
  item = [
64
72
  name,
65
- name + '/' + extract_index_path(dir),
73
+ url + '/' + extract_index_path(dir),
66
74
  '',
67
- append_path(subtree, name)
75
+ append_path(subtree, url)
68
76
  ]
69
77
  tree << item
70
78
  end
@@ -89,6 +97,7 @@ class SDoc::Merge
89
97
  @indexes = {}
90
98
  @directories.each_with_index do |dir, i|
91
99
  name = @names[i]
100
+ url = @urls.empty? ? name : @urls[i]
92
101
  filename = File.join dir, RDoc::Generator::SHtml::SEARCH_INDEX_FILE
93
102
  data = open(filename).read.sub(/var search_data =\s*/, '')
94
103
  subindex = JSON.parse data
@@ -97,7 +106,7 @@ class SDoc::Merge
97
106
  searchIndex = subindex["index"]["searchIndex"]
98
107
  longSearchIndex = subindex["index"]["longSearchIndex"]
99
108
  subindex["index"]["info"].each_with_index do |info, j|
100
- info[2] = name + '/' + info[2]
109
+ info[2] = url + '/' + info[2]
101
110
  info[6] = i
102
111
  items << {
103
112
  :info => info,
@@ -142,7 +151,8 @@ class SDoc::Merge
142
151
  def generate_index_file
143
152
  templatefile = @template_dir + 'index.rhtml'
144
153
  outfile = @outputdir + 'index.html'
145
- index_path = @names[0] + '/' + extract_index_path(@directories[0])
154
+ url = @urls.empty? ? @names[0] : @urls[0]
155
+ index_path = url + '/' + extract_index_path(@directories[0])
146
156
 
147
157
  render_template templatefile, binding(), outfile
148
158
  end
@@ -157,7 +167,7 @@ class SDoc::Merge
157
167
  end
158
168
  end
159
169
 
160
- def copy_files
170
+ def copy_docs
161
171
  @directories.each_with_index do |dir, i|
162
172
  name = @names[i]
163
173
  index_dir = File.dirname(RDoc::Generator::SHtml::TREE_FILE)
@@ -169,7 +179,9 @@ class SDoc::Merge
169
179
  end
170
180
  end
171
181
  end
172
-
182
+ end
183
+
184
+ def copy_files
173
185
  dir = @directories.first
174
186
  Dir.new(dir).each do |item|
175
187
  if item != '.' && item != '..' && item != RDoc::Generator::SHtml::FILE_DIR && item != RDoc::Generator::SHtml::CLASS_DIR
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: voloko-sdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volodya Kolesnikov
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-08 00:00:00 -07:00
12
+ date: 2009-04-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency