Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #755 from kachick/congratulate_private_methods_fro…
…m_lib-topaz

Congratulate private methods from lib-topaz
  • Loading branch information
alex committed Jun 22, 2013
2 parents cb4f154 + 8c09a87 commit 4fda4df
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions lib-topaz/array.rb
Expand Up @@ -17,6 +17,7 @@ def initialize(size_or_arr = nil, obj = nil, &block)
end
return self
end
private :initialize

def self.[](*args)
args.inject(allocate) { |array, arg| array << arg}
Expand Down
10 changes: 10 additions & 0 deletions lib-topaz/kernel.rb
Expand Up @@ -2,18 +2,22 @@ module Kernel
def puts(*args)
$stdout.puts(*args)
end
private :puts

def gets(sep = $/, limit = nil)
$stdin.gets(sep, limit)
end
private :gets

def print(*args)
$stdout.print(*args)
end
private :print

def p(*args)
args.each { |arg| $stdout.print(arg.inspect + "\n") }
end
private :p

def <=>(other)
self == other ? 0 : nil
Expand All @@ -28,16 +32,19 @@ def Array(arg)
[arg]
end
end
private :Array

def String(arg)
Topaz.convert_type(arg, String, :to_s)
end
module_function :String
private :String

def Integer(arg)
arg.to_i
end
module_function :Integer
private :Integer

def loop(&block)
return enum_for(:loop) unless block
Expand All @@ -50,6 +57,7 @@ def loop(&block)
end
nil
end
private :loop

def `(cmd)
cmd = Topaz.convert_type(cmd, String, :to_str)
Expand All @@ -60,6 +68,7 @@ def `(cmd)
end
res
end
private :`

def to_enum(method = :each, *args)
Enumerator.new(self, method, *args)
Expand All @@ -79,4 +88,5 @@ def rand(max = 1.0)
end
Random.rand(max)
end
private :rand
end
1 change: 0 additions & 1 deletion spec/tags/core/array/initialize_tags.txt
@@ -1,2 +1 @@
fails:Array#initialize is private
fails:Array#initialize with (size, object=nil) raises an ArgumentError if size is too large
1 change: 0 additions & 1 deletion spec/tags/core/kernel/Array_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/kernel/Integer_tags.txt
Expand Up @@ -178,6 +178,5 @@ fails:Kernel#Integer is a negative decimal number if there's a leading -0D and a
fails:Kernel#Integer parses the value as a decimal number if there's a leading 0d and a base of 10
fails:Kernel#Integer is a positive decimal number if there's a leading +0d and a base of 10
fails:Kernel#Integer is a negative decimal number if there's a leading -0d and a base of 10
fails:Kernel#Integer is a private method
fails:Kernel#Integer raises an ArgumentError if the String ends with a null byte
fails:Kernel#Integer raises an ArgumentError if the String contains a null byte
1 change: 0 additions & 1 deletion spec/tags/core/kernel/String_tags.txt
@@ -1,3 +1,2 @@
fails:Kernel.String raises a TypeError if respond_to? returns false for #to_s
fails:Kernel#String raises a TypeError if respond_to? returns false for #to_s
fails:Kernel#String is a private method
1 change: 0 additions & 1 deletion spec/tags/core/kernel/backtick_tags.txt
@@ -1,2 +1 @@
fails:Kernel#` is a private method
fails:Kernel#` sets $? to the exit status of the executed sub-process
1 change: 0 additions & 1 deletion spec/tags/core/kernel/gets_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/kernel/loop_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/kernel/p_tags.txt
@@ -1,2 +1 @@
fails:Kernel#p is a private method
fails:Kernel#p is not affected by setting $\, $/ or $,
1 change: 0 additions & 1 deletion spec/tags/core/kernel/print_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/tags/core/kernel/puts_tags.txt
@@ -1,2 +1 @@
fails:Kernel#puts is a private method
fails:Kernel#puts writes [...] for a recursive array arg
1 change: 0 additions & 1 deletion spec/tags/core/kernel/rand_tags.txt

This file was deleted.

0 comments on commit 4fda4df

Please sign in to comment.