diff --git a/mrblib/10error.rb b/mrblib/10error.rb index 98d4d2a76..734e48b12 100644 --- a/mrblib/10error.rb +++ b/mrblib/10error.rb @@ -14,7 +14,7 @@ class NoMethodError < NameError def initialize(message=nil, name=nil, args=nil) @args = args - super message, name + super(message, name) end end diff --git a/mrblib/array.rb b/mrblib/array.rb index 937b5d1be..8b04b680e 100644 --- a/mrblib/array.rb +++ b/mrblib/array.rb @@ -13,7 +13,7 @@ class Array # # ISO 15.2.12.5.10 def each(&block) - return to_enum :each unless block + return to_enum(:each) unless block idx = 0 while idx < length @@ -33,7 +33,7 @@ class Array # # ISO 15.2.12.5.11 def each_index(&block) - return to_enum :each_index unless block + return to_enum(:each_index) unless block idx = 0 while idx < length @@ -54,7 +54,7 @@ class Array # # ISO 15.2.12.5.7 def collect!(&block) - return to_enum :collect! unless block + return to_enum(:collect!) unless block idx = 0 len = size diff --git a/mrblib/enum.rb b/mrblib/enum.rb index e4f8973dd..956c8644f 100644 --- a/mrblib/enum.rb +++ b/mrblib/enum.rb @@ -57,7 +57,7 @@ module Enumerable # # ISO 15.3.2.2.3 def collect(&block) - return to_enum :collect unless block + return to_enum(:collect) unless block ary = [] self.each{|*val| ary.push(block.call(*val))} @@ -73,7 +73,7 @@ module Enumerable # # ISO 15.3.2.2.4 def detect(ifnone=nil, &block) - return to_enum :detect, ifnone unless block + return to_enum(:detect, ifnone) unless block self.each{|*val| if block.call(*val) @@ -91,7 +91,7 @@ module Enumerable # # ISO 15.3.2.2.5 def each_with_index(&block) - return to_enum :each_with_index unless block + return to_enum(:each_with_index) unless block i = 0 self.each{|*val| @@ -129,7 +129,7 @@ module Enumerable # # ISO 15.3.2.2.8 def find_all(&block) - return to_enum :find_all unless block + return to_enum(:find_all) unless block ary = [] self.each{|*val| @@ -284,7 +284,7 @@ module Enumerable # # ISO 15.3.2.2.16 def partition(&block) - return to_enum :partition unless block + return to_enum(:partition) unless block ary_T = [] ary_F = [] @@ -306,7 +306,7 @@ module Enumerable # # ISO 15.3.2.2.17 def reject(&block) - return to_enum :reject unless block + return to_enum(:reject) unless block ary = [] self.each{|*val| diff --git a/mrblib/hash.rb b/mrblib/hash.rb index bee4abf23..1533b1cd7 100644 --- a/mrblib/hash.rb +++ b/mrblib/hash.rb @@ -52,7 +52,7 @@ class Hash # # ISO 15.2.13.4.9 def each(&block) - return to_enum :each unless block + return to_enum(:each) unless block keys = self.keys vals = self.values @@ -85,7 +85,7 @@ class Hash # # ISO 15.2.13.4.10 def each_key(&block) - return to_enum :each_key unless block + return to_enum(:each_key) unless block self.keys.each{|k| block.call(k)} self @@ -110,7 +110,7 @@ class Hash # # ISO 15.2.13.4.11 def each_value(&block) - return to_enum :each_value unless block + return to_enum(:each_value) unless block self.values.each{|v| block.call(v)} self @@ -165,7 +165,7 @@ class Hash # 1.8/1.9 Hash#reject! returns Hash; ISO says nothing. # def reject!(&block) - return to_enum :reject! unless block + return to_enum(:reject!) unless block keys = [] self.each{|k,v| @@ -196,7 +196,7 @@ class Hash # 1.8/1.9 Hash#reject returns Hash; ISO says nothing. # def reject(&block) - return to_enum :reject unless block + return to_enum(:reject) unless block h = {} self.each{|k,v| @@ -218,7 +218,7 @@ class Hash # 1.9 Hash#select! returns Hash; ISO says nothing. # def select!(&block) - return to_enum :select! unless block + return to_enum(:select!) unless block keys = [] self.each{|k,v| @@ -249,7 +249,7 @@ class Hash # 1.9 Hash#select returns Hash; ISO says nothing # def select(&block) - return to_enum :select unless block + return to_enum(:select) unless block h = {} self.each{|k,v| diff --git a/mrblib/kernel.rb b/mrblib/kernel.rb index 510c89e17..52c3e4931 100644 --- a/mrblib/kernel.rb +++ b/mrblib/kernel.rb @@ -25,7 +25,7 @@ module Kernel # # ISO 15.3.1.3.29 private def loop(&block) - return to_enum :loop unless block + return to_enum(:loop) unless block while true yield diff --git a/mrblib/numeric.rb b/mrblib/numeric.rb index 004af69b9..10e6f55ad 100644 --- a/mrblib/numeric.rb +++ b/mrblib/numeric.rb @@ -70,7 +70,7 @@ class Integer # # ISO 15.2.8.3.22 def times(&block) - return to_enum :times unless block + return to_enum(:times) unless block i = 0 while i < self diff --git a/mrblib/range.rb b/mrblib/range.rb index 0fb0e8cbd..96e2ebf24 100644 --- a/mrblib/range.rb +++ b/mrblib/range.rb @@ -15,7 +15,7 @@ class Range # # ISO 15.2.14.4.4 def each(&block) - return to_enum :each unless block + return to_enum(:each) unless block val = self.begin last = self.end