Skip to content

Commit c9a5d6b

Browse files
committed
Trailing whitespace
1 parent 3f51d6f commit c9a5d6b

File tree

6 files changed

+62
-63
lines changed

6 files changed

+62
-63
lines changed

lib/rdoc/markup/to_html.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ def convert_string_fancy(item)
312312

313313
# convert -- to em-dash, (-- to en-dash)
314314
gsub(/---?/, '—'). #gsub(/--/, '–').
315-
315+
316316
# convert ... to elipsis (and make sure .... becomes .<elipsis>)
317317
gsub(/\.\.\.\./, '.&#8230;').gsub(/\.\.\./, '&#8230;').
318318

lib/rdoc/markup/to_html_crossref.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
1010
attr_accessor :context
1111

1212
# Regular expressions to match class and method references.
13-
#
13+
#
1414
# 1.) There can be a '\' in front of text to suppress
1515
# any cross-references (note, however, that the single '\'
1616
# is written as '\\\\' in order to escape it twice, once

lib/rdoc/parser/c.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def do_aliases
124124
end
125125

126126
def do_classes
127-
@content.scan(/(\w+)\s* = \s*rb_define_module\s*\(\s*"(\w+)"\s*\)/mx) do
127+
@content.scan(/(\w+)\s* = \s*rb_define_module\s*\(\s*"(\w+)"\s*\)/mx) do
128128
|var_name, class_name|
129129
handle_class_module(var_name, "module", class_name, nil, nil)
130130
end

lib/rdoc/parser/f95.rb

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def scan
295295

296296
@stats.add_module f9x_module
297297

298-
f9x_comment = COMMENTS_ARE_UPPER ?
298+
f9x_comment = COMMENTS_ARE_UPPER ?
299299
find_comments(pre_comment.join("\n")) + "\n" + module_trailing :
300300
module_trailing + "\n" + find_comments(module_code.sub(/^.*$\n/i, ''))
301301
f9x_module.comment = f9x_comment
@@ -320,8 +320,8 @@ def scan
320320
program_code = module_program_code
321321
program_trailing = module_program_trailing
322322
# progress "p" # HACK what stats thingy does this correspond to?
323-
program_comment = COMMENTS_ARE_UPPER ?
324-
find_comments(pre_comment.join("\n")) + "\n" + program_trailing :
323+
program_comment = COMMENTS_ARE_UPPER ?
324+
find_comments(pre_comment.join("\n")) + "\n" + program_trailing :
325325
program_trailing + "\n" + find_comments(program_code.sub(/^.*$\n/i, ''))
326326
program_comment = "\n\n= <i>Program</i> <tt>#{program_name}</tt>\n\n" \
327327
+ program_comment
@@ -410,12 +410,12 @@ def parse_program_or_module(container, code,
410410
# This information is used when "add_method" and
411411
# "set_visibility_for" are called.
412412
#
413-
visibility_default, visibility_info =
413+
visibility_default, visibility_info =
414414
parse_visibility(remaining_lines.join("\n"), visibility, container)
415415
@@public_methods.concat visibility_info
416416
if visibility_default == :public
417417
if !cascaded_modules_list.empty?
418-
cascaded_modules =
418+
cascaded_modules =
419419
Attr.new("Cascaded Modules",
420420
"Imported modules all of whose components are published again",
421421
"",
@@ -499,7 +499,7 @@ def parse_program_or_module(container, code,
499499
type_trailing = find_comments($4)
500500
next if type_trailing =~ /^:nodoc:/
501501
type_visibility = $1
502-
type_comment = COMMENTS_ARE_UPPER ?
502+
type_comment = COMMENTS_ARE_UPPER ?
503503
find_comments($~.pre_match) + "\n" + type_trailing :
504504
type_trailing + "\n" + find_comments(type_code.sub(/^.*$\n/i, ''))
505505
type_element_visibility_public = true
@@ -567,8 +567,8 @@ def parse_program_or_module(container, code,
567567
end
568568

569569
if !derived_types_comment.empty?
570-
derived_types_table =
571-
Attr.new("Derived Types", "Derived_Types", "",
570+
derived_types_table =
571+
Attr.new("Derived Types", "Derived_Types", "",
572572
derived_types_comment)
573573
container.add_attribute(derived_types_table)
574574
end
@@ -733,8 +733,8 @@ def parse_program_or_module(container, code,
733733
subroutine_trailing = procedure_trailing
734734
subroutine_code = procedure_code
735735

736-
subroutine_comment = COMMENTS_ARE_UPPER ?
737-
pre_comment.join("\n") + "\n" + subroutine_trailing :
736+
subroutine_comment = COMMENTS_ARE_UPPER ?
737+
pre_comment.join("\n") + "\n" + subroutine_trailing :
738738
subroutine_trailing + "\n" + subroutine_code.sub(/^.*$\n/i, '')
739739
subroutine = AnyMethod.new("subroutine", subroutine_name)
740740
parse_subprogram(subroutine, subroutine_params,
@@ -787,7 +787,7 @@ def parse_program_or_module(container, code,
787787

788788
# The visibility of procedure is specified
789789
#
790-
set_visibility(container, procedure_name,
790+
set_visibility(container, procedure_name,
791791
visibility_default, @@public_methods)
792792

793793
# The alias for this procedure from external modules
@@ -871,11 +871,11 @@ def parse_program_or_module(container, code,
871871
next if !old_meth
872872
nolink = old_meth.visibility == :private ? true : nil
873873
nolink = nil if @options.show_all
874-
new_meth =
875-
initialize_external_method(generic_name, proc,
876-
old_meth.params, nil,
877-
old_meth.comment,
878-
old_meth.clone.token_stream[0].text,
874+
new_meth =
875+
initialize_external_method(generic_name, proc,
876+
old_meth.params, nil,
877+
old_meth.comment,
878+
old_meth.clone.token_stream[0].text,
879879
true, nolink)
880880
new_meth.singleton = old_meth.singleton
881881

@@ -937,10 +937,10 @@ def parse_program_or_module(container, code,
937937
end
938938

939939
if indicated_method
940-
external_method =
941-
initialize_external_method(generic_name, proc,
942-
indicated_method.params,
943-
indicated_file,
940+
external_method =
941+
initialize_external_method(generic_name, proc,
942+
indicated_method.params,
943+
indicated_file,
944944
indicated_method.comment)
945945

946946
@stats.add_method external_method
@@ -1004,12 +1004,12 @@ def parse_program_or_module(container, code,
10041004
# Parse arguments, comment, code of subroutine and function. Return
10051005
# AnyMethod object.
10061006

1007-
def parse_subprogram(subprogram, params, comment, code,
1007+
def parse_subprogram(subprogram, params, comment, code,
10081008
before_contains=nil, function=nil, prefix=nil)
10091009
subprogram.singleton = false
10101010
prefix = "" if !prefix
10111011
arguments = params.sub(/\(/, "").sub(/\)/, "").split(",") if params
1012-
args_comment, params_opt =
1012+
args_comment, params_opt =
10131013
find_arguments(arguments, code.sub(/^s*?contains\s*?(!.*?)?$.*/im, ""),
10141014
nil, nil, true)
10151015
params_opt = "( " + params_opt + " ) " if params_opt
@@ -1086,7 +1086,7 @@ def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
10861086
if arg == defitem.varname.strip.chomp || all
10871087
args_rdocforms << <<-"EOF"
10881088
1089-
#{indent}<tt><b>#{defitem.varname.chomp.strip}#{defitem.arraysuffix}</b> #{defitem.inivalue}</tt> ::
1089+
#{indent}<tt><b>#{defitem.varname.chomp.strip}#{defitem.arraysuffix}</b> #{defitem.inivalue}</tt> ::
10901090
#{indent} <tt>#{defitem.types.chomp.strip}</tt>
10911091
EOF
10921092
if !defitem.comment.chomp.strip.empty?
@@ -1096,7 +1096,7 @@ def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
10961096
}
10971097
args_rdocforms << <<-"EOF"
10981098
1099-
#{indent} <tt></tt> ::
1099+
#{indent} <tt></tt> ::
11001100
#{indent} <tt></tt>
11011101
#{indent} #{comment.chomp.strip}
11021102
EOF
@@ -1130,7 +1130,7 @@ def find_namelists(text, before_contains=nil)
11301130
before_contains = "" if !before_contains
11311131
while lines =~ /^\s*?namelist\s+\/\s*?(\w+)\s*?\/([\s\w\,]+)$/i
11321132
lines = $~.post_match
1133-
nml_comment = COMMENTS_ARE_UPPER ?
1133+
nml_comment = COMMENTS_ARE_UPPER ?
11341134
find_comments($~.pre_match) : find_comments($~.post_match)
11351135
nml_name = $1
11361136
nml_args = $2.split(",")
@@ -1193,7 +1193,7 @@ def initialize_external_method(new, old, params, file, comment, token=nil,
11931193

11941194
if internal
11951195
external_alias_header = "#{INTERNAL_ALIAS_MES} "
1196-
external_alias_text = external_alias_header + old
1196+
external_alias_text = external_alias_header + old
11971197
elsif file
11981198
external_alias_header = "#{EXTERNAL_ALIAS_MES} "
11991199
external_alias_text = external_alias_header + file + "#" + old
@@ -1325,8 +1325,8 @@ def check_external_aliases(subname, params, comment, test=nil)
13251325
subname.upcase == alias_item["old_name"].upcase &&
13261326
@options.ignore_case
13271327

1328-
new_meth = initialize_external_method(alias_item["new_name"],
1329-
subname, params, @file_name,
1328+
new_meth = initialize_external_method(alias_item["new_name"],
1329+
subname, params, @file_name,
13301330
comment)
13311331
new_meth.visibility = alias_item["visibility"]
13321332

@@ -1402,7 +1402,7 @@ def united_to_one_line(f90src)
14021402
brank_flag = false
14031403
now_continuing = false
14041404
next ""
1405-
else
1405+
else
14061406
brank_flag = false
14071407
now_continuing = false
14081408
ignore = false
@@ -1595,7 +1595,7 @@ def remove_trailing_alias(text)
15951595
comment_block = Array.new
15961596
checked = false
15971597
lines.each do |line|
1598-
if !checked
1598+
if !checked
15991599
if /^\s?#{INTERNAL_ALIAS_MES}/ =~ line ||
16001600
/^\s?#{EXTERNAL_ALIAS_MES}/ =~ line
16011601
checked = true
@@ -1676,9 +1676,9 @@ def initialize(varname, types, inivalue, arraysuffix, comment,
16761676

16771677
def to_s
16781678
return <<-EOF
1679-
<Fortran95Definition:
1679+
<Fortran95Definition:
16801680
varname=#{@varname}, types=#{types},
1681-
inivalue=#{@inivalue}, arraysuffix=#{@arraysuffix}, nodoc=#{@nodoc},
1681+
inivalue=#{@inivalue}, arraysuffix=#{@arraysuffix}, nodoc=#{@nodoc},
16821682
comment=
16831683
#{@comment}
16841684
>

lib/rdoc/ri/display.rb

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -119,35 +119,35 @@ def display_class_info(klass)
119119
return display_class_method_list(klass)
120120
end
121121
end
122-
122+
123123
##
124124
# Given a Hash mapping a class' methods to method types (returned by
125-
# display_class_method_list), this method allows the user to
126-
# choose one of the methods.
127-
125+
# display_class_method_list), this method allows the user to choose one of
126+
# the methods.
127+
128128
def get_class_method_choice(method_map)
129129
if CAN_USE_READLINE
130130
# prepare abbreviations for tab completion
131131
abbreviations = method_map.keys.abbrev
132-
Readline.completion_proc = proc do |string|
132+
Readline.completion_proc = proc do |string|
133133
abbreviations.values.uniq.grep(/^#{string}/)
134134
end
135135
end
136-
136+
137137
@formatter.raw_print_line "\nEnter the method name you want.\n"
138138
@formatter.raw_print_line "Class methods can be preceeded by '::' and instance methods by '#'.\n"
139139

140140
if CAN_USE_READLINE
141141
@formatter.raw_print_line "You can use tab to autocomplete.\n"
142142
@formatter.raw_print_line "Enter a blank line to exit.\n"
143-
143+
144144
choice_string = Readline.readline(">> ").strip
145145
else
146146
@formatter.raw_print_line "Enter a blank line to exit.\n"
147147
@formatter.raw_print_line ">> "
148148
choice_string = $stdin.gets.strip
149149
end
150-
150+
151151
if choice_string == ''
152152
return nil
153153
else
@@ -172,11 +172,10 @@ def get_class_method_choice(method_map)
172172
end
173173
end
174174
end
175-
176175

177176
##
178-
# Display methods on +klass+
179-
# Returns a hash mapping method name to method contents (HACK?)
177+
# Display methods on +klass+. Returns a hash mapping method name to method
178+
# contents
180179

181180
def display_class_method_list(klass)
182181
method_map = {}
@@ -187,16 +186,16 @@ def display_class_method_list(klass)
187186
:instance_methods,
188187
:instance_method_extensions,
189188
]
190-
189+
191190
class_data.each do |data_type|
192191
data = klass.send data_type
193-
192+
194193
unless data.nil? or data.empty? then
195194
@formatter.blankline
196-
195+
197196
heading = data_type.to_s.split('_').join(' ').capitalize << ':'
198197
@formatter.display_heading heading, 2, ''
199-
198+
200199
method_names = []
201200
data.each do |item|
202201
method_names << item.name
@@ -268,7 +267,7 @@ def display_method_list(methods)
268267
end
269268
end
270269
end
271-
270+
272271
##
273272
# Display a list of +methods+ and allow the user to select one of them.
274273

@@ -280,9 +279,9 @@ def display_method_list_choice(methods)
280279
methods.each_with_index do |method, index|
281280
@formatter.raw_print_line "%3d %s [%s]\n" % [index + 1, method.full_name, method.source_path]
282281
end
283-
282+
284283
@formatter.raw_print_line ">> "
285-
284+
286285
choice = $stdin.gets.strip!
287286

288287
if(choice == '')
@@ -294,7 +293,7 @@ def display_method_list_choice(methods)
294293
if ((choice == 0) || (choice > methods.size)) then
295294
@formatter.raw_print_line "Invalid choice!\n"
296295
else
297-
method = methods[choice - 1]
296+
method = methods[choice - 1]
298297
display_method_info(method)
299298
end
300299
end

lib/rdoc/ri/driver.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111

1212
class RDoc::RI::Driver
1313

14-
#
15-
# This class offers both Hash and OpenStruct functionality.
16-
# We convert from the Core Hash to this before calling any of
17-
# the display methods, in order to give the display methods
18-
# a cleaner API for accessing the data.
19-
#
14+
##
15+
# This class offers both Hash and OpenStruct functionality. We convert from
16+
# the Core Hash to this before calling any of the display methods, in order
17+
# to give the display methods a cleaner API for accessing the data.
18+
2019
class OpenStructHash < Hash
21-
#
20+
21+
##
2222
# This method converts from a Hash to an OpenStructHash.
23-
#
23+
2424
def self.convert(object)
2525
case object
2626
when Hash then
@@ -527,7 +527,7 @@ def lookup_ancestor(klass, orig_klass)
527527
ancestors = [orig_klass]
528528
ancestors.push(*cache.includes.map { |inc| inc['name'] })
529529
ancestors << cache.superclass
530-
530+
531531
ancestor_index = ancestors.index(klass)
532532

533533
if ancestor_index

0 commit comments

Comments
 (0)