summaryrefslogtreecommitdiff
path: root/lib/rdoc/generator/darkfish.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 07:07:12 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 07:07:12 +0000
commit60f2c9cf5bea6dd99fac50c460eab4809cc30b01 (patch)
treeab40b4f7be3ff6d9fc8aede6b90e1aa9dded0aff /lib/rdoc/generator/darkfish.rb
parentca9f7009db8aea70af3dd58cb6c7de0010844d22 (diff)
Upgrade to RDoc 3.5.3. Fixes [Bug #4376]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/generator/darkfish.rb')
-rw-r--r--lib/rdoc/generator/darkfish.rb35
1 files changed, 29 insertions, 6 deletions
diff --git a/lib/rdoc/generator/darkfish.rb b/lib/rdoc/generator/darkfish.rb
index 57873468e4..299e6b7dec 100644
--- a/lib/rdoc/generator/darkfish.rb
+++ b/lib/rdoc/generator/darkfish.rb
@@ -46,7 +46,7 @@ require 'rdoc/generator/markup'
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
+
class RDoc::Generator::Darkfish
RDoc::RDoc.add_generator self
@@ -162,9 +162,9 @@ class RDoc::Generator::Darkfish
generate_class_files
generate_file_files
- rescue StandardError => err
+ rescue => e
debug_msg "%s: %s\n %s" % [
- err.class.name, err.message, err.backtrace.join("\n ")
+ e.class.name, e.message, e.backtrace.join("\n ")
]
raise
@@ -208,6 +208,12 @@ class RDoc::Generator::Darkfish
out_file = @basedir + @options.op_dir + 'index.html'
render_template template_file, out_file do |io| binding end
+ rescue => e
+ error = RDoc::Error.new \
+ "error generating index.html: #{e.message} (#{e.class})"
+ error.set_backtrace e.backtrace
+
+ raise error
end
##
@@ -216,9 +222,12 @@ class RDoc::Generator::Darkfish
def generate_class_files
template_file = @template_dir + 'classpage.rhtml'
return unless template_file.exist?
- debug_msg "Generating class documentation in #@outputdir"
+ debug_msg "Generating class documentation in #{@outputdir}"
+
+ current = nil
@classes.each do |klass|
+ current = klass
debug_msg " working on %s (%s)" % [klass.full_name, klass.path]
out_file = @outputdir + klass.path
# suppress 1.9.3 warning
@@ -228,6 +237,12 @@ class RDoc::Generator::Darkfish
debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
end
+ rescue => e
+ error = RDoc::Error.new \
+ "error generating #{current.path}: #{e.message} (#{e.class})"
+ error.set_backtrace e.backtrace
+
+ raise error
end
##
@@ -236,17 +251,25 @@ class RDoc::Generator::Darkfish
def generate_file_files
template_file = @template_dir + 'filepage.rhtml'
return unless template_file.exist?
- debug_msg "Generating file documentation in #@outputdir"
+ debug_msg "Generating file documentation in #{@outputdir}"
+
+ out_file = nil
@files.each do |file|
out_file = @outputdir + file.path
- debug_msg " working on %s (%s)" % [ file.full_name, out_file ]
+ debug_msg " working on %s (%s)" % [file.full_name, out_file]
# suppress 1.9.3 warning
rel_prefix = rel_prefix = @outputdir.relative_path_from(out_file.dirname)
debug_msg " rendering #{out_file}"
render_template template_file, out_file do |io| binding end
end
+ rescue => e
+ error =
+ RDoc::Error.new "error generating #{out_file}: #{e.message} (#{e.class})"
+ error.set_backtrace e.backtrace
+
+ raise error
end
##