Skip to content

Commit

Permalink
[Truffle] Add Kernel#{iterator?,readline,readlines}.
Browse files Browse the repository at this point in the history
  • Loading branch information
bjfish committed May 21, 2015
1 parent d96d677 commit f8782ac
Showing 4 changed files with 13 additions and 3 deletions.
1 change: 0 additions & 1 deletion spec/truffle/tags/core/kernel/iterator_tags.txt

This file was deleted.

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

This file was deleted.

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

This file was deleted.

13 changes: 13 additions & 0 deletions truffle/src/main/ruby/core/rubinius/common/kernel.rb
Original file line number Diff line number Diff line change
@@ -166,6 +166,9 @@ def autoload?(name)
end
private :autoload?

alias_method :iterator?, :block_given?
module_function :iterator?

def define_singleton_method(*args, &block)
singleton_class.send(:define_method, *args, &block)
end
@@ -302,6 +305,16 @@ def puts(*a)
end
module_function :puts

def readline(sep=$/)
ARGF.readline(sep)
end
module_function :readline

def readlines(sep=$/)
ARGF.readlines(sep)
end
module_function :readlines

def loop
return to_enum(:loop) unless block_given?

0 comments on commit f8782ac

Please sign in to comment.