Skip to content

Commit

Permalink
After 2702be2, rdoc is now installed during 'dist' and other ant targ…
Browse files Browse the repository at this point in the history
…ets; this results in updates to 'rdoc' and 'ri'.
  • Loading branch information
BanzaiMan committed Sep 19, 2011
1 parent 755caf0 commit 61920fa
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 105 deletions.
68 changes: 10 additions & 58 deletions bin/rdoc 100644 → 100755
@@ -1,67 +1,19 @@
#!/usr/bin/env jruby
#
# RDoc: Documentation tool for source code
# (see lib/rdoc/rdoc.rb for more information)
# This file was generated by RubyGems.
#
# Copyright (c) 2003 Dave Thomas
# Released under the same terms as Ruby
# The application 'rdoc' is installed as part of a gem, and
# this file is here to facilitate running it.
#
# $Revision: 11708 $

## Transitional Hack ####
#
# RDoc was initially distributed independently, and installed
# itself into <prefix>/lib/ruby/site_ruby/<ver>/rdoc...
#
# Now that RDoc is part of the distribution, it's installed into
# <prefix>/lib/ruby/<ver>, which unfortunately appears later in the
# search path. This means that if you have previously installed RDoc,
# and then install from ruby-lang, you'll pick up the old one by
# default. This hack checks for the condition, and readjusts the
# search path if necessary.

def adjust_for_existing_rdoc(path)

$stderr.puts %{
It seems as if you have a previously-installed RDoc in
the directory #{path}.
Because this is now out-of-date, you might want to consider
removing the directories:
#{File.join(path, "rdoc")}
and
#{File.join(path, "markup")}
require 'rubygems'

}
version = ">= 0"

# Move all the site_ruby directories to the end
p $:
$:.replace($:.partition {|path| /site_ruby/ !~ path}.flatten)
p $:
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

$:.each do |path|
if /site_ruby/ =~ path
rdoc_path = File.join(path, 'rdoc', 'rdoc.rb')
if File.exists?(rdoc_path)
adjust_for_existing_rdoc(path)
break
end
end
end

## End of Transitional Hack ##


require 'rdoc/rdoc'

begin
r = RDoc::RDoc.new
r.document(ARGV)
rescue RDoc::RDocError => e
$stderr.puts e.message
exit(1)
end
gem 'rdoc', version
load Gem.bin_path('rdoc', 'rdoc', version)
59 changes: 12 additions & 47 deletions bin/ri
@@ -1,54 +1,19 @@
#!/usr/bin/env jruby
# usage:
#
# ri name...
# This file was generated by RubyGems.
#
# where name can be
#
# Class | Class::method | Class#method | Class.method | method
#
# All names may be abbreviated to their minimum unbiguous form. If a name
# _is_ ambiguous, all valid options will be listed.
#
# The form '.' method matches either class or instance methods, while
# #method matches only instance and ::method matches only class methods.
#
#
# == Installing Documentation
#
# 'ri' uses a database of documentation built by the RDoc utility.
#
# So, how do you install this documentation on your system?
# It depends on how you installed Ruby.
#
# <em>If you installed Ruby from source files</em> (that is, if it some point
# you typed 'make' during the process :), you can install the RDoc
# documentation yourself. Just go back to the place where you have
# your Ruby source and type
#
# make install-doc
#
# You'll probably need to do this as a superuser, as the documentation
# is installed in the Ruby target tree (normally somewhere under
# <tt>/usr/local</tt>.
#
# <em>If you installed Ruby from a binary distribution</em> (perhaps
# using a one-click installer, or using some other packaging system),
# then the team that produced the package probably forgot to package
# the documentation as well. Contact them, and see if they can add
# it to the next release.
# The application 'rdoc' is installed as part of a gem, and
# this file is here to facilitate running it.
#

# JRUBY-3413 and JRUBY-4231
ARGV << "--no-pager"
require 'rubygems'

version = ">= 0"

begin
# Ruby 1.8 mode
require 'rdoc/ri/ri_driver'
ri = RiDriver.new
ri.process_args
rescue LoadError
# Ruby 1.9 mode
require 'rdoc/ri/driver'
RDoc::RI::Driver.run
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

gem 'rdoc', version
load Gem.bin_path('rdoc', 'ri', version)

0 comments on commit 61920fa

Please sign in to comment.