yard 0.6.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of yard might be problematic. Click here for more details.

data/ChangeLog CHANGED
@@ -1,5 +1,98 @@
1
+ 2010-09-06 Loren Segal <lsegal@soen.ca>
2
+
3
+ * ChangeLog, README.md, lib/yard.rb, yard.gemspec: Bump to version 0.6.1
4
+
5
+ * templates/default/fulldoc/html/js/app.js: Fix TOC id links to include some
6
+ punctuation and digits
7
+
8
+ * spec/code_objects/base_spec.rb: Add spec for relative_path
9
+
10
+ * templates/default/fulldoc/html/css/style.css,
11
+ templates/default/fulldoc/html/js/app.js: Refactor inheritance arrow and
12
+ inheritance box display code
13
+
14
+ * lib/yard/code_objects/base.rb, spec/code_objects/base_spec.rb: Fix relative
15
+ path linking with common substrings
16
+
17
+ * lib/yard/tags/default_factory.rb: Gracefully error out if @example tag is
18
+ misformatted
19
+
20
+ 2010-09-03 Loren Segal <lsegal@soen.ca>
21
+
22
+ * spec/templates/helpers/html_helper_spec.rb: Fix broken spec of #link_object
23
+
24
+ 2010-09-03 Arthur Schreiber <schreiber.arthur@gmail.com>
25
+
26
+ * spec/registry_store_spec.rb: Update specs to match reading marshal data as
27
+ binary.
28
+
29
+ 2010-09-02 Loren Segal <lsegal@soen.ca>
30
+
31
+ * lib/yard/parser/source_parser.rb: Fix printing of debugging information
32
+ when displaying parser paths in 1.8.x
33
+
34
+ 2010-09-02 Arthur Schreiber <schreiber.arthur@gmail.com>
35
+
36
+ * lib/yard/registry_store.rb: Fix remaining cases where Marshal data was not
37
+ read as binary.
38
+
39
+ 2010-09-02 Loren Segal <lsegal@soen.ca>
40
+
41
+ * lib/yard/code_objects/base.rb, spec/code_objects/base_spec.rb: Fix matching
42
+ of common namespace in Base#relative_path
43
+
44
+ 2010-09-01 Loren Segal <lsegal@soen.ca>
45
+
46
+ * templates/default/fulldoc/html/css/full_list.css,
47
+ templates/default/fulldoc/html/js/full_list.js: Improve inline JS search
48
+ responsiveness on large lists
49
+
50
+ 2010-09-01 Arthur Schreiber <schreiber.arthur@gmail.com>
51
+
52
+ * lib/yard/serializers/yardoc_serializer.rb, spec/registry_store_spec.rb: Fix
53
+ #168 - open files with serialized contents in binary mode.
54
+
55
+ 2010-09-01 Loren Segal <lsegal@soen.ca>
56
+
57
+ * lib/yard/code_objects/base.rb, spec/code_objects/base_spec.rb,
58
+ spec/templates/helpers/html_helper_spec.rb: Fix
59
+ CodeObjects::Base#relative_path to work with parent namespaces and methods in
60
+ sibling namespaces
61
+
62
+ * lib/yard/code_objects/proxy.rb: Fix proxy implementation of name to match
63
+ Base#name
64
+
65
+ 2010-08-31 Loren Segal <lsegal@soen.ca>
66
+
67
+ * lib/yard/registry.rb, lib/yard/server/commands/search_command.rb: Avoid
68
+ exception when Registry.at(nil) is accessed (for search command)
69
+
70
+ * lib/yard/server/rack_adapter.rb: Print startup message for `yard server` if
71
+ Mongrel is being used
72
+
73
+ * lib/yard/server/rack_adapter.rb: Remove trap(INT) and server.shutdown, Rack
74
+ does this on its own. Closes gh-165
75
+
76
+ * lib/yard/core_ext/string.rb, spec/core_ext/string_spec.rb,
77
+ spec/spec_helper.rb: Removed String#underscore and String#camelcase. These
78
+ methods were not being used in YARD's codebase (minus a few small utility
79
+ functions) and they were causing incompatibility issues with other frameworks
80
+ like Rails. Closes gh-167
81
+
82
+ 2010-08-30 Loren Segal <lsegal@soen.ca>
83
+
84
+ * templates/default/fulldoc/html/css/style.css: Put class list above ToC
85
+ (take 2) Closes gh-164
86
+
1
87
  2010-08-29 Loren Segal <lsegal@soen.ca>
2
88
 
89
+ * templates/default/fulldoc/html/css/style.css: Lower z-index so class list
90
+ shows up above
91
+
92
+ * yard.gemspec: Update release date in gemspec
93
+
94
+ * ChangeLog: Update ChangeLog
95
+
3
96
  * templates/default/fulldoc/html/css/style.css: Fix positioning for TOC
4
97
 
5
98
  * lib/yard/templates/helpers/html_helper.rb: Fix encoding issue where
data/README.md CHANGED
@@ -8,8 +8,8 @@ YARD: Yay! A Ruby Documentation Tool
8
8
  **Contributors**: See Contributors section below
9
9
  **Copyright**: 2007-2010
10
10
  **License**: MIT License
11
- **Latest Version**: 0.6.0 (codename "The Cubic")
12
- **Release Date**: August 29th 2010
11
+ **Latest Version**: 0.6.1 (codename "The Cubic")
12
+ **Release Date**: September 6th 2010
13
13
 
14
14
  Synopsis
15
15
  --------
@@ -288,7 +288,16 @@ More options can be seen by typing `yard-graph --help`, but here is an example:
288
288
  Changelog
289
289
  ---------
290
290
 
291
- - **August.28.10**: 0.6.0 release
291
+ - **September.06.10**: 0.6.1 release
292
+ - Fixed TOC showing on top of class/method list in no-frames view
293
+ - A message now displays when running `yard server` with Rack/Mongrel installed
294
+ - Improved performance of JS inline search for large class/method lists
295
+ - Improved link titles for relative object links
296
+ - Removed `String#camelcase` and `String#underscore` for better Rails compat.
297
+ - Fixed support for loading .yardoc files under Windows
298
+ - Fixed inheritance tree arrows not displaying in certain environments
299
+
300
+ - **August.29.10**: 0.6.0 release
292
301
  - Added dynamic local documentation server
293
302
  - Added @group/@endgroup declarations to organize methods into groups
294
303
  - Added `yard` executable to serve as main CLI tool with pluggable commands
data/lib/yard.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module YARD
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
 
4
4
  # The root path for YARD source libraries
5
5
  ROOT = File.expand_path(File.dirname(__FILE__))
@@ -402,7 +402,11 @@ module YARD
402
402
  def relative_path(other)
403
403
  other = other.path if other.respond_to?(:path)
404
404
  return other unless namespace
405
- other.gsub(/^#{Regexp.quote namespace.path}(::|\.)?/, '')
405
+ common = [path, other].join(" ").match(/^(\S*)\S*(?: \1\S*)*$/)[1]
406
+ common = path unless common =~ /(\.|::|#)$/
407
+ common = common.sub(/(\.|::|#)[^:#\.]*?$/, '')
408
+ result = other.sub(/^#{Regexp.quote common}(::|\.|)?/, '')
409
+ result.empty? ? other : result
406
410
  end
407
411
 
408
412
  # Renders the object using the {Templates::Engine templating system}.
@@ -18,7 +18,7 @@ module YARD
18
18
  class Proxy
19
19
  def self.===(other) other.is_a?(self) end
20
20
 
21
- attr_reader :namespace, :name
21
+ attr_reader :namespace
22
22
  alias_method :parent, :namespace
23
23
 
24
24
  # Creates a new Proxy
@@ -59,6 +59,11 @@ module YARD
59
59
  @namespace = Registry.root
60
60
  end
61
61
  end
62
+
63
+ # (see Base#name)
64
+ def name(prefix = false)
65
+ prefix ? (@imethod ? ISEP : '') + @name.to_s : @name
66
+ end
62
67
 
63
68
  # Returns a text representation of the Proxy
64
69
  # @return [String] the object's #inspect method or P(OBJECTPATH)
@@ -1,25 +1,4 @@
1
1
  class String
2
- # Separates capital letters following lower case letters by an underscore
3
- # and returns the entire string in lower case
4
- #
5
- # @example
6
- # "FooBar".underscore # => "foo_bar"
7
- # "Foo::Bar".underscore # => "foo/bar"
8
- # @return [String] the underscored lower case string
9
- def underscore
10
- gsub(/([a-z])([A-Z])/, '\1_\2').downcase.gsub('::', '/')
11
- end
12
-
13
- # Camel cases any underscored text.
14
- #
15
- # @example
16
- # "foo_bar_baz".camelcase # => "FooBarBaz"
17
- # "foo/bar".camelcase # => "Foo::Bar"
18
- # @return [String] the camel cased text
19
- def camelcase
20
- gsub(/\/(.?)/) { "::" + $1.upcase }.gsub(/(?:^|_)(.)/) { $1.upcase }
21
- end
22
-
23
2
  # Splits text into tokens the way a shell would, handling quoted
24
3
  # text as a single token. Use '\"' and "\'" to escape quotes and
25
4
  # '\\' to escape a backslash.
@@ -48,7 +48,7 @@ module YARD
48
48
  # {YARD::Logger}
49
49
  # @return the parser object that was used to parse the source.
50
50
  def parse(paths = ["lib/**/*.rb", "ext/**/*.c"], excluded = [], level = log.level)
51
- log.debug("Parsing #{paths} with `#{parser_type}` parser")
51
+ log.debug("Parsing #{paths.inspect} with `#{parser_type}` parser")
52
52
  excluded = excluded.map do |path|
53
53
  case path
54
54
  when Regexp; path
data/lib/yard/registry.rb CHANGED
@@ -215,7 +215,7 @@ module YARD
215
215
  # returns the {root} object.
216
216
  # @return [CodeObjects::Base] the object at path
217
217
  # @return [nil] if no object is found
218
- def at(path) @store[path] end
218
+ def at(path) path ? @store[path] : nil end
219
219
  alias_method :[], :at
220
220
 
221
221
  # The root namespace object.
@@ -198,14 +198,14 @@ module YARD
198
198
  end
199
199
 
200
200
  def load_yardoc_old
201
- @store, @proxy_types = *Marshal.load(File.read(@file))
201
+ @store, @proxy_types = *Marshal.load(File.read_binary(@file))
202
202
  end
203
203
 
204
204
  private
205
205
 
206
206
  def load_proxy_types
207
207
  return unless File.file?(proxy_types_path)
208
- @proxy_types = Marshal.load(File.read(proxy_types_path))
208
+ @proxy_types = Marshal.load(File.read_binary(proxy_types_path))
209
209
  end
210
210
 
211
211
  def load_checksums
@@ -68,7 +68,7 @@ module YARD
68
68
  path = File.join(basepath, serialized_path(path)) unless is_path
69
69
  if File.file?(path)
70
70
  log.debug "Deserializing #{path}..."
71
- Marshal.load(File.read(path))
71
+ Marshal.load(File.read_binary(path))
72
72
  else
73
73
  log.debug "Could not find #{path}"
74
74
  nil
@@ -7,7 +7,7 @@ module YARD
7
7
  def run
8
8
  Registry.load_all
9
9
  self.query = request.query['q']
10
- redirect("/#{adapter.router.docs_prefix}/#{single_library ? library : ''}") if query =~ /\A\s*\Z/
10
+ redirect("/#{adapter.router.docs_prefix}/#{single_library ? library : ''}") if query.nil? || query =~ /\A\s*\Z/
11
11
  if found = Registry.at(query)
12
12
  redirect(serializer.serialized_path(found))
13
13
  end
@@ -24,9 +24,21 @@ module YARD
24
24
  def start
25
25
  server = Rack::Server.new(server_options)
26
26
  server.instance_variable_set("@app", self)
27
- trap("INT") { server.shutdown }
27
+ print_start_message(server)
28
28
  server.start
29
29
  end
30
+
31
+ private
32
+
33
+ def print_start_message(server)
34
+ opts = server.default_options.merge(server.options)
35
+ puts ">> YARD #{YARD::VERSION} documentation server at http://#{opts[:Host]}:#{opts[:Port]}"
36
+
37
+ # Only happens for Mongrel
38
+ return unless server.server.to_s == "Rack::Handler::Mongrel"
39
+ puts ">> #{server.server.class_name} web server (running on Rack)"
40
+ puts ">> Listening on #{opts[:Host]}:#{opts[:Port]}, CTRL+C to stop"
41
+ end
30
42
  end
31
43
  end
32
44
  end
@@ -82,6 +82,7 @@ module YARD
82
82
  end
83
83
 
84
84
  def extract_title_and_desc_from_text(text)
85
+ raise TagFormatError if text.nil? || text.empty?
85
86
  title, desc = nil, nil
86
87
  if text =~ /\A[ \t]\n/
87
88
  desc = text
@@ -229,21 +229,40 @@ describe YARD::CodeObjects::Base do
229
229
  it "should return the relative path when they share a common namespace" do
230
230
  YARD.parse_string "module A; class B; end; class C; end; end"
231
231
  Registry.at('A::B').relative_path(Registry.at('A::C')).should == 'C'
232
+ YARD.parse_string "module Foo; module A; end; module B; def foo; end end end"
233
+ Registry.at('Foo::A').relative_path(Registry.at('Foo::B#foo')).should == 'B#foo'
232
234
  end
233
235
 
234
236
  it "should return the full path if they don't have a common namespace" do
235
237
  YARD.parse_string "module A; class B; end; end; module D; class C; end; end"
236
238
  Registry.at('A::B').relative_path('D::C').should == 'D::C'
239
+ YARD.parse_string 'module C::B::C; module Apple; end; module Ant; end end'
240
+ Registry.at('C::B::C::Apple').relative_path('C::B::C::Ant').should == 'Ant'
241
+ YARD.parse_string 'module OMG::ABC; end; class Object; end'
242
+ Registry.at('OMG::ABC').relative_path('Object').should == "Object"
237
243
  end
238
244
 
239
245
  it "should return a relative path for class methods" do
240
246
  YARD.parse_string "module A; def self.b; end; def self.c; end; end"
241
247
  Registry.at('A.b').relative_path('A.c').should == 'c'
248
+ Registry.at('A').relative_path('A.c').should == 'c'
242
249
  end
243
250
 
244
251
  it "should return a relative path for instance methods" do
245
252
  YARD.parse_string "module A; def b; end; def c; end; end"
246
253
  Registry.at('A#b').relative_path('A#c').should == '#c'
254
+ Registry.at('A').relative_path('A#c').should == '#c'
255
+ end
256
+
257
+ it "should return full path if relative path is to parent namespace" do
258
+ YARD.parse_string "module A; module B; end end"
259
+ Registry.at('A::B').relative_path('A').should == 'A'
260
+ end
261
+
262
+ it "should only return name for relative path to self" do
263
+ YARD.parse_string("class A::B::C; def foo; end end")
264
+ Registry.at('A::B::C').relative_path('A::B::C').should == 'C'
265
+ Registry.at('A::B::C#foo').relative_path('A::B::C#foo').should == '#foo'
247
266
  end
248
267
  end
249
268
 
@@ -4,30 +4,6 @@ require File.dirname(__FILE__) + '/../spec_helper'
4
4
  #described_in_docs String, '#underscore'
5
5
 
6
6
  describe String do
7
- describe '#underscore' do
8
- it 'should turn HelloWorld into hello_world' do
9
- "HelloWorld".underscore.should == "hello_world"
10
- end
11
-
12
- it "should turn Hello::World into hello/world" do
13
- "Hello::World".underscore.should == "hello/world"
14
- end
15
- end
16
-
17
- describe '#camelcase' do
18
- it 'should turn hello_world into HelloWorld' do
19
- "hello_world".camelcase.should == "HelloWorld"
20
- end
21
-
22
- it "should turn hello/world into Hello::World" do
23
- "hello/world".camelcase.should == "Hello::World"
24
- end
25
-
26
- it "should not camelcase _foo" do
27
- "_foo".camelcase.should == "_foo"
28
- end
29
- end
30
-
31
7
  describe '#shell_split' do
32
8
  it "should split simple non-quoted text" do
33
9
  "a b c".shell_split.should == %w(a b c)
@@ -7,7 +7,7 @@ describe YARD::RegistryStore do
7
7
  it "should load old yardoc format if .yardoc is a file" do
8
8
  File.should_receive(:directory?).with('foo').and_return(false)
9
9
  File.should_receive(:file?).with('foo').and_return(true)
10
- File.should_receive(:read).with('foo').and_return('FOO')
10
+ File.should_receive(:read_binary).with('foo').and_return('FOO')
11
11
  Marshal.should_receive(:load).with('FOO')
12
12
 
13
13
  @store.load('foo')
@@ -25,7 +25,7 @@ describe YARD::RegistryStore do
25
25
  it "should return true if .yardoc is loaded (file)" do
26
26
  File.should_receive(:directory?).with('myyardoc').and_return(false)
27
27
  File.should_receive(:file?).with('myyardoc').and_return(true)
28
- File.should_receive(:read).with('myyardoc').and_return(Marshal.dump(''))
28
+ File.should_receive(:read_binary).with('myyardoc').and_return(Marshal.dump(''))
29
29
  @store.load('myyardoc').should == true
30
30
  end
31
31
 
@@ -62,7 +62,7 @@ describe YARD::RegistryStore do
62
62
  File.should_receive(:file?).with('foo/checksums').and_return(false)
63
63
  File.should_receive(:file?).with('foo/proxy_types').and_return(true)
64
64
  File.should_receive(:file?).with('foo/objects/root.dat').and_return(false)
65
- File.should_receive(:read).with('foo/proxy_types').and_return(Marshal.dump({'a' => 'b'}))
65
+ File.should_receive(:read_binary).with('foo/proxy_types').and_return(Marshal.dump({'a' => 'b'}))
66
66
  @store.load('foo').should == true
67
67
  @store.proxy_types.should == {'a' => 'b'}
68
68
  end
@@ -72,7 +72,7 @@ describe YARD::RegistryStore do
72
72
  File.should_receive(:file?).with('foo/checksums').and_return(false)
73
73
  File.should_receive(:file?).with('foo/proxy_types').and_return(false)
74
74
  File.should_receive(:file?).with('foo/objects/root.dat').and_return(true)
75
- File.should_receive(:read).with('foo/objects/root.dat').and_return(Marshal.dump('foo'))
75
+ File.should_receive(:read_binary).with('foo/objects/root.dat').and_return(Marshal.dump('foo'))
76
76
  @store.load('foo').should == true
77
77
  @store.root.should == 'foo'
78
78
  end
data/spec/spec_helper.rb CHANGED
@@ -17,7 +17,8 @@ def described_in_docs(klass, meth, file = nil)
17
17
  filename = File.join(YARD::ROOT, file)
18
18
  YARD::Parser::SourceParser.new.parse(filename)
19
19
  else
20
- $".find_all {|p| p.include? klass.class_name.underscore }.each do |filename|
20
+ underscore = klass.class_name.gsub(/([a-z])([A-Z])/, '\1_\2').downcase.gsub('::', '/')
21
+ $".find_all {|p| p.include? underscore }.each do |filename|
21
22
  next unless File.exists? filename
22
23
  YARD::Parser::SourceParser.new.parse(filename)
23
24
  end
@@ -47,7 +48,8 @@ end
47
48
 
48
49
  def docspec(objname = self.class.description, klass = self.class.described_type)
49
50
  # Parse the file (could be multiple files)
50
- $".find_all {|p| p.include? klass.class_name.underscore }.each do |filename|
51
+ underscore = klass.class_name.gsub(/([a-z])([A-Z])/, '\1_\2').downcase.gsub('::', '/')
52
+ $".find_all {|p| p.include? underscore }.each do |filename|
51
53
  filename = File.join(YARD::ROOT, filename)
52
54
  next unless File.exists? filename
53
55
  YARD::Parser::SourceParser.new.parse(filename)
@@ -152,6 +152,15 @@ describe YARD::Templates::Helpers::HtmlHelper do
152
152
  stub!(:serializer).and_return(serializer)
153
153
  link_object("Bar").should =~ %r{>Bar</a>}
154
154
  end
155
+
156
+ it "should use relative path to parent class in title" do
157
+ root = CodeObjects::ModuleObject.new(:root, :YARD)
158
+ obj = CodeObjects::ModuleObject.new(root, :SubModule)
159
+ stub!(:object).and_return(obj)
160
+ serializer = Serializers::FileSystemSerializer.new
161
+ stub!(:serializer).and_return(serializer)
162
+ link_object("YARD").should =~ %r{>YARD</a>}
163
+ end
155
164
  end
156
165
 
157
166
  describe '#url_for' do
@@ -8,11 +8,13 @@ body {
8
8
 
9
9
  h1 { padding: 12px 10px; padding-bottom: 0; margin: 0; font-size: 1.4em; }
10
10
  .clear { clear: both; }
11
- #search { position: absolute; right: 5px; top: 9px; }
11
+ #search { position: absolute; right: 5px; top: 9px; padding-left: 24px; }
12
+ #content.insearch #search, #content.insearch #noresults { background: url(data:image/gif;base64,R0lGODlhEAAQAPYAAP///wAAAPr6+pKSkoiIiO7u7sjIyNjY2J6engAAAI6OjsbGxjIyMlJSUuzs7KamppSUlPLy8oKCghwcHLKysqSkpJqamvT09Pj4+KioqM7OzkRERAwMDGBgYN7e3ujo6Ly8vCoqKjY2NkZGRtTU1MTExDw8PE5OTj4+PkhISNDQ0MrKylpaWrS0tOrq6nBwcKysrLi4uLq6ul5eXlxcXGJiYoaGhuDg4H5+fvz8/KKiohgYGCwsLFZWVgQEBFBQUMzMzDg4OFhYWBoaGvDw8NbW1pycnOLi4ubm5kBAQKqqqiQkJCAgIK6urnJyckpKSjQ0NGpqatLS0sDAwCYmJnx8fEJCQlRUVAoKCggICLCwsOTk5ExMTPb29ra2tmZmZmhoaNzc3KCgoBISEiIiIgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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1wJwSkHNDU3D0kJYIMZQwk8MjPBLx9eXwuETVEyAC/BOKsuEjYFhoEAIfkECQgAAAAsAAAAABAAEAAAB2eAAIKDhIWGgiUlh4MRgyQkjIURGRiGGBmNhJWHm4ueICImip6CIQkJKJ4kigynKaqKCyMnKqSEK05StgAGQRxPYZaENqccFgIID4KXmQBhXFkzDgOnFYLNgltaSAAEpxa7BQoQF4aBACH5BAkIAAAALAAAAAAQABAAAAdogACCg4SFggJiPUqCJSWGgkZjCUwZACQkgxGEXAmdT4UYGZqCGWQ+IjKGGIUwPzGPhAc0NTewhDOdL7Ykji+dOLuOLhI2BbaFETICx4MlQitdqoUsCQ2vhKGjglNfU0SWmILaj43M5oEAOwAAAAAAAAAAAA==) no-repeat center left; }
12
13
  #full_list { padding: 0; list-style: none; margin-left: 0; }
13
14
  #full_list ul { padding: 0; }
14
15
  #full_list li { padding: 5px; padding-left: 12px; margin: 0; font-size: 1.1em; list-style: none; }
15
- #noresults { display: none; padding: 7px 12px; }
16
+ #noresults { padding: 7px 12px; }
17
+ #content.insearch #noresults { margin-left: 7px; }
16
18
  ul.collapsed ul, ul.collapsed li { display: none; }
17
19
  li a.toggle { cursor: default; position: relative; left: -5px; top: 4px; text-indent: -999px; width: 10px; height: 9px; margin-left: -10px; display: block; float: left; background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAK8AAACvABQqw0mAAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTM5jWRgMAAAAVdEVYdENyZWF0aW9uIFRpbWUAMy8xNC8wOeNZPpQAAAE2SURBVDiNrZTBccIwEEXfelIAHUA6CZ24BGaWO+FuzZAK4k6gg5QAdGAq+Bxs2Yqx7BzyL7Llp/VfzZeQhCTc/ezuGzKKnKSzpCxXJM8fwNXda3df5RZETlIt6YUzSQDs93sl8w3wBZxCCE10GM1OcWbWjB2mWgEH4Mfdyxm3PSepBHibgQE2wLe7r4HjEidpnXMYdQPKEMJcsZ4zs2POYQOcaPfwMVOo58zsAdMt18BuoVDPxUJRacELbXv3hUIX2vYmOUvi8C8ydz/ThjXrqKqqLbDIAdsCKBd+Wo7GWa7o9qzOQHVVVXeAbs+yHHCH4aTsaCOQqunmUy1yBUAXkdMIfMlgF5EXLo2OpV/c/Up7jG4hhHcYLgWzAZXUc2b2ixsfvc/RmNNfOXD3Q/oeL9axJE1yT9IOoUu6MGUkAAAAAElFTkSuQmCC) no-repeat bottom left; }
18
20
  li.collapsed a.toggle { opacity: 0.5; cursor: default; background-position: top left; }
@@ -40,7 +42,8 @@ li.collapsed.clicked a.toggle { background-position: top right; }
40
42
  .frames li small:before { content: ""; }
41
43
  .frames li small:after { content: ""; }
42
44
  .frames li small.search_info { display: none; }
43
- .frames #search { position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; }
45
+ .frames #search { width: 170px; position: static; margin: 3px; margin-left: 10px; font-size: 0.9em; color: #888; padding-left: 0; padding-right: 24px; }
46
+ .frames #content.insearch #search { background-position: center right; }
44
47
  .frames #search input { width: 110px; }
45
48
  .frames #nav { display: block; }
46
49
 
@@ -183,8 +183,11 @@ p.children strong.modules { padding-left: 5px; }
183
183
 
184
184
  ul.fullTree { display: none; padding-left: 0; list-style: none; margin-left: 0; margin-bottom: 10px; }
185
185
  ul.fullTree ul { margin-left: 0; padding-left: 0; list-style: none; }
186
- ul.fullTree li { text-align: center; }
187
- ul.fullTree li.next:before { font-size: 1.2em; content: '\2B06'; color: #bbb; display: block; margin-top: 3px; }
186
+ ul.fullTree li { text-align: center; padding-top: 18px; padding-bottom: 12px; background: url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodk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u72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAHtJREFUeNqMzrEJAkEURdGzuhgZbSoYWcAWoBVsB4JgZAGmphsZCZYzTQgWNCYrDN9RvMmHx+X916SUBFbo8CzD1idXrLErw1mQttgXtyrOcQ/Ny5p4Qh+2XqLYYazsPWNTiuMkRxa4vcV+evuNAUOLIx5+c2hyzv7hNQC67Q+/HHmlEwAAAABJRU5ErkJggg==) no-repeat top center; }
187
+ ul.fullTree li:first-child { padding-top: 0; background: transparent; }
188
+ ul.fullTree li:last-child { padding-bottom: 0; }
189
+ .showAll ul.fullTree { display: block; }
190
+ .showAll .inheritName { display: none; }
188
191
 
189
192
  #search { position: absolute; right: 14px; top: 0px; }
190
193
  #search a:link, #search a:visited {
@@ -229,6 +232,7 @@ li.r1 { background: #f0f0f0; }
229
232
  li.r2 { background: #fafafa; }
230
233
 
231
234
  #search_frame {
235
+ z-index: 9999;
232
236
  background: #fff;
233
237
  display: none;
234
238
  position: absolute;
@@ -253,7 +257,7 @@ li.r2 { background: #fafafa; }
253
257
  max-width: 300px;
254
258
  -webkit-box-shadow: -2px 2px 6px #bbb;
255
259
  -moz-box-shadow: -2px 2px 6px #bbb;
256
- z-index: 9999;
260
+ z-index: 5000;
257
261
  position: relative;
258
262
  }
259
263
  #toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
@@ -31,14 +31,12 @@ function createFullTreeLinks() {
31
31
  var tHeight = 0;
32
32
  $('.inheritanceTree').toggle(function() {
33
33
  tHeight = $(this).parent().prev().height();
34
- $(this).prev().prev().hide();
35
- $(this).prev().show();
34
+ $(this).parent().toggleClass('showAll');
36
35
  $(this).text("(hide)");
37
36
  $(this).parent().prev().height($(this).parent().height());
38
37
  },
39
38
  function() {
40
- $(this).prev().prev().show();
41
- $(this).prev().hide();
39
+ $(this).parent().toggleClass('showAll');
42
40
  $(this).parent().prev().height(tHeight);
43
41
  $(this).text("show all")
44
42
  });
@@ -154,7 +152,7 @@ function generateTOC() {
154
152
  show = true;
155
153
  var thisTag = parseInt(this.tagName[1]);
156
154
  if (this.id.length == 0) {
157
- var proposedId = $(this).text().replace(/[^a-z]/ig, '_');
155
+ var proposedId = $(this).text().replace(/[^a-z0-9:'"\.()=-]/ig, '_');
158
156
  if ($('#' + proposedId).length > 0) proposedId += counter++;
159
157
  this.id = proposedId;
160
158
  }
@@ -1,9 +1,24 @@
1
+ var inSearch = null;
2
+ var searchIndex = 0;
3
+ var searchCache = [];
4
+ var searchString = '';
5
+
1
6
  function fullListSearch() {
7
+ // generate cache
8
+ searchCache = [];
9
+ $('#full_list li').each(function() {
10
+ var link = $(this).find('.object_link a');
11
+ searchCache.push({name:link.text(), node:$(this), link:link});
12
+ });
13
+
2
14
  $('#search input').keyup(function() {
3
- var value = this.value.toLowerCase();
4
- if (value == "") {
5
- $('#full_list').removeClass('insearch');
6
- $('#full_list li').each(function() {
15
+ searchString = this.value.toLowerCase();
16
+ if (searchString == "") {
17
+ clearTimeout(inSearch);
18
+ inSearch = null;
19
+ $('#full_list, #content').removeClass('insearch');
20
+ $('#full_list li').removeClass('found').each(function() {
21
+
7
22
  var link = $(this).find('.object_link a');
8
23
  link.text(link.text());
9
24
  });
@@ -15,34 +30,56 @@ function fullListSearch() {
15
30
  highlight();
16
31
  }
17
32
  else {
18
- $('#full_list').addClass('insearch');
19
- $('#full_list li').each(function() {
20
- var link = $(this).find('.object_link a');
21
- var text = link.text();
22
- if (text.toLowerCase().indexOf(value) == -1) {
23
- $(this).removeClass('found');
24
- link.text(link.text());
25
- }
26
- else {
27
- $(this).css('padding-left', '10px').addClass('found');
28
- link.html(link.text().replace(new RegExp("(" +
29
- value.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
30
- '<strong>$1</strong>'));
31
- }
32
- });
33
- highlight(true);
34
- }
35
-
36
- if ($('#full_list li:visible').size() == 0) {
37
- $('#noresults').fadeIn();
38
- }
39
- else {
40
- $('#noresults').hide();
33
+ if (inSearch) clearTimeout(inSearch);
34
+ searchIndex = 0;
35
+ lastRowClass = '';
36
+ $('#full_list, #content').addClass('insearch');
37
+ $('#noresults').text('');
38
+ searchItem();
41
39
  }
42
40
  });
43
41
 
44
42
  $('#search input').focus();
45
- $('#full_list').after("<div id='noresults'>No results were found.</div>")
43
+ $('#full_list').after("<div id='noresults'></div>")
44
+ }
45
+
46
+ var lastRowClass = '';
47
+ function searchItem() {
48
+ for (var i = 0; i < searchCache.length / 50; i++) {
49
+ var item = searchCache[searchIndex];
50
+ if (item.name.toLowerCase().indexOf(searchString) == -1) {
51
+ item.node.removeClass('found');
52
+ }
53
+ else {
54
+ item.node.css('padding-left', '10px').addClass('found');
55
+ item.node.removeClass(lastRowClass).addClass(lastRowClass == 'r1' ? 'r2' : 'r1');
56
+ lastRowClass = item.node.hasClass('r1') ? 'r1' : 'r2';
57
+ item.link.html(item.name.replace(new RegExp("(" +
58
+ searchString.replace(/([\/.*+?|()\[\]{}\\])/g, "\\$1") + ")", "ig"),
59
+ '<strong>$1</strong>'));
60
+ }
61
+
62
+ if (searchCache.length == searchIndex + 1) {
63
+ return searchDone();
64
+ }
65
+ else {
66
+ searchIndex++;
67
+ }
68
+ }
69
+ inSearch = setTimeout('searchItem()', 0);
70
+ }
71
+
72
+ function searchDone() {
73
+ highlight(true);
74
+ if ($('#full_list li:visible').size() == 0) {
75
+ $('#noresults').text('No results were found.').hide().fadeIn();
76
+ }
77
+ else {
78
+ $('#noresults').text('');
79
+ }
80
+ $('#content').removeClass('insearch');
81
+ clearTimeout(inSearch);
82
+ inSearch = null;
46
83
  }
47
84
 
48
85
  clicked = null;
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 6
8
- - 0
9
- version: 0.6.0
8
+ - 1
9
+ version: 0.6.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Loren Segal
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-29 00:00:00 -04:00
17
+ date: 2010-09-06 00:00:00 -04:00
18
18
  default_executable:
19
19
  dependencies: []
20
20