voloko-sdoc 0.1.7 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. data/LICENSE +21 -0
  2. data/VERSION.yml +4 -0
  3. data/lib/sdoc/generator/shtml.rb +1 -4
  4. data/lib/sdoc.rb +0 -1
  5. metadata +32 -101
  6. data/rdoc/History.txt +0 -254
  7. data/rdoc/Manifest.txt +0 -126
  8. data/rdoc/README.txt +0 -47
  9. data/rdoc/RI.txt +0 -58
  10. data/rdoc/Rakefile +0 -70
  11. data/rdoc/bin/rdoc +0 -35
  12. data/rdoc/bin/ri +0 -5
  13. data/rdoc/lib/rdoc/alias.rb +0 -54
  14. data/rdoc/lib/rdoc/anon_class.rb +0 -10
  15. data/rdoc/lib/rdoc/any_method.rb +0 -190
  16. data/rdoc/lib/rdoc/attr.rb +0 -79
  17. data/rdoc/lib/rdoc/cache.rb +0 -41
  18. data/rdoc/lib/rdoc/class_module.rb +0 -87
  19. data/rdoc/lib/rdoc/code_object.rb +0 -152
  20. data/rdoc/lib/rdoc/code_objects.rb +0 -23
  21. data/rdoc/lib/rdoc/constant.rb +0 -36
  22. data/rdoc/lib/rdoc/context.rb +0 -712
  23. data/rdoc/lib/rdoc/diagram.rb +0 -340
  24. data/rdoc/lib/rdoc/dot.rb +0 -249
  25. data/rdoc/lib/rdoc/generator/darkfish.rb +0 -455
  26. data/rdoc/lib/rdoc/generator/markup.rb +0 -194
  27. data/rdoc/lib/rdoc/generator/ri.rb +0 -230
  28. data/rdoc/lib/rdoc/generator/template/darkfish/classpage.rhtml +0 -281
  29. data/rdoc/lib/rdoc/generator/template/darkfish/filepage.rhtml +0 -112
  30. data/rdoc/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
  31. data/rdoc/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
  32. data/rdoc/lib/rdoc/generator/template/darkfish/images/bug.png +0 -0
  33. data/rdoc/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
  34. data/rdoc/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
  35. data/rdoc/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
  36. data/rdoc/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
  37. data/rdoc/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
  38. data/rdoc/lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif +0 -0
  39. data/rdoc/lib/rdoc/generator/template/darkfish/images/macFFBgHack.png +0 -0
  40. data/rdoc/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
  41. data/rdoc/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
  42. data/rdoc/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
  43. data/rdoc/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
  44. data/rdoc/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
  45. data/rdoc/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
  46. data/rdoc/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
  47. data/rdoc/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
  48. data/rdoc/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
  49. data/rdoc/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
  50. data/rdoc/lib/rdoc/generator/template/darkfish/index.rhtml +0 -64
  51. data/rdoc/lib/rdoc/generator/template/darkfish/js/darkfish.js +0 -116
  52. data/rdoc/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -32
  53. data/rdoc/lib/rdoc/generator/template/darkfish/js/quicksearch.js +0 -114
  54. data/rdoc/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js +0 -10
  55. data/rdoc/lib/rdoc/generator/template/darkfish/rdoc.css +0 -696
  56. data/rdoc/lib/rdoc/generator.rb +0 -8
  57. data/rdoc/lib/rdoc/ghost_method.rb +0 -8
  58. data/rdoc/lib/rdoc/include.rb +0 -39
  59. data/rdoc/lib/rdoc/known_classes.rb +0 -68
  60. data/rdoc/lib/rdoc/markup/attribute_manager.rb +0 -311
  61. data/rdoc/lib/rdoc/markup/formatter.rb +0 -25
  62. data/rdoc/lib/rdoc/markup/fragments.rb +0 -377
  63. data/rdoc/lib/rdoc/markup/inline.rb +0 -126
  64. data/rdoc/lib/rdoc/markup/lines.rb +0 -156
  65. data/rdoc/lib/rdoc/markup/preprocess.rb +0 -80
  66. data/rdoc/lib/rdoc/markup/to_flow.rb +0 -211
  67. data/rdoc/lib/rdoc/markup/to_html.rb +0 -406
  68. data/rdoc/lib/rdoc/markup/to_html_crossref.rb +0 -140
  69. data/rdoc/lib/rdoc/markup/to_latex.rb +0 -328
  70. data/rdoc/lib/rdoc/markup/to_test.rb +0 -53
  71. data/rdoc/lib/rdoc/markup/to_texinfo.rb +0 -73
  72. data/rdoc/lib/rdoc/markup.rb +0 -378
  73. data/rdoc/lib/rdoc/meta_method.rb +0 -8
  74. data/rdoc/lib/rdoc/normal_class.rb +0 -18
  75. data/rdoc/lib/rdoc/normal_module.rb +0 -34
  76. data/rdoc/lib/rdoc/options.rb +0 -542
  77. data/rdoc/lib/rdoc/parser/c.rb +0 -678
  78. data/rdoc/lib/rdoc/parser/perl.rb +0 -165
  79. data/rdoc/lib/rdoc/parser/ruby.rb +0 -2904
  80. data/rdoc/lib/rdoc/parser/simple.rb +0 -39
  81. data/rdoc/lib/rdoc/parser.rb +0 -138
  82. data/rdoc/lib/rdoc/rdoc.rb +0 -375
  83. data/rdoc/lib/rdoc/require.rb +0 -32
  84. data/rdoc/lib/rdoc/ri/cache.rb +0 -187
  85. data/rdoc/lib/rdoc/ri/descriptions.rb +0 -156
  86. data/rdoc/lib/rdoc/ri/display.rb +0 -340
  87. data/rdoc/lib/rdoc/ri/driver.rb +0 -828
  88. data/rdoc/lib/rdoc/ri/formatter.rb +0 -654
  89. data/rdoc/lib/rdoc/ri/paths.rb +0 -93
  90. data/rdoc/lib/rdoc/ri/reader.rb +0 -106
  91. data/rdoc/lib/rdoc/ri/util.rb +0 -79
  92. data/rdoc/lib/rdoc/ri/writer.rb +0 -68
  93. data/rdoc/lib/rdoc/ri.rb +0 -8
  94. data/rdoc/lib/rdoc/single_class.rb +0 -8
  95. data/rdoc/lib/rdoc/stats.rb +0 -178
  96. data/rdoc/lib/rdoc/task.rb +0 -276
  97. data/rdoc/lib/rdoc/tokenstream.rb +0 -33
  98. data/rdoc/lib/rdoc/top_level.rb +0 -242
  99. data/rdoc/lib/rdoc.rb +0 -398
data/rdoc/RI.txt DELETED
@@ -1,58 +0,0 @@
1
- = RI
2
- == Background
3
- +ri+ is a tool that allows Ruby documentation to be viewed on the command-line.
4
- It is part of RDoc and is expected to work on any platform supported by Ruby.
5
-
6
- +ri+ will be a bit slow the first time that it runs (or any time that the
7
- underlying documentation changes) because it builds a cache in the +.ri+
8
- directory within the user's home directory in order to make future accesses
9
- faster.
10
-
11
- == Usage
12
- To see information for a class, do:
13
- ri class_name
14
-
15
- For example, for the +Array+ class, do
16
- ri Array
17
-
18
- To see information for an instance method, do:
19
- ri class_name#method_name
20
-
21
- For example, for Array's +join+ method, do:
22
- ri Array#join
23
-
24
- To see information for a class method, do:
25
- ri class_name.method_name
26
-
27
- For example, for Module's +private+ method, do:
28
- ri Module.private
29
-
30
- To search for all methods containing +read+, do:
31
- ri read
32
-
33
- To search for all methods starting with +read+, do:
34
- ri '^read'
35
-
36
- To search for all +read+ methods, do:
37
- ri '^read$'
38
-
39
- == Options
40
- +ri+ supports a variety of options, all of which can be viewed via +--help+.
41
- Of particular interest, are:
42
- [-d directory]
43
- List of directories from which to source documentation in addition to
44
- the standard directories. May be repeated. This can be used to specify
45
- the location of site-specific documentation (which can be generated with
46
- RDoc).
47
- [-i]
48
- This makes +ri+ go into interactive mode. When +ri+ is in interactive mode,
49
- it will allow the user to disambiguate lists of methods in case multiple
50
- methods match against a method search string. It also will allow the user
51
- to enter in a method name (with auto-completion, if readline is supported)
52
- when viewing a class.
53
- [-T]
54
- Send output to stdout, rather than to a pager.
55
-
56
- All options also can be specified through the +RI+ environment variable.
57
- Command-line options always override those specified in the +RI+ environment
58
- variable.
data/rdoc/Rakefile DELETED
@@ -1,70 +0,0 @@
1
- require 'hoe'
2
-
3
- $rdoc_rakefile = true
4
-
5
- $:.unshift 'lib'
6
- require 'rdoc'
7
-
8
- Hoe.new "rdoc", RDoc::VERSION do |rdoc|
9
- rdoc.developer 'Eric Hodel', 'drbrain@segment7.net'
10
- rdoc.developer 'Dave Thomas', ''
11
- rdoc.developer 'Phil Hagelberg', 'technomancy@gmail.com'
12
- rdoc.developer 'Tony Strauss', 'tony.strauss@designingpatterns.com'
13
- rdoc.remote_rdoc_dir = ''
14
-
15
- rdoc.extra_dev_deps << ['minitest', '~> 1.3']
16
- rdoc.spec_extras['required_rubygems_version'] = '>= 1.3'
17
- rdoc.spec_extras['homepage'] = 'http://rdoc.rubyforge.org'
18
- end
19
-
20
- # These tasks expect to have the following directory structure:
21
- #
22
- # git/git.rubini.us/code # Rubinius git HEAD checkout
23
- # svn/ruby/trunk # ruby subversion HEAD checkout
24
- # svn/rdoc/trunk # RDoc subversion HEAD checkout
25
- #
26
- # If you don't have this directory structure, set RUBY_PATH and/or
27
- # RUBINIUS_PATH.
28
-
29
- diff_options = "-urpN --exclude '*svn*' --exclude '*swp' --exclude '*rbc'"
30
- rsync_options = "-avP --exclude '*svn*' --exclude '*swp' --exclude '*rbc' --exclude '*.rej' --exclude '*.orig'"
31
-
32
- rubinius_dir = ENV['RUBINIUS_PATH'] || '../../../git/git.rubini.us/code'
33
- ruby_dir = ENV['RUBY_PATH'] || '../../ruby/trunk'
34
-
35
- desc "Updates Ruby HEAD with the currently checked-out copy of RDoc."
36
- task :update_ruby do
37
- sh "rsync #{rsync_options} bin/rdoc #{ruby_dir}/bin/rdoc"
38
- sh "rsync #{rsync_options} bin/ri #{ruby_dir}/bin/ri"
39
- sh "rsync #{rsync_options} lib/ #{ruby_dir}/lib"
40
- sh "rsync #{rsync_options} test/ #{ruby_dir}/test/rdoc"
41
- end
42
-
43
- desc "Diffs Ruby HEAD with the currently checked-out copy of RDoc."
44
- task :diff_ruby do
45
- options = "-urpN --exclude '*svn*' --exclude '*swp' --exclude '*rbc'"
46
-
47
- sh "diff #{diff_options} bin/rdoc #{ruby_dir}/bin/rdoc; true"
48
- sh "diff #{diff_options} bin/ri #{ruby_dir}/bin/ri; true"
49
- sh "diff #{diff_options} lib/rdoc.rb #{ruby_dir}/lib/rdoc.rb; true"
50
- sh "diff #{diff_options} lib/rdoc #{ruby_dir}/lib/rdoc; true"
51
- sh "diff #{diff_options} test #{ruby_dir}/test/rdoc; true"
52
- end
53
-
54
- desc "Updates Rubinius HEAD with the currently checked-out copy of RDoc."
55
- task :update_rubinius do
56
- sh "rsync #{rsync_options} bin/rdoc #{rubinius_dir}/lib/bin/rdoc.rb"
57
- sh "rsync #{rsync_options} bin/ri #{rubinius_dir}/lib/bin/ri.rb"
58
- sh "rsync #{rsync_options} lib/ #{rubinius_dir}/lib"
59
- sh "rsync #{rsync_options} test/ #{rubinius_dir}/test/rdoc"
60
- end
61
-
62
- desc "Diffs Rubinius HEAD with the currently checked-out copy of RDoc."
63
- task :diff_rubinius do
64
- sh "diff #{diff_options} bin/rdoc #{rubinius_dir}/lib/bin/rdoc.rb; true"
65
- sh "diff #{diff_options} bin/ri #{rubinius_dir}/lib/bin/ri.rb; true"
66
- sh "diff #{diff_options} lib/rdoc.rb #{rubinius_dir}/lib/rdoc.rb; true"
67
- sh "diff #{diff_options} lib/rdoc #{rubinius_dir}/lib/rdoc; true"
68
- sh "diff #{diff_options} test #{rubinius_dir}/test/rdoc; true"
69
- end
70
-
data/rdoc/bin/rdoc DELETED
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # RDoc: Documentation tool for source code
4
- # (see lib/rdoc/rdoc.rb for more information)
5
- #
6
- # Copyright (c) 2003 Dave Thomas
7
- # Released under the same terms as Ruby
8
- #
9
- # $Revision: 15033 $
10
-
11
- require 'rdoc/rdoc'
12
-
13
- begin
14
- r = RDoc::RDoc.new
15
- r.document ARGV
16
- rescue Interrupt
17
- $stderr.puts
18
- $stderr.puts "Interrupted"
19
- exit 1
20
- rescue SystemExit
21
- raise
22
- rescue Exception => e
23
- if $DEBUG_RDOC then
24
- $stderr.puts e.message
25
- $stderr.puts "#{e.backtrace.join "\n\t"}"
26
- $stderr.puts
27
- else
28
- $stderr.puts "uh-oh! RDoc had a problem:"
29
- $stderr.puts e.message
30
- $stderr.puts
31
- $stderr.puts "run with --debug for full backtrace"
32
- end
33
- exit 1
34
- end
35
-
data/rdoc/bin/ri DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rdoc/ri/driver'
4
-
5
- RDoc::RI::Driver.run ARGV
@@ -1,54 +0,0 @@
1
- require 'rdoc/code_object'
2
-
3
- ##
4
- # Represent an alias, which is an old_name/new_name pair associated with a
5
- # particular context
6
-
7
- class RDoc::Alias < RDoc::CodeObject
8
-
9
- ##
10
- # Allow comments to be overridden
11
-
12
- attr_writer :comment
13
-
14
- ##
15
- # Aliased name
16
-
17
- attr_accessor :new_name
18
-
19
- ##
20
- # Aliasee's name
21
-
22
- attr_accessor :old_name
23
-
24
- ##
25
- # Source file token stream
26
-
27
- attr_accessor :text
28
-
29
- ##
30
- # Creates a new Alias with a token stream of +text+ that aliases +old_name+
31
- # to +new_name+ and has +comment+
32
-
33
- def initialize(text, old_name, new_name, comment)
34
- super()
35
- @text = text
36
- @old_name = old_name
37
- @new_name = new_name
38
- self.comment = comment
39
- end
40
-
41
- def inspect # :nodoc:
42
- "#<%s:0x%x %s.alias_method %s, %s>" % [
43
- self.class, object_id,
44
- parent.name, @old_name, @new_name,
45
- ]
46
- end
47
-
48
- def to_s # :nodoc:
49
- "alias: #{self.old_name} -> #{self.new_name}\n#{self.comment}"
50
- end
51
-
52
- end
53
-
54
-
@@ -1,10 +0,0 @@
1
- require 'rdoc/class_module'
2
-
3
- ##
4
- # An anonymous class like:
5
- #
6
- # c = Class.new do end
7
-
8
- class RDoc::AnonClass < RDoc::ClassModule
9
- end
10
-
@@ -1,190 +0,0 @@
1
- require 'rdoc/code_object'
2
- require 'rdoc/tokenstream'
3
-
4
- ##
5
- # AnyMethod is the base class for objects representing methods
6
-
7
- class RDoc::AnyMethod < RDoc::CodeObject
8
-
9
- ##
10
- # Method name
11
-
12
- attr_writer :name
13
-
14
- ##
15
- # public, protected, private
16
-
17
- attr_accessor :visibility
18
-
19
- ##
20
- # Parameters yielded by the called block
21
-
22
- attr_accessor :block_params
23
-
24
- ##
25
- # Don't rename \#initialize to \::new
26
-
27
- attr_accessor :dont_rename_initialize
28
-
29
- ##
30
- # Is this a singleton method?
31
-
32
- attr_accessor :singleton
33
-
34
- ##
35
- # Source file token stream
36
-
37
- attr_reader :text
38
-
39
- ##
40
- # Array of other names for this method
41
-
42
- attr_reader :aliases
43
-
44
- ##
45
- # Fragment reference for this method
46
-
47
- attr_reader :aref
48
-
49
- ##
50
- # The method we're aliasing
51
-
52
- attr_accessor :is_alias_for
53
-
54
- ##
55
- # Parameters for this method
56
-
57
- attr_overridable :params, :param, :parameters, :parameter
58
-
59
- ##
60
- # Different ways to call this method
61
-
62
- attr_accessor :call_seq
63
-
64
- include RDoc::TokenStream
65
-
66
- ##
67
- # Resets method fragment reference counter
68
-
69
- def self.reset
70
- @@aref = 'M000000'
71
- end
72
-
73
- reset
74
-
75
- def initialize(text, name)
76
- super()
77
- @text = text
78
- @name = name
79
- @token_stream = nil
80
- @visibility = :public
81
- @dont_rename_initialize = false
82
- @block_params = nil
83
- @aliases = []
84
- @is_alias_for = nil
85
- @call_seq = nil
86
-
87
- @aref = @@aref
88
- @@aref = @@aref.succ
89
- end
90
-
91
- ##
92
- # Order by #singleton then #name
93
-
94
- def <=>(other)
95
- [@singleton ? 0 : 1, @name] <=> [other.singleton ? 0 : 1, other.name]
96
- end
97
-
98
- ##
99
- # Adds +method+ as an alias for this method
100
-
101
- def add_alias(method)
102
- @aliases << method
103
- end
104
-
105
- ##
106
- # HTML id-friendly method name
107
-
108
- def html_name
109
- @name.gsub(/[^a-z]+/, '-')
110
- end
111
-
112
- def inspect # :nodoc:
113
- alias_for = @is_alias_for ? " (alias for #{@is_alias_for.name})" : nil
114
- "#<%s:0x%x %s%s%s (%s)%s>" % [
115
- self.class, object_id,
116
- parent_name,
117
- singleton ? '::' : '#',
118
- name,
119
- visibility,
120
- alias_for,
121
- ]
122
- end
123
-
124
- ##
125
- # Full method name including namespace
126
-
127
- def full_name
128
- "#{@parent.full_name}#{pretty_name}"
129
- end
130
-
131
- ##
132
- # Method name
133
-
134
- def name
135
- return @name if @name
136
-
137
- @name = @call_seq[/^.*?\.(\w+)/, 1] || @call_seq
138
- end
139
-
140
- ##
141
- # Pretty parameter list for this method
142
-
143
- def param_seq
144
- params = params.gsub(/\s*\#.*/, '')
145
- params = params.tr("\n", " ").squeeze(" ")
146
- params = "(#{params})" unless p[0] == ?(
147
-
148
- if block = block_params then # yes, =
149
- # If this method has explicit block parameters, remove any explicit
150
- # &block
151
- params.sub!(/,?\s*&\w+/)
152
-
153
- block.gsub!(/\s*\#.*/, '')
154
- block = block.tr("\n", " ").squeeze(" ")
155
- if block[0] == ?(
156
- block.sub!(/^\(/, '').sub!(/\)/, '')
157
- end
158
- params << " { |#{block}| ... }"
159
- end
160
-
161
- params
162
- end
163
-
164
- ##
165
- # Path to this method
166
-
167
- def path
168
- "#{@parent.path}##{@aref}"
169
- end
170
-
171
- ##
172
- # Method name with class/instance indicator
173
-
174
- def pretty_name
175
- "#{singleton ? '::' : '#'}#{@name}"
176
- end
177
-
178
- def to_s # :nodoc:
179
- "#{self.class.name}: #{full_name} (#{@text})\n#{@comment}"
180
- end
181
-
182
- ##
183
- # Type of method (class or instance)
184
-
185
- def type
186
- singleton ? 'class' : 'instance'
187
- end
188
-
189
- end
190
-
@@ -1,79 +0,0 @@
1
- require 'rdoc/code_object'
2
-
3
- ##
4
- # An attribute created by \#attr, \#attr_reader, \#attr_writer or
5
- # \#attr_accessor
6
-
7
- class RDoc::Attr < RDoc::CodeObject
8
-
9
- ##
10
- # Name of the attribute
11
-
12
- attr_accessor :name
13
-
14
- ##
15
- # Is the attribute readable, writable or both?
16
-
17
- attr_accessor :rw
18
-
19
- ##
20
- # Source file token stream
21
-
22
- attr_accessor :text
23
-
24
- ##
25
- # public, protected, private
26
-
27
- attr_accessor :visibility
28
-
29
- def initialize(text, name, rw, comment)
30
- super()
31
- @text = text
32
- @name = name
33
- @rw = rw
34
- @visibility = :public
35
- self.comment = comment
36
- end
37
-
38
- ##
39
- # Attributes are ordered by name
40
-
41
- def <=>(other)
42
- self.name <=> other.name
43
- end
44
-
45
- ##
46
- # An HTML id-friendly representation of #name
47
-
48
- def html_name
49
- @name.gsub(/[^a-z]+/, '-')
50
- end
51
-
52
- def inspect # :nodoc:
53
- attr = case rw
54
- when 'RW' then :attr_accessor
55
- when 'R' then :attr_reader
56
- when 'W' then :attr_writer
57
- else
58
- " (#{rw})"
59
- end
60
-
61
- "#<%s:0x%x %s.%s :%s>" % [
62
- self.class, object_id,
63
- parent_name, attr, @name,
64
- ]
65
- end
66
-
67
- ##
68
- # URL path for this attribute
69
-
70
- def path
71
- "#{@parent.path}##{@name}"
72
- end
73
-
74
- def to_s # :nodoc:
75
- "attr: #{self.name} #{self.rw}\n#{self.comment}"
76
- end
77
-
78
- end
79
-
@@ -1,41 +0,0 @@
1
- require 'thread'
2
- require 'singleton'
3
-
4
- ##
5
- # A generic, thread-safe in-memory cache. It's used for caching
6
- # RDoc::TemplatePage objects when generating RDoc output.
7
-
8
- class RDoc::Cache
9
-
10
- include Singleton
11
-
12
- ##
13
- # Creates a new, empty cache
14
-
15
- def initialize
16
- @contents = {}
17
- @lock = Mutex.new
18
- end
19
-
20
- ##
21
- # Checks whether there's a value in the cache with key +key+. If so, then
22
- # that value will be returned. Otherwise, the given block will be run, and
23
- # its return value will be put into the cache, and returned.
24
-
25
- def cache(key)
26
- @lock.synchronize do
27
- @contents[key] ||= yield
28
- end
29
- end
30
-
31
- ##
32
- # Clears the contents of the cache
33
-
34
- def clear
35
- @lock.synchronize do
36
- @contents.clear
37
- end
38
- end
39
-
40
- end
41
-
@@ -1,87 +0,0 @@
1
- require 'rdoc/context'
2
-
3
- ##
4
- # ClassModule is the base class for objects representing either a class or a
5
- # module.
6
-
7
- class RDoc::ClassModule < RDoc::Context
8
-
9
- attr_accessor :diagram
10
-
11
- ##
12
- # Creates a new ClassModule with +name+ with optional +superclass+
13
-
14
- def initialize(name, superclass = 'Object')
15
- @diagram = nil
16
- @full_name = nil
17
- @name = name
18
- @superclass = superclass
19
- super()
20
- end
21
-
22
- ##
23
- # Finds a class or module with +name+ in this namespace or its descendents
24
-
25
- def find_class_named(name)
26
- return self if full_name == name
27
- @classes.each_value {|c| return c if c.find_class_named(name) }
28
- nil
29
- end
30
-
31
- ##
32
- # Return the fully qualified name of this class or module
33
-
34
- def full_name
35
- @full_name ||= if RDoc::ClassModule === @parent then
36
- "#{@parent.full_name}::#{@name}"
37
- else
38
- @name
39
- end
40
- end
41
-
42
- ##
43
- # 'module' or 'class'
44
-
45
- def type
46
- module? ? 'module' : 'class'
47
- end
48
-
49
- ##
50
- # Does this object represent a module?
51
-
52
- def module?
53
- false
54
- end
55
-
56
- ##
57
- # Path to this class or module
58
-
59
- def path
60
- http_url RDoc::RDoc.current.generator.class_dir
61
- end
62
-
63
- ##
64
- # Get the superclass of this class. Attempts to retrieve the superclass
65
- # object, returns the name if it is not known.
66
-
67
- def superclass
68
- raise NoMethodError, "#{full_name} is a module" if module?
69
-
70
- RDoc::TopLevel.find_class_named(@superclass) || @superclass
71
- end
72
-
73
- ##
74
- # Set the superclass of this class to +superclass+
75
-
76
- def superclass=(superclass)
77
- raise NoMethodError, "#{full_name} is a module" if module?
78
-
79
- @superclass = superclass if @superclass.nil? or @superclass == 'Object'
80
- end
81
-
82
- def to_s # :nodoc:
83
- "#{self.class}: #{full_name} #{@comment} #{super}"
84
- end
85
-
86
- end
87
-