rdoc-generator-fivefish 0.0.1 → 0.1.0.pre.87

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b1c31edb8ff7f8f6979b5391984e439c9fa285a1
4
+ data.tar.gz: a82da0842d0ca0c73593cab01fecf212f43a2d88
5
+ SHA512:
6
+ metadata.gz: 1fc838df2a6111ff7c11fdda5b7ae803dec5b6cb73ccd5a793413c3b482c51ecc3faa1452e5aba2fbc85f1e8e8a199f2433a03ab869ef9fa14e8a012e3367df4
7
+ data.tar.gz: 6b265b5dc435fbc5c88d695dd63daa3aa37f590fca4b80e51e9c55a50218cb89c508cadcc6a19ce3445aa3a7b1b7c3acda01e1189910e2bf03400d2c4e5cc5ee
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- ��W�� ���jO��rr�ˊ;�6~�>QduyL����O�(�.x��mRc�4$AކL0�͐H�?1��)��++J!��ѢzlQ`�b�
2
- )�#IO�S��&E�X��\F���?>�[��iq��g"(�$E��0��!"d�`R��:t�Դ�ʖTU1��<�=$�XI��%eDr�����&����*ma�n����-�כ�SG˫,�8��0ot@5������L_�Wv���u+S�yd��J���=ρ��jb���
1
+ ry
2
+ �
3
+ H��@�#��:��t���ս�~;���ŵ�i��Z��N�Y���n>�!-!�B˫��d
4
+ ���7�)���4|�V�%hZ(T�]����8 L�%�jjy���E�L�W�s�ΐ��i
File without changes
data/ChangeLog CHANGED
@@ -1,8 +1,41 @@
1
+ 2012-12-10 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * .rvm.gems, Rakefile, lib/fivefish.rb, lib/rdoc/discover.rb,
4
+ lib/rdoc/generator/fivefish.rb:
5
+ Update for RDoc 4
6
+ [06e965cb1905] [tip]
7
+
8
+ 2012-09-12 Michael Granger <ged@FaerieMUD.org>
9
+
10
+ * .hgtags:
11
+ Added tag v0.0.1 for changeset dc96dffc23e0
12
+ [b33f8d965c61] [github/master]
13
+
14
+ * .hgsigs:
15
+ Added signature for changeset e900e8771607
16
+ [dc96dffc23e0] [v0.0.1]
17
+
18
+ * History.rdoc:
19
+ Update the history doc
20
+ [e900e8771607]
21
+
22
+ * tasks/bootstrap.rb:
23
+ Clone instead of qcloning the bootstrap repo
24
+ [ef81a5b81b7f]
25
+
26
+ * tasks/bootstrap.rb:
27
+ Use my bitbucket clone of bootstrap.
28
+ [fd83414d9340]
29
+
30
+ * README.rdoc:
31
+ Updated the README.
32
+ [6bef1f941287]
33
+
1
34
  2012-07-27 Michael Granger <ged@FaerieMUD.org>
2
35
 
3
36
  * assets/css/fivefish.css:
4
37
  Adding line-height to description Ps
5
- [4eebebca05bc] [tip]
38
+ [4eebebca05bc]
6
39
 
7
40
  2012-07-16 Michael Granger <ged@FaerieMUD.org>
8
41
 
@@ -43,7 +76,7 @@
43
76
 
44
77
  * assets/css/fivefish.css:
45
78
  Try another CSS strategy for the offset anchor targets.
46
- [b9337d344ae5]
79
+ [b9337d344ae5] [github/master@default]
47
80
 
48
81
  2012-05-21 Michael Granger <ged@FaerieMUD.org>
49
82
 
@@ -1,3 +1,14 @@
1
+ == v0.1.0 [2013-02-27] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Add some CSS and module-index visual tweaks
4
+ - Make the synopsis-extraction more intelligent
5
+ - Add support for module extension
6
+ - Add Ruby 2.0 support
7
+ - Add an --additional-stylesheet option
8
+ - Make the anchor and top links in titles less obnoxious
9
+ - Update for RDoc 4
10
+
11
+
1
12
  == v0.0.1 [2012-09-12] Michael Granger <ged@FaerieMUD.org>
2
13
 
3
14
  Initial release.
data/Rakefile CHANGED
@@ -70,12 +70,14 @@ hoespec = Hoe.spec( PACKAGE_NAME ) do
70
70
 
71
71
  self.developer 'Michael Granger', 'ged@FaerieMUD.org'
72
72
 
73
- self.dependency 'inversion', '~> 0.10'
74
- self.dependency 'yajl-ruby', '~> 1.1'
75
- self.dependency 'rdoc', '~> 3.12'
73
+ self.dependency 'inversion', '~> 0.12'
74
+ self.dependency 'loggability', '~> 0.6'
75
+ self.dependency 'yajl-ruby', '~> 1.1'
76
+ self.dependency 'rdoc', '~> 4.0'
76
77
 
77
- self.dependency 'uglifier', '~> 1.2', :developer
78
- self.dependency 'less', '~> 2.2', :developer
78
+ self.dependency 'hoe-deveiate', '~> 0.2', :developer
79
+ self.dependency 'uglifier', '~> 1.2', :developer
80
+ self.dependency 'less', '~> 2.2', :developer
79
81
 
80
82
  self.spec_extras[:licenses] = ["BSD"]
81
83
  self.require_ruby_version( '>=1.9.3' )
@@ -109,6 +111,7 @@ task :dev do
109
111
  ENV['FIVEFISH_DEVELMODE'] = 'true'
110
112
  end
111
113
 
114
+ task :gem => :assets
112
115
 
113
116
  # Eat our own dogfood
114
117
  task :docs => :assets
@@ -91,7 +91,10 @@ div.container > header.hero-unit h1 {
91
91
  display: inline-block;
92
92
  text-shadow: 1px 1px 3px rgba( 25,25,25, 0.2 );
93
93
  }
94
-
94
+ /* ...and allow it to be flexible about its width */
95
+ .popover {
96
+ width: inherit;
97
+ }
95
98
 
96
99
  /* Indexes */
97
100
  section#indexes {
@@ -125,6 +128,20 @@ section.description h3 {
125
128
  margin-bottom: 0;
126
129
  }
127
130
 
131
+ header h1 span,
132
+ section.description h2 span,
133
+ section.description h3 span,
134
+ section.description h4 span {
135
+ font-size: 12px;
136
+ padding: 0 0.5em;
137
+ }
138
+ header h1 span a,
139
+ section.description h2 span a,
140
+ section.description h3 span a,
141
+ section.description h4 span a {
142
+ color: #bbb;
143
+ }
144
+
128
145
  /* :section: groups */
129
146
  section.documentation-section {
130
147
  margin-top: 3em;
@@ -394,7 +411,18 @@ div.dropdown-menu {
394
411
  content: "";
395
412
  }
396
413
 
414
+ .nav-list li a {
415
+ overflow: hidden;
416
+ text-overflow: ellipsis;
417
+ }
418
+ .nav-list li a:hover {
419
+ overflow: visible;
420
+ }
421
+ .nav-list li .ns {
422
+ font-size: smaller;
423
+ }
397
424
 
398
425
  footer {
399
426
  padding: 1em 0 3em;
400
427
  }
428
+
@@ -44,6 +44,18 @@
44
44
  <?end if ?>
45
45
  <?end for ?>
46
46
  <?end unless ?>
47
+
48
+ <?unless klass.extends.empty? ?>
49
+ <dt>Extended With</dt>
50
+ <?for ext in klass.extends ?>
51
+ <?if ext.module.respond_to?(:path) ?>
52
+ <dd class="extend"><a href="[?call klass.aref_to(ext.module.path) ?]"><?call
53
+ ext.module.full_name ?></a></dd>
54
+ <?else ?>
55
+ <dd class="extend"><?call ext.name ?></dd>
56
+ <?end if ?>
57
+ <?end for ?>
58
+ <?end unless ?>
47
59
  </dl>
48
60
  </section>
49
61
 
@@ -1,4 +1,4 @@
1
- <?import rel_prefix, modsort, files ?>
1
+ <?import rel_prefix, modsort, methods, files ?>
2
2
 
3
3
  <header class="hero-unit">
4
4
  <?attr synopsis ?>
@@ -14,8 +14,9 @@
14
14
  <ul id="class-index" class="nav nav-list">
15
15
  <li class="nav-header">Classes/Modules</li>
16
16
  <?for index_class in modsort.select( &:documented? ).uniq {|c| c.path } ?>
17
- <li><a href="[?attr rel_prefix ?]/[?call index_class.path ?]"><?call
18
- index_class.full_name ?></a></li>
17
+ <li><a href="[?attr rel_prefix ?]/[?call index_class.path ?]"
18
+ title="[?call index_class.full_name ?]"><?call
19
+ index_class.full_name.gsub(/(.+?)(?=::)/, '<span class="ns">\\1</span>') ?></a></li>
19
20
  <?end for ?>
20
21
  </ul>
21
22
  </div>
@@ -23,7 +24,7 @@
23
24
  <div class="span4">
24
25
  <ul id="method-index" class="nav nav-list">
25
26
  <li class="nav-header">Methods</li>
26
- <?for method in all_methods.uniq {|m| m.path } ?>
27
+ <?for method in methods.uniq {|m| m.path } ?>
27
28
  <li class="method"><a title="[?call method.parent.full_name ?]"
28
29
  href="[?call method.path ?]"><?call method.pretty_name ?>
29
30
  <span class="method-parent">[<?call
@@ -28,6 +28,9 @@
28
28
  <link href="[?attr rel_prefix ?]" rel="prefix" />
29
29
 
30
30
  <link href="[?attr rel_prefix ?]/css/fivefish.min.css" rel="stylesheet" />
31
+ <?if rdoc_options.additional_stylesheet ?>
32
+ <link href="[?call rdoc_options.additional_stylesheet ?]" rel="stylesheet" title="Site Style" />
33
+ <?end if ?>
31
34
 
32
35
  <script src="[?attr rel_prefix ?]/js/jquery-1.7.1.min.js" type="text/javascript"
33
36
  defer="defer" charset="utf-8"></script>
@@ -4,19 +4,20 @@ require 'rdoc/rdoc'
4
4
  require 'rdoc/generator/fivefish'
5
5
 
6
6
  # :title: Fivefish RDoc
7
- #--
7
+ #
8
8
  # Toplevel namespace for Fivefish. The main goods are in RDoc::Generator::Fivefish.
9
9
  module Fivefish
10
10
 
11
11
  # Library version constant
12
- VERSION = '0.0.1'
12
+ VERSION = '0.1.0'
13
13
 
14
14
  # Version-control revision constant
15
- REVISION = %q$Revision: 083bb9b1a6de $
15
+ REVISION = %q$Revision: 7b178d4789f8 $
16
16
 
17
17
  # Fivefish project URL
18
18
  PROJECT_URL = 'http://deveiate.org/fivefish.html'
19
19
 
20
+
20
21
  ### Get the library version. If +include_buildnum+ is true, the version string will
21
22
  ### include the VCS rev ID.
22
23
  def self::version_string( include_buildnum=false )
@@ -25,4 +26,5 @@ module Fivefish
25
26
  return vstring
26
27
  end
27
28
 
28
- end # module Fivefish
29
+ end # module Fivefish
30
+
@@ -1,5 +1,7 @@
1
1
  # -*- ruby -*-
2
2
 
3
+ $stderr.puts "Discovered Darkfish!" if $DEBUG
4
+
3
5
  # RDoc plugin hook
4
6
  require 'fivefish'
5
7
 
@@ -1,9 +1,11 @@
1
1
  # -*- mode: ruby; ruby-indent-level: 4; tab-width: 4 -*-
2
2
 
3
- gem 'rdoc', '~> 3.12'
3
+ gem 'rdoc'
4
4
 
5
+ require 'uri'
5
6
  require 'yajl'
6
7
  require 'inversion'
8
+ require 'loggability'
7
9
  require 'fileutils'
8
10
  require 'pathname'
9
11
  require 'rdoc/rdoc'
@@ -11,8 +13,14 @@ require 'rdoc/generator/json_index'
11
13
 
12
14
  # The Fivefish generator class.
13
15
  class RDoc::Generator::Fivefish
16
+ extend Loggability
14
17
  include FileUtils
15
18
 
19
+
20
+ # Loggability API -- set up a Logger for Fivefish
21
+ log_as :fivefish
22
+
23
+
16
24
  # The data directory in the project if that exists, otherwise the gem datadir
17
25
  DATADIR = if ENV['FIVEFISH_DATADIR']
18
26
  Pathname( ENV['FIVEFISH_DATADIR'] ).expand_path( Pathname.pwd )
@@ -28,11 +36,32 @@ class RDoc::Generator::Fivefish
28
36
  RDoc::RDoc.add_generator( self )
29
37
 
30
38
 
39
+ ### Add generator-specific options to the option-parser
40
+ def self::setup_options( rdoc_options )
41
+ op = rdoc_options.option_parser
42
+
43
+ op.accept( URI ) do |string|
44
+ uri = URI.parse( string ) rescue nil
45
+ raise OptionParser::InvalidArgument unless uri
46
+ uri
47
+ end
48
+ op.on( '--additional-stylesheet=URL', URI,
49
+ "Add an additional (preferred) stylesheet",
50
+ "link to each generated page. This allows",
51
+ "the output style to be overridden." ) do |url|
52
+ rdoc_options.additional_stylesheet = url
53
+ end
54
+ end
55
+
56
+
31
57
  ### Set up some instance variables
32
- def initialize( options )
58
+ def initialize( store, options )
59
+ @store = store
33
60
  @options = options
34
61
  $DEBUG_RDOC = $VERBOSE || $DEBUG
35
62
 
63
+ self.log.debug "Setting up generator for %p with options: %p" % [ @store, @options ]
64
+
36
65
  extend( FileUtils::Verbose ) if $DEBUG_RDOC
37
66
  extend( FileUtils::DryRun ) if options.dry_run
38
67
 
@@ -65,6 +94,9 @@ class RDoc::Generator::Fivefish
65
94
  # The command-line options given to the rdoc command
66
95
  attr_reader :options
67
96
 
97
+ # The RDoc::Store that contains the parsed CodeObjects
98
+ attr_reader :store
99
+
68
100
 
69
101
  ### Output progress information if debugging is enabled
70
102
  def debug_msg( *msg )
@@ -87,13 +119,9 @@ class RDoc::Generator::Fivefish
87
119
  end
88
120
 
89
121
 
90
- ### Build the initial indices and output objects based on an array of TopLevel
91
- ### objects containing the extracted information.
92
- def generate( top_levels )
93
- @files = top_levels.sort
94
- @classes = RDoc::TopLevel.all_classes_and_modules.sort
95
- @methods = @classes.map {|m| m.method_list }.flatten.sort
96
- @modsort = self.get_sorted_module_list( @classes )
122
+ ### Build the initial indices and output objects based on the files in the generator's store.
123
+ def generate
124
+ self.populate_data_objects
97
125
 
98
126
  self.generate_index_page
99
127
  self.generate_class_files
@@ -105,111 +133,19 @@ class RDoc::Generator::Fivefish
105
133
  end
106
134
 
107
135
 
108
- #########
109
- protected
110
- #########
111
-
112
-
113
- ### Return an Array of Pathname objects for each file/directory in the
114
- ### list of static assets that should be copied into the output directory.
115
- def find_static_assets
116
- paths = self.options.static_path || []
117
- self.debug_msg "Finding asset paths. Static paths: %p" % [ paths ]
118
-
119
- # Add each subdirectory of the template dir
120
- self.debug_msg " adding directories under %s" % [ self.template_dir ]
121
- paths << self.template_dir
122
- self.debug_msg " paths are now: %p" % [ paths ]
123
-
124
- return paths.flatten.compact.uniq
125
- end
126
-
127
-
128
- ### Copies static files from the static_path into the output directory
129
- def copy_static_assets
130
- asset_paths = self.find_static_assets
131
-
132
- self.debug_msg "Copying assets from paths:", *asset_paths
133
-
134
- asset_paths.each do |path|
135
-
136
- # For plain files, just install them
137
- if path.file?
138
- self.debug_msg " plain file; installing as-is"
139
- install( path, self.output_dir, :mode => 0644 )
140
-
141
- # Glob all the files out of subdirectories and install them
142
- elsif path.directory?
143
- self.debug_msg " directory %p; copying contents" % [ path ]
144
-
145
- Pathname.glob( path + '{css,fonts,img,js}/**/*'.to_s ).each do |asset|
146
- next if asset.directory? || asset.basename.to_s.start_with?( '.' )
147
-
148
- dst = asset.relative_path_from( path )
149
- dst.dirname.mkpath
150
-
151
- self.debug_msg " %p -> %p" % [ asset, dst ]
152
- install asset, dst, :mode => 0644
153
- end
154
- end
155
- end
156
- end
157
-
158
-
159
- ### Return a list of the documented modules sorted by salience first, then
160
- ### by name.
161
- def get_sorted_module_list(classes)
162
- nscounts = classes.inject({}) do |counthash, klass|
163
- top_level = klass.full_name.gsub( /::.*/, '' )
164
- counthash[top_level] ||= 0
165
- counthash[top_level] += 1
166
-
167
- counthash
168
- end
169
-
170
- # Sort based on how often the top level namespace occurs, and then on the
171
- # name of the module -- this works for projects that put their stuff into
172
- # a namespace, of course, but doesn't hurt if they don't.
173
- classes.sort_by do |klass|
174
- top_level = klass.full_name.gsub( /::.*/, '' )
175
- [nscounts[top_level] * -1, klass.full_name]
176
- end.select do |klass|
177
- klass.display?
178
- end
179
- end
180
-
181
-
182
- ### Fetch the template with the specified +name+ from the cache or load it
183
- ### and cache it.
184
- def load_template( name )
185
- unless @template_cache.key?( name )
186
- @template_cache[ name ] = Inversion::Template.load( name, encoding:'utf-8' )
187
- end
188
-
189
- return @template_cache[ name ].dup
190
- end
191
-
192
-
193
- ### Load the layout template and return it after setting any values it needs.
194
- def load_layout_template
195
- template = self.load_template( 'layout.tmpl' )
196
-
197
- template.files = @files
198
- template.classes = @classes
199
- template.methods = @methods
200
- template.modsort = @modsort
201
- template.rdoc_options = @options
202
-
203
- template.rdoc_version = RDoc::VERSION
204
- template.fivefish_version = Fivefish.version_string
205
-
206
- return template
136
+ ### Populate the data objects necessary to generate documentation from the generator's
137
+ ### #store.
138
+ def populate_data_objects
139
+ @files = self.store.all_files.sort
140
+ @classes = self.store.all_classes_and_modules.sort
141
+ @methods = @classes.map {|m| m.method_list }.flatten.sort
142
+ @modsort = self.get_sorted_module_list( @classes )
207
143
  end
208
144
 
209
145
 
210
146
  ### Generate an index page which lists all the classes which are documented.
211
147
  def generate_index_page
212
- self.debug_msg "Generating index page"
148
+ self.log.debug "Generating index page"
213
149
  layout = self.load_layout_template
214
150
  template = self.load_template( 'index.tmpl' )
215
151
  out_file = self.output_dir + 'index.html'
@@ -221,17 +157,13 @@ class RDoc::Generator::Fivefish
221
157
  else
222
158
  mainpage = @files.find {|f| f.full_name =~ /\breadme\b/i }
223
159
  end
224
- self.debug_msg " using main_page (%s)" % [ mainpage ]
160
+ self.log.debug " using main_page (%s)" % [ mainpage ]
225
161
 
226
162
  if mainpage
227
163
  template.mainpage = mainpage
228
- template.synopsis = mainpage.description.scan( %r{(<(h1|p).*?</\2>)}m )[0,3].map( &:first )
164
+ template.synopsis = self.extract_synopsis( mainpage )
229
165
  end
230
166
 
231
- template.all_methods = RDoc::TopLevel.all_classes_and_modules.flat_map do |mod|
232
- mod.method_list
233
- end.sort
234
-
235
167
  layout.rel_prefix = self.output_dir.relative_path_from( out_file.dirname )
236
168
  layout.contents = template
237
169
  layout.pageclass = 'index-page'
@@ -245,10 +177,10 @@ class RDoc::Generator::Fivefish
245
177
  layout = self.load_layout_template
246
178
  template = self.load_template( 'class.tmpl' )
247
179
 
248
- debug_msg "Generating class documentation in #{self.output_dir}"
180
+ self.log.debug "Generating class documentation in #{self.output_dir}"
249
181
 
250
182
  @classes.each do |klass|
251
- debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
183
+ self.log.debug " working on %s (%s)" % [klass.full_name, klass.path]
252
184
 
253
185
  out_file = self.output_dir + klass.path
254
186
  out_file.dirname.mkpath
@@ -269,13 +201,13 @@ class RDoc::Generator::Fivefish
269
201
  layout = self.load_layout_template
270
202
  template = self.load_template( 'file.tmpl' )
271
203
 
272
- debug_msg "Generating file documentation in #{self.output_dir}"
204
+ self.log.debug "Generating file documentation in #{self.output_dir}"
273
205
 
274
206
  @files.select {|f| f.text? }.each do |file|
275
207
  out_file = self.output_dir + file.path
276
208
  out_file.dirname.mkpath
277
209
 
278
- debug_msg " working on %s (%s)" % [file.full_name, out_file]
210
+ self.log.debug " working on %s (%s)" % [file.full_name, out_file]
279
211
 
280
212
  template.file = file
281
213
 
@@ -302,12 +234,12 @@ class RDoc::Generator::Fivefish
302
234
  def generate_search_index
303
235
  out_file = self.output_dir + 'js/searchindex.js'
304
236
 
305
- self.debug_msg "Generating search index (%s)." % [ out_file ]
237
+ self.log.debug "Generating search index (%s)." % [ out_file ]
306
238
  index = []
307
239
 
308
240
  objs = self.get_indexable_objects
309
241
  objs.each do |codeobj|
310
- self.debug_msg " #{codeobj.name}..."
242
+ self.log.debug " #{codeobj.name}..."
311
243
  record = codeobj.search_record
312
244
  index << {
313
245
  name: record[2],
@@ -317,7 +249,7 @@ class RDoc::Generator::Fivefish
317
249
  }
318
250
  end
319
251
 
320
- self.debug_msg " dumping JSON..."
252
+ self.log.debug " dumping JSON..."
321
253
  out_file.dirname.mkpath
322
254
  ofh = out_file.open( 'w:utf-8', 0644 )
323
255
 
@@ -327,6 +259,107 @@ class RDoc::Generator::Fivefish
327
259
  end
328
260
 
329
261
 
262
+ ### Copies static files from the static_path into the output directory
263
+ def copy_static_assets
264
+ asset_paths = self.find_static_assets
265
+
266
+ self.log.debug "Copying assets from paths:", *asset_paths
267
+
268
+ asset_paths.each do |path|
269
+
270
+ # For plain files, just install them
271
+ if path.file?
272
+ self.log.debug " plain file; installing as-is"
273
+ install( path, self.output_dir, :mode => 0644 )
274
+
275
+ # Glob all the files out of subdirectories and install them
276
+ elsif path.directory?
277
+ self.log.debug " directory %p; copying contents" % [ path ]
278
+
279
+ Pathname.glob( path + '{css,fonts,img,js}/**/*'.to_s ).each do |asset|
280
+ next if asset.directory? || asset.basename.to_s.start_with?( '.' )
281
+
282
+ dst = asset.relative_path_from( path )
283
+ dst.dirname.mkpath
284
+
285
+ self.log.debug " %p -> %p" % [ asset, dst ]
286
+ install asset, dst, :mode => 0644
287
+ end
288
+ end
289
+ end
290
+ end
291
+
292
+
293
+ #########
294
+ protected
295
+ #########
296
+
297
+ ### Return an Array of Pathname objects for each file/directory in the
298
+ ### list of static assets that should be copied into the output directory.
299
+ def find_static_assets
300
+ paths = self.options.static_path || []
301
+ self.log.debug "Finding asset paths. Static paths: %p" % [ paths ]
302
+
303
+ # Add each subdirectory of the template dir
304
+ self.log.debug " adding directories under %s" % [ self.template_dir ]
305
+ paths << self.template_dir
306
+ self.log.debug " paths are now: %p" % [ paths ]
307
+
308
+ return paths.flatten.compact.uniq
309
+ end
310
+
311
+
312
+ ### Return a list of the documented modules sorted by salience first, then
313
+ ### by name.
314
+ def get_sorted_module_list(classes)
315
+ nscounts = classes.inject({}) do |counthash, klass|
316
+ top_level = klass.full_name.gsub( /::.*/, '' )
317
+ counthash[top_level] ||= 0
318
+ counthash[top_level] += 1
319
+
320
+ counthash
321
+ end
322
+
323
+ # Sort based on how often the top level namespace occurs, and then on the
324
+ # name of the module -- this works for projects that put their stuff into
325
+ # a namespace, of course, but doesn't hurt if they don't.
326
+ classes.sort_by do |klass|
327
+ top_level = klass.full_name.gsub( /::.*/, '' )
328
+ [nscounts[top_level] * -1, klass.full_name]
329
+ end.select do |klass|
330
+ klass.display?
331
+ end
332
+ end
333
+
334
+
335
+ ### Fetch the template with the specified +name+ from the cache or load it
336
+ ### and cache it.
337
+ def load_template( name )
338
+ unless @template_cache.key?( name )
339
+ @template_cache[ name ] = Inversion::Template.load( name, encoding:'utf-8' )
340
+ end
341
+
342
+ return @template_cache[ name ].dup
343
+ end
344
+
345
+
346
+ ### Load the layout template and return it after setting any values it needs.
347
+ def load_layout_template
348
+ template = self.load_template( 'layout.tmpl' )
349
+
350
+ template.files = @files
351
+ template.classes = @classes
352
+ template.methods = @methods
353
+ template.modsort = @modsort
354
+ template.rdoc_options = @options
355
+
356
+ template.rdoc_version = RDoc::VERSION
357
+ template.fivefish_version = Fivefish.version_string
358
+
359
+ return template
360
+ end
361
+
362
+
330
363
  ### Return a list of CodeObjects that belong in the index.
331
364
  def get_indexable_objects
332
365
  objs = []
@@ -339,6 +372,30 @@ class RDoc::Generator::Fivefish
339
372
  end
340
373
 
341
374
 
375
+ ### Extract a synopsis for the project from the specified +mainpage+ and
376
+ ### return it as a String.
377
+ def extract_synopsis( mainpage )
378
+ desc = mainpage.description
379
+ heading = desc[ %r{(<h1.*?/h1>)}im ]
380
+ paras = desc.scan( %r{<p\b.*?/p>}im )
381
+
382
+ first_para = paras.map( &:strip ).find do |para|
383
+ # Discard paragraphs consisting only of a link
384
+ !( para.start_with?('<p><a') && para.end_with?('/a></p>') )
385
+ end
386
+
387
+ return heading + first_para
388
+ end
389
+
342
390
  end # class RDoc::Generator::Fivefish
343
391
 
344
392
 
393
+ # Reopen to add custom option attrs.
394
+ class RDoc::Options
395
+
396
+ ##
397
+ # Allow setting a custom stylesheet
398
+ attr_accessor :additional_stylesheet
399
+
400
+ end
401
+
metadata CHANGED
@@ -1,63 +1,68 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc-generator-fivefish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
5
- prerelease:
4
+ version: 0.1.0.pre.87
6
5
  platform: ruby
7
6
  authors:
8
7
  - Michael Granger
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain:
12
- - !binary |-
13
- LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURMRENDQWhTZ0F3SUJB
14
- Z0lCQURBTkJna3Foa2lHOXcwQkFRVUZBREE4TVF3d0NnWURWUVFEREFOblpX
15
- UXgKRnpBVkJnb0praWFKay9Jc1pBRVpGZ2RmWVdWeWFXVmZNUk13RVFZS0Na
16
- SW1pWlB5TEdRQkdSWURiM0puTUI0WApEVEV3TURreE5qRTBORGcxTVZvWERU
17
- RXhNRGt4TmpFME5EZzFNVm93UERFTU1Bb0dBMVVFQXd3RFoyVmtNUmN3CkZR
18
- WUtDWkltaVpQeUxHUUJHUllIWDJGbGNtbGxYekVUTUJFR0NnbVNKb21UOGl4
19
- a0FSa1dBMjl5WnpDQ0FTSXcKRFFZSktvWklodmNOQVFFQkJRQURnZ0VQQURD
20
- Q0FRb0NnZ0VCQUx5Ly9CRnhDMWYvY1BTbnd0SkJXb0ZpRnJpcgpoN1JpY0kr
21
- am9xL29jVlhRcUk0VERXUHlGLzh0cWt2dCtyRDk5WDlxczJZZVI4Q1UvWWlJ
22
- cExXclFPWVNUNzBKCnZEbjdVdmhiMm11RlZxcTYrdm9iZVRrSUxCRU82cGlv
23
- bldERzhqU2JvM3FLbTFSaktKRHdnOXA0d05LaFB1dTgKS0d1ZS9CRmI2N0tm
24
- bHF5QX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GQyhP1x34YpLAaly8icbns/8PqOf7Osn9ztmg8bOMJCeb32eQLj
30
+ 6mKCwjpegytE0oifXfF8k75A9105cBnNiMZOe1tXiqYc/exCgWvbggurzDOcRkZu
31
+ /YSusaiDXHKU2O3Akc3htA==
32
+ -----END CERTIFICATE-----
33
+ date: 2013-03-25 00:00:00.000000000 Z
40
34
  dependencies:
41
35
  - !ruby/object:Gem::Dependency
42
36
  name: inversion
43
37
  requirement: !ruby/object:Gem::Requirement
44
- none: false
45
38
  requirements:
46
39
  - - ~>
47
40
  - !ruby/object:Gem::Version
48
- version: '0.10'
41
+ version: '0.12'
49
42
  type: :runtime
50
43
  prerelease: false
51
44
  version_requirements: !ruby/object:Gem::Requirement
52
- none: false
53
45
  requirements:
54
46
  - - ~>
55
47
  - !ruby/object:Gem::Version
56
- version: '0.10'
48
+ version: '0.12'
49
+ - !ruby/object:Gem::Dependency
50
+ name: loggability
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: '0.6'
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ~>
61
+ - !ruby/object:Gem::Version
62
+ version: '0.6'
57
63
  - !ruby/object:Gem::Dependency
58
64
  name: yajl-ruby
59
65
  requirement: !ruby/object:Gem::Requirement
60
- none: false
61
66
  requirements:
62
67
  - - ~>
63
68
  - !ruby/object:Gem::Version
@@ -65,7 +70,6 @@ dependencies:
65
70
  type: :runtime
66
71
  prerelease: false
67
72
  version_requirements: !ruby/object:Gem::Requirement
68
- none: false
69
73
  requirements:
70
74
  - - ~>
71
75
  - !ruby/object:Gem::Version
@@ -73,23 +77,20 @@ dependencies:
73
77
  - !ruby/object:Gem::Dependency
74
78
  name: rdoc
75
79
  requirement: !ruby/object:Gem::Requirement
76
- none: false
77
80
  requirements:
78
81
  - - ~>
79
82
  - !ruby/object:Gem::Version
80
- version: '3.12'
83
+ version: '4.0'
81
84
  type: :runtime
82
85
  prerelease: false
83
86
  version_requirements: !ruby/object:Gem::Requirement
84
- none: false
85
87
  requirements:
86
88
  - - ~>
87
89
  - !ruby/object:Gem::Version
88
- version: '3.12'
90
+ version: '4.0'
89
91
  - !ruby/object:Gem::Dependency
90
92
  name: hoe-mercurial
91
93
  requirement: !ruby/object:Gem::Requirement
92
- none: false
93
94
  requirements:
94
95
  - - ~>
95
96
  - !ruby/object:Gem::Version
@@ -97,7 +98,6 @@ dependencies:
97
98
  type: :development
98
99
  prerelease: false
99
100
  version_requirements: !ruby/object:Gem::Requirement
100
- none: false
101
101
  requirements:
102
102
  - - ~>
103
103
  - !ruby/object:Gem::Version
@@ -105,7 +105,6 @@ dependencies:
105
105
  - !ruby/object:Gem::Dependency
106
106
  name: hoe-highline
107
107
  requirement: !ruby/object:Gem::Requirement
108
- none: false
109
108
  requirements:
110
109
  - - ~>
111
110
  - !ruby/object:Gem::Version
@@ -113,15 +112,27 @@ dependencies:
113
112
  type: :development
114
113
  prerelease: false
115
114
  version_requirements: !ruby/object:Gem::Requirement
116
- none: false
117
115
  requirements:
118
116
  - - ~>
119
117
  - !ruby/object:Gem::Version
120
118
  version: 0.1.0
119
+ - !ruby/object:Gem::Dependency
120
+ name: hoe-deveiate
121
+ requirement: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: '0.2'
126
+ type: :development
127
+ prerelease: false
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ~>
131
+ - !ruby/object:Gem::Version
132
+ version: '0.2'
121
133
  - !ruby/object:Gem::Dependency
122
134
  name: uglifier
123
135
  requirement: !ruby/object:Gem::Requirement
124
- none: false
125
136
  requirements:
126
137
  - - ~>
127
138
  - !ruby/object:Gem::Version
@@ -129,7 +140,6 @@ dependencies:
129
140
  type: :development
130
141
  prerelease: false
131
142
  version_requirements: !ruby/object:Gem::Requirement
132
- none: false
133
143
  requirements:
134
144
  - - ~>
135
145
  - !ruby/object:Gem::Version
@@ -137,7 +147,6 @@ dependencies:
137
147
  - !ruby/object:Gem::Dependency
138
148
  name: less
139
149
  requirement: !ruby/object:Gem::Requirement
140
- none: false
141
150
  requirements:
142
151
  - - ~>
143
152
  - !ruby/object:Gem::Version
@@ -145,7 +154,6 @@ dependencies:
145
154
  type: :development
146
155
  prerelease: false
147
156
  version_requirements: !ruby/object:Gem::Requirement
148
- none: false
149
157
  requirements:
150
158
  - - ~>
151
159
  - !ruby/object:Gem::Version
@@ -153,27 +161,23 @@ dependencies:
153
161
  - !ruby/object:Gem::Dependency
154
162
  name: hoe
155
163
  requirement: !ruby/object:Gem::Requirement
156
- none: false
157
164
  requirements:
158
165
  - - ~>
159
166
  - !ruby/object:Gem::Version
160
- version: '3.0'
167
+ version: '3.5'
161
168
  type: :development
162
169
  prerelease: false
163
170
  version_requirements: !ruby/object:Gem::Requirement
164
- none: false
165
171
  requirements:
166
172
  - - ~>
167
173
  - !ruby/object:Gem::Version
168
- version: '3.0'
169
- description: ! 'A(nother) HTML(5) generator for RDoc.
170
-
174
+ version: '3.5'
175
+ description: |-
176
+ A(nother) HTML(5) generator for RDoc.
171
177
 
172
178
  It uses {Twitter Bootstrap}[http://twitter.github.com/bootstrap/] for the
173
-
174
- pretty, doesn''t take up valuable horizontal real estate space with indexes
175
-
176
- and stuff, and has a QuickSilver-like incremental searching.'
179
+ pretty, doesn't take up valuable horizontal real estate space with indexes
180
+ and stuff, and has a QuickSilver-like incremental searching.
177
181
  email:
178
182
  - ged@FaerieMUD.org
179
183
  executables: []
@@ -209,9 +213,11 @@ files:
209
213
  - lib/fivefish.rb
210
214
  - lib/rdoc/discover.rb
211
215
  - lib/rdoc/generator/fivefish.rb
216
+ - .gemtest
212
217
  homepage: http://deveiate.org/fivefish.html
213
218
  licenses:
214
219
  - BSD
220
+ metadata: {}
215
221
  post_install_message:
216
222
  rdoc_options:
217
223
  - --main
@@ -219,21 +225,19 @@ rdoc_options:
219
225
  require_paths:
220
226
  - lib
221
227
  required_ruby_version: !ruby/object:Gem::Requirement
222
- none: false
223
228
  requirements:
224
- - - ! '>='
229
+ - - '>='
225
230
  - !ruby/object:Gem::Version
226
231
  version: 1.9.3
227
232
  required_rubygems_version: !ruby/object:Gem::Requirement
228
- none: false
229
233
  requirements:
230
- - - ! '>='
234
+ - - '>='
231
235
  - !ruby/object:Gem::Version
232
236
  version: '0'
233
237
  requirements: []
234
238
  rubyforge_project: rdoc-generator-fivefish
235
- rubygems_version: 1.8.24
239
+ rubygems_version: 2.0.3
236
240
  signing_key:
237
- specification_version: 3
241
+ specification_version: 4
238
242
  summary: A(nother) HTML(5) generator for RDoc
239
243
  test_files: []
metadata.gz.sig CHANGED
Binary file