1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* {lib,test}/rdoc: removed trailing spaces. reapplied r22784.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2010-04-02 04:40:47 +00:00
parent 0c216c32dc
commit 2553a96f9e
18 changed files with 83 additions and 83 deletions

View file

@ -88,7 +88,7 @@ $DEBUG_RDOC = nil
#
# =begin rdoc
# Documentation to be processed by RDoc.
#
#
# ...
# =end
#
@ -104,7 +104,7 @@ $DEBUG_RDOC = nil
# # FIXME: fails if the birthday falls on February 29th
# #++
# # The DOB is returned as a Time object.
#
#
# def get_dob(person)
# # ...
# end
@ -130,7 +130,7 @@ $DEBUG_RDOC = nil
#
# def fred # :yields: index, position
# # ...
#
#
# yield line, address
#
# which will get documented as
@ -256,12 +256,12 @@ $DEBUG_RDOC = nil
# module also will be omitted. By default, though, modules and
# classes within that class of module _will_ be documented. This is
# turned off by adding the +all+ modifier.
#
#
# module MyModule # :nodoc:
# class Input
# end
# end
#
#
# module OtherModule # :nodoc: all
# class Output
# end
@ -295,7 +295,7 @@ $DEBUG_RDOC = nil
# comment block may have one or more lines before the :section: directive.
# These will be removed, and any identical lines at the end of the block are
# also removed. This allows you to add visual cues such as:
#
#
# # ----------------------------------------
# # :section: My Section
# # This is the section that I wrote.

View file

@ -1,10 +1,10 @@
/**
*
*
* Darkfish Page Functions
* $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $
*
*
* Author: Michael Granger <mgranger@laika.com>
*
*
*/
/* Provide console simulation for firebug-less environments */
@ -58,7 +58,7 @@ function hookQuickSearch() {
var toggle = $(this).parents('.section').find('h3 .search-toggle');
// console.debug( "Toggle is: %o", toggle );
var qsbox = $(this).parents('form').get( 0 );
$(this).quicksearch( this, searchElems, {
noSearchResultsIndicator: 'no-class-search-results',
focusOnLoad: false
@ -87,7 +87,7 @@ function highlightTarget( anchor ) {
function highlightLocationTarget() {
console.debug( "Location hash: %s", window.location.hash );
if ( ! window.location.hash || window.location.hash.length == 0 ) return;
var anchor = window.location.hash.substring(1);
console.debug( "Found anchor: %s; matching %s", anchor, "a[name=" + anchor + "]" );

View file

@ -1,10 +1,10 @@
/**
*
*
* JQuery QuickSearch - Hook up a form field to hide non-matching elements.
* $Id: quicksearch.js 53 2009-01-07 02:52:03Z deveiant $
*
*
* Author: Michael Granger <mgranger@laika.com>
*
*
*/
jQuery.fn.quicksearch = function( target, searchElems, options ) {
// console.debug( "Quicksearch fn" );
@ -17,7 +17,7 @@ jQuery.fn.quicksearch = function( target, searchElems, options ) {
noSearchResultsIndicator: null
};
if ( options ) $.extend( settings, options );
return jQuery(this).each( function() {
// console.debug( "Creating a new quicksearch on %o for %o", this, searchElems );
new jQuery.quicksearch( this, searchElems, settings );
@ -56,7 +56,7 @@ jQuery.quicksearch = function( searchBox, searchElems, settings ) {
case 8:
return true;
break;
// Only allow valid search characters
default:
return validQSChar( e.charCode );
@ -88,7 +88,7 @@ jQuery.quicksearch = function( searchBox, searchElems, settings ) {
var searchText = searchBox.value;
var pat = new RegExp( searchText, "im" );
var shownCount = 0;
if ( settings.noSearchResultsIndicator ) {
$('#' + settings.noSearchResultsIndicator).hide();
}
@ -96,7 +96,7 @@ jQuery.quicksearch = function( searchBox, searchElems, settings ) {
// All elements start out hidden
$(searchElems).each( function(index) {
var str = $(this).text();
if ( pat.test(str) ) {
shownCount += 1;
$(this).fadeIn();

View file

@ -1,9 +1,9 @@
/*
* "Darkfish" Rdoc CSS
* $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $
*
*
* Author: Michael Granger <ged@FaerieMUD.org>
*
*
*/
/* Base Green is: #6C8C22 */

View file

@ -27,9 +27,9 @@ require 'rdoc'
# convert multiple input strings.
#
# require 'rdoc/markup/to_html'
#
#
# h = RDoc::Markup::ToHtml.new
#
#
# puts h.convert(input_string)
#
# You can extend the RDoc::Markup parser to recognise new markup
@ -41,22 +41,22 @@ require 'rdoc'
#
# require 'rdoc/markup'
# require 'rdoc/markup/to_html'
#
#
# class WikiHtml < RDoc::Markup::ToHtml
# def handle_special_WIKIWORD(special)
# "<font color=red>" + special.text + "</font>"
# end
# end
#
#
# m = RDoc::Markup.new
# m.add_word_pair("{", "}", :STRIKE)
# m.add_html("no", :STRIKE)
#
#
# m.add_special(/\b([A-Z][a-z]+[A-Z]\w+)/, :WIKIWORD)
#
#
# wh = WikiHtml.new
# wh.add_tag(:STRIKE, "<strike>", "</strike>")
#
#
# puts "<body>#{wh.convert ARGF.read}</body>"
#
#--

View file

@ -290,7 +290,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
# Determins the HTML list element for +list_type+ and +open_tag+
def html_list_name(list_type, open_tag)
tags = LIST_TYPE_TO_HTML[list_type]
tags = LIST_TYPE_TO_HTML[list_type]
raise RDoc::Error, "Invalid list type: #{list_type.inspect}" unless tags
annotate tags[open_tag ? 0 : 1]
end

View file

@ -22,14 +22,14 @@ require 'rdoc/stats'
# following incantation
#
# require "rdoc/parser"
#
#
# class RDoc::Parser::Xyz < RDoc::Parser
# parse_files_matching /\.xyz$/ # <<<<
#
#
# def initialize(file_name, body, options)
# ...
# end
#
#
# def scan
# ...
# end

View file

@ -76,7 +76,7 @@ require 'rdoc/known_classes'
# * Encapsulate the writing and reading of the configuration
# * file. ...
# */
#
#
# /*
# * Document-method: read_value
# *

View file

@ -15,7 +15,7 @@ require 'rdoc/parser'
#
# We would like to support all the markup the POD provides
# so that it will convert happily to HTML. At the moment
# I don't think I can do that: time constraints.
# I don't think I can do that: time constraints.
#
class RDoc::Parser::PerlPOD < RDoc::Parser
@ -45,39 +45,39 @@ class RDoc::Parser::PerlPOD < RDoc::Parser
# but I think it would obscure the intent, scatter the
# code all over tha place. This machine is necessary
# because POD requires that directives be preceded by
# blank lines, so reading line by line is necessary,
# blank lines, so reading line by line is necessary,
# and preserving state about what is seen is necesary.
def scan
@top_level.comment ||= ""
state=:code_blank
state=:code_blank
line_number = 0
line = nil
# This started out as a really long nested case statement,
# which also led to repetitive code. I'd like to avoid that
# so I'm using a "table" instead.
# Firstly we need some procs to do the transition and processing
# work. Because these are procs they are closures, and they can
# use variables in the local scope.
#
# First, the "nothing to see here" stuff.
code_noop = lambda do
code_noop = lambda do
if line =~ /^\s+$/
state = :code_blank
end
end
pod_noop = lambda do
pod_noop = lambda do
if line =~ /^\s+$/
state = :pod_blank
end
@top_level.comment += filter(line)
end
begin_noop = lambda do
begin_noop = lambda do
if line =~ /^\s+$/
state = :begin_blank
end
@ -151,7 +151,7 @@ class RDoc::Parser::PerlPOD < RDoc::Parser
def filter(comment)
return '' if comment =~ /^=pod\s*$/
comment.gsub!(/^=pod/, '==')
comment.gsub!(/^=head(\d+)/) do
comment.gsub!(/^=head(\d+)/) do
"=" * $1.to_i
end
comment.gsub!(/=item/, '');

View file

@ -50,7 +50,7 @@ $TOKEN_DEBUG ||= nil
#
# ##
# # This method tries over and over until it is tired
#
#
# def go_go_go(thing_to_try, tries = 10) # :args: thing_to_try
# puts thing_to_try
# go_go_go thing_to_try, tries - 1
@ -70,7 +70,7 @@ $TOKEN_DEBUG ||= nil
# # :call-seq:
# # my_method(Range)
# # my_method(offset, length)
#
#
# def my_method(*args)
# end
#
@ -81,7 +81,7 @@ $TOKEN_DEBUG ||= nil
#
# ##
# # My method is awesome
#
#
# def my_method(&block) # :yields: happy, times
# block.call 1, 2
# end
@ -93,7 +93,7 @@ $TOKEN_DEBUG ||= nil
#
# ##
# # This is a meta-programmed method!
#
#
# add_my_method :meta_method, :arg1, :arg2
#
# The parser looks at the token after the identifier to determine the name, in
@ -131,14 +131,14 @@ $TOKEN_DEBUG ||= nil
# ##
# # :attr_writer: ghost_writer
# # There is an attribute here, but you can't see it!
#
#
# ##
# # :method: ghost_method
# # There is a method here, but you can't see it!
#
#
# ##
# # this is a comment for a regular method
#
#
# def regular_method() end
#
# Note that by default, the :method: directive will be ignored if there is a
@ -737,27 +737,27 @@ class RDoc::Parser::Ruby < RDoc::Parser
# To create foo and bar attributes on class C with comment "My attributes":
#
# class C
#
#
# ##
# # :attr:
# #
# # My attributes
#
#
# my_attr :foo, :bar
#
#
# end
#
# To create a foo attribute on class C with comment "My attribute":
#
# class C
#
#
# ##
# # :attr: foo
# #
# # My attribute
#
#
# my_attr :foo, :bar
#
#
# end
def parse_meta_attr(context, single, tk, comment)

View file

@ -532,7 +532,7 @@ Options may also be set in the 'RI' environment variable.
elsif selector then
# replace Foo with Foo:: as given
completions.delete klass
completions << "#{klass}#{selector}"
completions << "#{klass}#{selector}"
end
completions.push(*methods)

View file

@ -144,7 +144,7 @@ class RDoc::RubyLex
end
@seek += 1
if c == "\n"
@line_no += 1
@line_no += 1
@char_no = 0
else
@char_no += 1
@ -181,10 +181,10 @@ class RDoc::RubyLex
c2 = @here_readed.pop
end
c = c2 unless c
@rests.unshift c #c =
@rests.unshift c #c =
@seek -= 1
if c == "\n"
@line_no -= 1
@line_no -= 1
if idx = @readed.reverse.index("\n")
@char_no = @readed.size - idx
else
@ -394,7 +394,7 @@ class RDoc::RubyLex
end
@OP.def_rule("=begin",
proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
proc{|op, io| @prev_char_no == 0 && peek(0) =~ /\s/}) do
|op, io|
@ltype = "="
res = ''
@ -415,8 +415,8 @@ class RDoc::RubyLex
else
@continue = false
@lex_state = EXPR_BEG
until (@indent_stack.empty? ||
[TkLPAREN, TkLBRACK, TkLBRACE,
until (@indent_stack.empty? ||
[TkLPAREN, TkLBRACK, TkLBRACE,
TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
@indent_stack.pop
end
@ -427,7 +427,7 @@ class RDoc::RubyLex
end
@OP.def_rules("*", "**",
"=", "==", "===",
"=", "==", "===",
"=~", "<=>",
"<", "<=",
">", ">=", ">>") do
@ -641,8 +641,8 @@ class RDoc::RubyLex
@OP.def_rules(";") do
|op, io|
@lex_state = EXPR_BEG
until (@indent_stack.empty? ||
[TkLPAREN, TkLBRACK, TkLBRACE,
until (@indent_stack.empty? ||
[TkLPAREN, TkLBRACK, TkLBRACE,
TkfLPAREN, TkfLBRACK, TkfLBRACE].include?(@indent_stack.last))
@indent_stack.pop
end
@ -761,7 +761,7 @@ class RDoc::RubyLex
end
end
# @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
# @OP.def_rule("def", proc{|op, io| /\s/ =~ io.peek(0)}) do
# |op, io|
# @indent += 1
# @lex_state = EXPR_FNAME
@ -1149,7 +1149,7 @@ class RDoc::RubyLex
str << read_escape
end
if PERCENT_PAREN.values.include?(@quoted)
if PERCENT_PAREN.values.include?(@quoted)
if PERCENT_PAREN[ch] == @quoted
nest += 1
elsif ch == @quoted
@ -1270,7 +1270,7 @@ class RDoc::RubyLex
escape << ch << read_escape
end
else
# other characters
# other characters
end
escape

View file

@ -1,5 +1,5 @@
#--
# irb/ruby-token.rb - ruby tokens
# irb/ruby-token.rb - ruby tokens
# $Release Version: 0.9.5$
# $Revision: 11708 $
# $Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
@ -211,7 +211,7 @@ module RDoc::RubyToken
IRB.fail TkReading2TokenNoKey, token
end
tk = Token(tk[0], value)
tk = Token(tk[0], value)
if tk.kind_of?(TkOp) then
tk.name = token
@ -221,8 +221,8 @@ module RDoc::RubyToken
IRB.fail TkSymbol2TokenNoKey, token
end
tk = Token(tk[0], value)
else
tk = Token(tk[0], value)
else
if token.instance_method(:initialize).arity == 3 then
tk = token.new(@prev_seek, @prev_line_no, @prev_char_no)
tk.set_text value

View file

@ -9,7 +9,7 @@ class TestRDocMarkupToAnsi < RDoc::Markup::FormatterTestCase
def setup
super
@to = RDoc::Markup::ToAnsi.new
end

View file

@ -9,7 +9,7 @@ class TestRDocMarkupToRdoc < RDoc::Markup::FormatterTestCase
def setup
super
@to = RDoc::Markup::ToRdoc.new
end

View file

@ -1240,7 +1240,7 @@ end
util_parser 'class A; B = "#{c}"; end'
while tk = @parser.get_tk do last_tk = tk end
assert_equal "\n", last_tk.text
end

View file

@ -502,7 +502,7 @@ Foo::Bar#bother
util_store
out, err = capture_io do
@driver.list_known_classes
@driver.list_known_classes
end
assert_equal "Ambiguous\nFoo\nFoo::Bar\nFoo::Baz\nInc\n", out

View file

@ -3,18 +3,18 @@ require 'minitest/autorun'
require 'rdoc/task'
class TestRDocTask < MiniTest::Unit::TestCase
def setup
Rake::Task.clear
end
def test_tasks_creation
RDoc::Task.new
assert Rake::Task[:rdoc]
assert Rake::Task[:clobber_rdoc]
assert Rake::Task[:rerdoc]
end
def test_tasks_creation_with_custom_name_symbol
rd = RDoc::Task.new(:rdoc_dev)
assert Rake::Task[:rdoc_dev]
@ -22,7 +22,7 @@ class TestRDocTask < MiniTest::Unit::TestCase
assert Rake::Task[:rerdoc_dev]
assert_equal :rdoc_dev, rd.name
end
def test_tasks_creation_with_custom_name_string
rd = RDoc::Task.new("rdoc_dev")
assert Rake::Task[:rdoc_dev]
@ -30,7 +30,7 @@ class TestRDocTask < MiniTest::Unit::TestCase
assert Rake::Task[:rerdoc_dev]
assert_equal "rdoc_dev", rd.name
end
def test_tasks_creation_with_custom_name_hash
options = { :rdoc => "rdoc", :clobber_rdoc => "rdoc:clean", :rerdoc => "rdoc:force" }
rd = RDoc::Task.new(options)
@ -40,25 +40,25 @@ class TestRDocTask < MiniTest::Unit::TestCase
assert_raises(RuntimeError) { Rake::Task[:clobber_rdoc] }
assert_equal options, rd.name
end
def test_tasks_creation_with_custom_name_hash_will_use_default_if_an_option_isnt_given
rd = RDoc::Task.new(:clobber_rdoc => "rdoc:clean")
assert Rake::Task[:rdoc]
assert Rake::Task[:"rdoc:clean"]
assert Rake::Task[:rerdoc]
end
def test_tasks_creation_with_custom_name_hash_raises_exception_if_invalid_option_given
assert_raises(ArgumentError) do
RDoc::Task.new(:foo => "bar")
end
begin
RDoc::Task.new(:foo => "bar")
rescue ArgumentError => e
assert_match(/foo/, e.message)
end
end
end