Skip to content

Commit

Permalink
* basictest/test.rb: Adjust spaces in class declarations
Browse files Browse the repository at this point in the history
  with inheritance. [fix rubyGH-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
  • Loading branch information
hsbt committed Oct 7, 2016
1 parent 87d7a06 commit 6b35c34
Show file tree
Hide file tree
Showing 16 changed files with 42 additions and 31 deletions.
11 changes: 11 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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>

* load.c (rb_require_safe): SyntaxError created by the parser just
Expand Down
6 changes: 3 additions & 3 deletions basictest/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2242,11 +2242,11 @@ def defined_test
class Alias0
def foo; "foo" end
end
class Alias1<Alias0
class Alias1 < Alias0
alias bar foo
def foo; "foo+" + super end
end
class Alias2<Alias1
class Alias2 < Alias1
alias baz foo
undef foo
end
Expand All @@ -2258,7 +2258,7 @@ class Alias2<Alias1
# test_check for cache
test_ok(x.baz == "foo+foo")

class Alias3<Alias2
class Alias3 < Alias2
def foo
defined? super
end
Expand Down
4 changes: 2 additions & 2 deletions lib/irb/cmd/chws.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
module IRB
module ExtendCommand

class CurrentWorkingWorkspace<Nop
class CurrentWorkingWorkspace < Nop
def execute(*obj)
irb_context.main
end
end

class ChangeWorkspace<Nop
class ChangeWorkspace < Nop
def execute(*obj)
irb_context.change_workspace(*obj)
irb_context.main
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/cmd/fork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# :stopdoc:
module IRB
module ExtendCommand
class Fork<Nop
class Fork < Nop
def execute
pid = send ExtendCommand.irb_original_method_name("fork")
unless pid
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/cmd/help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# :stopdoc:
module IRB
module ExtendCommand
class Help<Nop
class Help < Nop
begin
Ri = RDoc::RI::Driver.new
rescue SystemExit
Expand Down
6 changes: 3 additions & 3 deletions lib/irb/cmd/load.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
# :stopdoc:
module IRB
module ExtendCommand
class Load<Nop
class Load < Nop
include IrbLoader

def execute(file_name, priv = nil)
return irb_load(file_name, priv)
end
end

class Require<Nop
class Require < Nop
include IrbLoader

def execute(file_name)
Expand Down Expand Up @@ -55,7 +55,7 @@ def execute(file_name)
end
end

class Source<Nop
class Source < Nop
include IrbLoader
def execute(file_name)
source_file(file_name)
Expand Down
6 changes: 3 additions & 3 deletions lib/irb/cmd/pushws.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
# :stopdoc:
module IRB
module ExtendCommand
class Workspaces<Nop
class Workspaces < Nop
def execute(*obj)
irb_context.workspaces.collect{|ws| ws.main}
end
end

class PushWorkspace<Workspaces
class PushWorkspace < Workspaces
def execute(*obj)
irb_context.push_workspace(*obj)
super
end
end

class PopWorkspace<Workspaces
class PopWorkspace < Workspaces
def execute(*obj)
irb_context.pop_workspace(*obj)
super
Expand Down
8 changes: 4 additions & 4 deletions lib/irb/cmd/subirb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@
# :stopdoc:
module IRB
module ExtendCommand
class IrbCommand<Nop
class IrbCommand < Nop
def execute(*obj)
IRB.irb(nil, *obj)
end
end

class Jobs<Nop
class Jobs < Nop
def execute
IRB.JobManager
end
end

class Foreground<Nop
class Foreground < Nop
def execute(key)
IRB.JobManager.switch(key)
end
end

class Kill<Nop
class Kill < Nop
def execute(*keys)
IRB.JobManager.kill(*keys)
end
Expand Down
6 changes: 3 additions & 3 deletions lib/irb/notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def exec_if
# create a new composite notifier. Using the first composite notifier
# object you create, sibling notifiers can be initialized with
# #def_notifier.
class CompositeNotifier<AbstractNotifier
class CompositeNotifier < AbstractNotifier
# Create a new composite notifier object with the given +prefix+, and
# +base_notifier+ to use for output.
def initialize(prefix, base_notifier)
Expand Down Expand Up @@ -174,7 +174,7 @@ def level_notifier=(value)

# A leveled notifier is comparable to the composite group from
# CompositeNotifier#notifiers.
class LeveledNotifier<AbstractNotifier
class LeveledNotifier < AbstractNotifier
include Comparable

# Create a new leveled notifier with the given +base+, and +prefix+ to
Expand Down Expand Up @@ -212,7 +212,7 @@ def notify?
#
# This notifier is used as the +zero+ index, or level +0+, for
# 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.
def initialize
@base_notifier = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/irb/output-method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def ppx(prefix, *objs)
end

# A standard output printer
class StdioOutputMethod<OutputMethod
class StdioOutputMethod < OutputMethod
# Prints the given +opts+ to standard output, see IO#print for more
# information.
def print(*opts)
Expand Down
4 changes: 2 additions & 2 deletions lib/prime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def rewind

# An implementation of +PseudoPrimeGenerator+ which uses
# a prime table generated by trial division.
class TrialDivisionGenerator<PseudoPrimeGenerator
class TrialDivisionGenerator < PseudoPrimeGenerator
def initialize
@index = -1
super
Expand All @@ -345,7 +345,7 @@ def rewind
# This is a pseudo-prime generator, suitable on
# checking primality of an integer by brute force
# method.
class Generator23<PseudoPrimeGenerator
class Generator23 < PseudoPrimeGenerator
def initialize
@prime = 1
@step = nil
Expand Down
2 changes: 1 addition & 1 deletion lib/shell/builtin-command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
require "shell/filter"

class Shell
class BuiltInCommand<Filter
class BuiltInCommand < Filter
def wait?
false
end
Expand Down
8 changes: 4 additions & 4 deletions object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1569,7 +1569,7 @@ rb_mod_eqq(VALUE mod, VALUE arg)
* is the same as <i>other</i>. Returns
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B".)
* "class A < B" implies "A < B".)
*
*/

Expand Down Expand Up @@ -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
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
* "class A<B" implies "A<B".)
* "class A < B" implies "A < B".)
*
*/

Expand All @@ -1617,7 +1617,7 @@ rb_mod_lt(VALUE mod, VALUE arg)
* two modules are the same. Returns
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A".)
* "class A < B" implies "B > A".)
*
*/

Expand All @@ -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
* <code>nil</code> if there's no relationship between the two.
* (Think of the relationship in terms of the class definition:
* "class A<B" implies "B>A".)
* "class A < B" implies "B > A".)
*
*/

Expand Down
2 changes: 1 addition & 1 deletion sample/delegate.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'delegate'

class ExtArray<DelegateClass(Array)
class ExtArray < DelegateClass(Array)
def initialize()
super([])
end
Expand Down
2 changes: 1 addition & 1 deletion sample/export.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Foo # redefines foobar's scope

f.quux

class Bar<Foo
class Bar < Foo
def quux
super
baz()
Expand Down
2 changes: 1 addition & 1 deletion test/-ext-/method/test_arity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def foo2(a,b)
end
end

class B<A
class B < A
private :foo1, :foo2
end

Expand Down

0 comments on commit 6b35c34

Please sign in to comment.