* basictest/test.rb: Adjust spaces in class declarations

with inheritance. [fix GH-1227] Patch by @adrfer
* lib/irb/*: ditto.
* lib/prime.rb: ditto.
* lib/shell/builtin-command.rb: ditto.
* object.c: ditto.
* sample/*.rb: ditto.
* test/-ext-/method/test_arity.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
hsbt 2016-10-07 05:18:57 +00:00
parent 87d7a06660
commit 6b35c34c68
16 changed files with 42 additions and 31 deletions

View File

@ -1,3 +1,14 @@
Fri Oct 7 14:18:40 2016 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* basictest/test.rb: Adjust spaces in class declarations
with inheritance. [fix GH-1227] Patch by @adrfer
* lib/irb/*: ditto.
* lib/prime.rb: ditto.
* lib/shell/builtin-command.rb: ditto.
* object.c: ditto.
* sample/*.rb: ditto.
* test/-ext-/method/test_arity.rb: ditto.
Thu Oct 6 17:29:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Oct 6 17:29:44 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* load.c (rb_require_safe): SyntaxError created by the parser just * load.c (rb_require_safe): SyntaxError created by the parser just

View File

@ -2242,11 +2242,11 @@ test_check "alias"
class Alias0 class Alias0
def foo; "foo" end def foo; "foo" end
end end
class Alias1<Alias0 class Alias1 < Alias0
alias bar foo alias bar foo
def foo; "foo+" + super end def foo; "foo+" + super end
end end
class Alias2<Alias1 class Alias2 < Alias1
alias baz foo alias baz foo
undef foo undef foo
end end
@ -2258,7 +2258,7 @@ test_ok(x.baz == "foo+foo")
# test_check for cache # test_check for cache
test_ok(x.baz == "foo+foo") test_ok(x.baz == "foo+foo")
class Alias3<Alias2 class Alias3 < Alias2
def foo def foo
defined? super defined? super
end end

View File

@ -17,13 +17,13 @@ require "irb/ext/change-ws.rb"
module IRB module IRB
module ExtendCommand module ExtendCommand
class CurrentWorkingWorkspace<Nop class CurrentWorkingWorkspace < Nop
def execute(*obj) def execute(*obj)
irb_context.main irb_context.main
end end
end end
class ChangeWorkspace<Nop class ChangeWorkspace < Nop
def execute(*obj) def execute(*obj)
irb_context.change_workspace(*obj) irb_context.change_workspace(*obj)
irb_context.main irb_context.main

View File

@ -14,7 +14,7 @@
# :stopdoc: # :stopdoc:
module IRB module IRB
module ExtendCommand module ExtendCommand
class Fork<Nop class Fork < Nop
def execute def execute
pid = send ExtendCommand.irb_original_method_name("fork") pid = send ExtendCommand.irb_original_method_name("fork")
unless pid unless pid

View File

@ -16,7 +16,7 @@ require "irb/cmd/nop.rb"
# :stopdoc: # :stopdoc:
module IRB module IRB
module ExtendCommand module ExtendCommand
class Help<Nop class Help < Nop
begin begin
Ri = RDoc::RI::Driver.new Ri = RDoc::RI::Driver.new
rescue SystemExit rescue SystemExit

View File

@ -16,7 +16,7 @@ require "irb/ext/loader"
# :stopdoc: # :stopdoc:
module IRB module IRB
module ExtendCommand module ExtendCommand
class Load<Nop class Load < Nop
include IrbLoader include IrbLoader
def execute(file_name, priv = nil) def execute(file_name, priv = nil)
@ -24,7 +24,7 @@ module IRB
end end
end end
class Require<Nop class Require < Nop
include IrbLoader include IrbLoader
def execute(file_name) def execute(file_name)
@ -55,7 +55,7 @@ module IRB
end end
end end
class Source<Nop class Source < Nop
include IrbLoader include IrbLoader
def execute(file_name) def execute(file_name)
source_file(file_name) source_file(file_name)

View File

@ -16,20 +16,20 @@ require "irb/ext/workspaces.rb"
# :stopdoc: # :stopdoc:
module IRB module IRB
module ExtendCommand module ExtendCommand
class Workspaces<Nop class Workspaces < Nop
def execute(*obj) def execute(*obj)
irb_context.workspaces.collect{|ws| ws.main} irb_context.workspaces.collect{|ws| ws.main}
end end
end end
class PushWorkspace<Workspaces class PushWorkspace < Workspaces
def execute(*obj) def execute(*obj)
irb_context.push_workspace(*obj) irb_context.push_workspace(*obj)
super super
end end
end end
class PopWorkspace<Workspaces class PopWorkspace < Workspaces
def execute(*obj) def execute(*obj)
irb_context.pop_workspace(*obj) irb_context.pop_workspace(*obj)
super super

View File

@ -15,25 +15,25 @@ require "irb/ext/multi-irb"
# :stopdoc: # :stopdoc:
module IRB module IRB
module ExtendCommand module ExtendCommand
class IrbCommand<Nop class IrbCommand < Nop
def execute(*obj) def execute(*obj)
IRB.irb(nil, *obj) IRB.irb(nil, *obj)
end end
end end
class Jobs<Nop class Jobs < Nop
def execute def execute
IRB.JobManager IRB.JobManager
end end
end end
class Foreground<Nop class Foreground < Nop
def execute(key) def execute(key)
IRB.JobManager.switch(key) IRB.JobManager.switch(key)
end end
end end
class Kill<Nop class Kill < Nop
def execute(*keys) def execute(*keys)
IRB.JobManager.kill(*keys) IRB.JobManager.kill(*keys)
end end

View File

@ -113,7 +113,7 @@ module IRB
# create a new composite notifier. Using the first composite notifier # create a new composite notifier. Using the first composite notifier
# object you create, sibling notifiers can be initialized with # object you create, sibling notifiers can be initialized with
# #def_notifier. # #def_notifier.
class CompositeNotifier<AbstractNotifier class CompositeNotifier < AbstractNotifier
# Create a new composite notifier object with the given +prefix+, and # Create a new composite notifier object with the given +prefix+, and
# +base_notifier+ to use for output. # +base_notifier+ to use for output.
def initialize(prefix, base_notifier) def initialize(prefix, base_notifier)
@ -174,7 +174,7 @@ module IRB
# A leveled notifier is comparable to the composite group from # A leveled notifier is comparable to the composite group from
# CompositeNotifier#notifiers. # CompositeNotifier#notifiers.
class LeveledNotifier<AbstractNotifier class LeveledNotifier < AbstractNotifier
include Comparable include Comparable
# Create a new leveled notifier with the given +base+, and +prefix+ to # Create a new leveled notifier with the given +base+, and +prefix+ to
@ -212,7 +212,7 @@ module IRB
# #
# This notifier is used as the +zero+ index, or level +0+, for # This notifier is used as the +zero+ index, or level +0+, for
# CompositeNotifier#notifiers, and will not output messages of any sort. # CompositeNotifier#notifiers, and will not output messages of any sort.
class NoMsgNotifier<LeveledNotifier class NoMsgNotifier < LeveledNotifier
# Creates a new notifier that should not be used to output messages. # Creates a new notifier that should not be used to output messages.
def initialize def initialize
@base_notifier = nil @base_notifier = nil

View File

@ -82,7 +82,7 @@ module IRB
end end
# A standard output printer # A standard output printer
class StdioOutputMethod<OutputMethod class StdioOutputMethod < OutputMethod
# Prints the given +opts+ to standard output, see IO#print for more # Prints the given +opts+ to standard output, see IO#print for more
# information. # information.
def print(*opts) def print(*opts)

View File

@ -324,7 +324,7 @@ class Prime
# An implementation of +PseudoPrimeGenerator+ which uses # An implementation of +PseudoPrimeGenerator+ which uses
# a prime table generated by trial division. # a prime table generated by trial division.
class TrialDivisionGenerator<PseudoPrimeGenerator class TrialDivisionGenerator < PseudoPrimeGenerator
def initialize def initialize
@index = -1 @index = -1
super super
@ -345,7 +345,7 @@ class Prime
# This is a pseudo-prime generator, suitable on # This is a pseudo-prime generator, suitable on
# checking primality of an integer by brute force # checking primality of an integer by brute force
# method. # method.
class Generator23<PseudoPrimeGenerator class Generator23 < PseudoPrimeGenerator
def initialize def initialize
@prime = 1 @prime = 1
@step = nil @step = nil

View File

@ -13,7 +13,7 @@
require "shell/filter" require "shell/filter"
class Shell class Shell
class BuiltInCommand<Filter class BuiltInCommand < Filter
def wait? def wait?
false false
end end

View File

@ -1569,7 +1569,7 @@ rb_mod_eqq(VALUE mod, VALUE arg)
* is the same as <i>other</i>. Returns * is the same as <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two. * <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition: * (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B".) * "class A < B" implies "A < B".)
* *
*/ */
@ -1597,7 +1597,7 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
* Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns * Returns true if <i>mod</i> is a subclass of <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two. * <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition: * (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B".) * "class A < B" implies "A < B".)
* *
*/ */
@ -1617,7 +1617,7 @@ rb_mod_lt(VALUE mod, VALUE arg)
* two modules are the same. Returns * two modules are the same. Returns
* <code>nil</code> if there's no relationship between the two. * <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition: * (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A".) * "class A < B" implies "B > A".)
* *
*/ */
@ -1638,7 +1638,7 @@ rb_mod_ge(VALUE mod, VALUE arg)
* Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns * Returns true if <i>mod</i> is an ancestor of <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two. * <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition: * (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A".) * "class A < B" implies "B > A".)
* *
*/ */

View File

@ -1,6 +1,6 @@
require 'delegate' require 'delegate'
class ExtArray<DelegateClass(Array) class ExtArray < DelegateClass(Array)
def initialize() def initialize()
super([]) super([])
end end

View File

@ -30,7 +30,7 @@ f.printf "%s\n", Foo
f.quux f.quux
class Bar<Foo class Bar < Foo
def quux def quux
super super
baz() baz()

View File

@ -17,7 +17,7 @@ class TestMethod < Test::Unit::TestCase
end end
end end
class B<A class B < A
private :foo1, :foo2 private :foo1, :foo2
end end