ruby-changes:15291
From: nobu <ko1@a...>
Date: Fri, 2 Apr 2010 13:41:12 +0900 (JST)
Subject: [ruby-changes:15291] Ruby:r27176 (trunk): * {lib,test}/rdoc: removed trailing spaces. reapplied r22784.
nobu 2010-04-02 13:40:47 +0900 (Fri, 02 Apr 2010) New Revision: 27176 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=27176 Log: * {lib,test}/rdoc: removed trailing spaces. reapplied r22784. Modified files: trunk/lib/rdoc/generator/template/darkfish/js/darkfish.js trunk/lib/rdoc/generator/template/darkfish/js/quicksearch.js trunk/lib/rdoc/generator/template/darkfish/rdoc.css trunk/lib/rdoc/markup/to_html.rb trunk/lib/rdoc/markup.rb trunk/lib/rdoc/parser/c.rb trunk/lib/rdoc/parser/perl.rb trunk/lib/rdoc/parser/ruby.rb trunk/lib/rdoc/parser.rb trunk/lib/rdoc/ri/driver.rb trunk/lib/rdoc/ruby_lex.rb trunk/lib/rdoc/ruby_token.rb trunk/lib/rdoc.rb trunk/test/rdoc/test_rdoc_markup_to_ansi.rb trunk/test/rdoc/test_rdoc_markup_to_rdoc.rb trunk/test/rdoc/test_rdoc_parser_ruby.rb trunk/test/rdoc/test_rdoc_ri_driver.rb trunk/test/rdoc/test_rdoc_task.rb Index: lib/rdoc.rb =================================================================== --- lib/rdoc.rb (revision 27175) +++ lib/rdoc.rb (revision 27176) @@ -88,7 +88,7 @@ # # =begin rdoc # Documentation to be processed by RDoc. -# +# # ... # =end # @@ -104,7 +104,7 @@ # # 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 @@ # # def fred # :yields: index, position # # ... -# +# # yield line, address # # which will get documented as @@ -256,12 +256,12 @@ # 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 @@ # 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. Index: lib/rdoc/generator/template/darkfish/js/darkfish.js =================================================================== --- lib/rdoc/generator/template/darkfish/js/darkfish.js (revision 27175) +++ lib/rdoc/generator/template/darkfish/js/darkfish.js (revision 27176) @@ -1,10 +1,10 @@ /** - * + * * Darkfish Page Functions * $Id: darkfish.js 53 2009-01-07 02:52:03Z deveiant $ - * + * * Author: Michael Granger <mgranger@l...> - * + * */ /* Provide console simulation for firebug-less environments */ @@ -58,7 +58,7 @@ 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 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 + "]" ); Index: lib/rdoc/generator/template/darkfish/js/quicksearch.js =================================================================== --- lib/rdoc/generator/template/darkfish/js/quicksearch.js (revision 27175) +++ lib/rdoc/generator/template/darkfish/js/quicksearch.js (revision 27176) @@ -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@l...> - * + * */ jQuery.fn.quicksearch = function( target, searchElems, options ) { // console.debug( "Quicksearch fn" ); @@ -17,7 +17,7 @@ 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 @@ case 8: return true; break; - + // Only allow valid search characters default: return validQSChar( e.charCode ); @@ -88,7 +88,7 @@ var searchText = searchBox.value; var pat = new RegExp( searchText, "im" ); var shownCount = 0; - + if ( settings.noSearchResultsIndicator ) { $('#' + settings.noSearchResultsIndicator).hide(); } @@ -96,7 +96,7 @@ // All elements start out hidden $(searchElems).each( function(index) { var str = $(this).text(); - + if ( pat.test(str) ) { shownCount += 1; $(this).fadeIn(); Index: lib/rdoc/generator/template/darkfish/rdoc.css =================================================================== --- lib/rdoc/generator/template/darkfish/rdoc.css (revision 27175) +++ lib/rdoc/generator/template/darkfish/rdoc.css (revision 27176) @@ -1,9 +1,9 @@ /* * "Darkfish" Rdoc CSS * $Id: rdoc.css 54 2009-01-27 01:09:48Z deveiant $ - * + * * Author: Michael Granger <ged@F...> - * + * */ /* Base Green is: #6C8C22 */ Index: lib/rdoc/parser.rb =================================================================== --- lib/rdoc/parser.rb (revision 27175) +++ lib/rdoc/parser.rb (revision 27176) @@ -22,14 +22,14 @@ # 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 Index: lib/rdoc/markup/to_html.rb =================================================================== --- lib/rdoc/markup/to_html.rb (revision 27175) +++ lib/rdoc/markup/to_html.rb (revision 27176) @@ -290,7 +290,7 @@ # 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 Index: lib/rdoc/markup.rb =================================================================== --- lib/rdoc/markup.rb (revision 27175) +++ lib/rdoc/markup.rb (revision 27176) @@ -27,9 +27,9 @@ # 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/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>" # #-- Index: lib/rdoc/ri/driver.rb =================================================================== --- lib/rdoc/ri/driver.rb (revision 27175) +++ lib/rdoc/ri/driver.rb (revision 27176) @@ -532,7 +532,7 @@ elsif selector then # replace Foo with Foo:: as given completions.delete klass - completions << "#{klass}#{selector}" + completions << "#{klass}#{selector}" end completions.push(*methods) Index: lib/rdoc/ruby_token.rb =================================================================== --- lib/rdoc/ruby_token.rb (revision 27175) +++ lib/rdoc/ruby_token.rb (revision 27176) @@ -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 @@ 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 @@ 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 Index: lib/rdoc/ruby_lex.rb =================================================================== --- lib/rdoc/ruby_lex.rb (revision 27175) +++ lib/rdoc/ruby_lex.rb (revision 27176) @@ -144,7 +144,7 @@ end @seek += 1 if c == "\n" - @line_no += 1 + @line_no += 1 @char_no = 0 else @char_no += 1 @@ -181,10 +181,10 @@ 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 @@ 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 @@ 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 @@ end @OP.def_rules("*", "**", - "=", "==", "===", + "=", "==", "===", "=~", "<=>", "<", "<=", ">", ">=", ">>") do @@ -641,8 +641,8 @@ @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 @@ 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 @@ 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 @@ escape << ch << read_escape end else - # other characters + # other characters end escape Index: lib/rdoc/parser/ruby.rb =================================================================== --- lib/rdoc/parser/ruby.rb (revision 27175) +++ lib/rdoc/parser/ruby.rb (revision 27176) @@ -50,7 +50,7 @@ # # ## # # 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 @@ # # :call-seq: # # my_method(Range) # # my_method(offset, length) -# +# # def my_method(*args) # end # @@ -81,7 +81,7 @@ # # ## # # My method is awesome -# +# # def my_method(&block) # :yields: happy, times # block.call 1, 2 # end @@ -93,7 +93,7 @@ # # ## # # 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 @@ # ## # # :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 @@ # 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) Index: lib/rdoc/parser/c.rb =================================================================== --- lib/rdoc/parser/c.rb (revision 27175) +++ lib/rdoc/parser/c.rb (revision 27176) @@ -76,7 +76,7 @@ # * Encapsulate the writing and reading of the configuration # * file. ... # */ -# +# # /* # * Document-method: read_value # * Index: lib/rdoc/parser/perl.rb =================================================================== --- lib/rdoc/parser/perl.rb (revision 27175) +++ lib/rdoc/parser/perl.rb (revision 27176) @@ -15,7 +15,7 @@ # # 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 @@ # 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 @@ 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/, ''); Index: test/rdoc/test_rdoc_markup_to_rdoc.rb =================================================================== --- test/rdoc/test_rdoc_markup_to_rdoc.rb (revision 27175) +++ test/rdoc/test_rdoc_markup_to_rdoc.rb (revision 27176) @@ -9,7 +9,7 @@ def setup super - + @to = RDoc::Markup::ToRdoc.new end Index: test/rdoc/test_rdoc_markup_to_ansi.rb =================================================================== --- test/rdoc/test_rdoc_markup_to_ansi.rb (revision 27175) +++ test/rdoc/test_rdoc_markup_to_ansi.rb (revision 27176) @@ -9,7 +9,7 @@ def setup super - + @to = RDoc::Markup::ToAnsi.new end Index: test/rdoc/test_rdoc_ri_driver.rb =================================================================== --- test/rdoc/test_rdoc_ri_driver.rb (revision 27175) +++ test/rdoc/test_rdoc_ri_driver.rb (revision 27176) @@ -502,7 +502,7 @@ 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 Index: test/rdoc/test_rdoc_parser_ruby.rb =================================================================== --- test/rdoc/test_rdoc_parser_ruby.rb (revision 27175) +++ test/rdoc/test_rdoc_parser_ruby.rb (revision 27176) @@ -1240,7 +1240,7 @@ util_parser 'class A; B = "#{c}"; end' while tk = @parser.get_tk do last_tk = tk end - + assert_equal "\n", last_tk.text end Index: test/rdoc/test_rdoc_task.rb =================================================================== --- test/rdoc/test_rdoc_task.rb (revision 27175) +++ test/rdoc/test_rdoc_task.rb (revision 27176) @@ -3,18 +3,18 @@ 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 @@ 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 @@ 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 @@ 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/