Skip to content
Permalink
Browse files
Merge remote-tracking branch 'origin' into codedb
  • Loading branch information
brixen committed Jan 25, 2016
2 parents d0d5ff6 + fa397f8 commit 7fe99aeee64e1f44bce423c558ac1ccea9b01b7b
Showing with 1,460 additions and 353 deletions.
  1. +5 −18 .travis.yml
  2. +1 −1 Gemfile.installed
  3. +1 −1 Gemfile.lock
  4. +6 −0 configure
  5. +0 −8 dockerfiles/ubuntu/14.04/Dockerfile
  6. +0 −8 dockerfiles/ubuntu/15.10/Dockerfile
  7. +5 −4 gems_list.txt
  8. +0 −7 kernel/bootstrap/io.rb
  9. +22 −0 kernel/common/argf.rb
  10. +42 −19 kernel/common/array.rb
  11. +1 −1 kernel/common/binding.rb
  12. +3 −7 kernel/common/comparable.rb
  13. +2 −0 kernel/common/complex.rb
  14. +39 −28 kernel/common/enumerable.rb
  15. +20 −10 kernel/common/enumerator.rb
  16. +15 −0 kernel/common/file.rb
  17. +48 −0 kernel/common/hash.rb
  18. +37 −12 kernel/common/io.rb
  19. +2 −1 kernel/common/kernel.rb
  20. +8 −0 kernel/common/numeric.rb
  21. +2 −2 kernel/common/random.rb
  22. +2 −1 kernel/common/string.rb
  23. +13 −0 kernel/common/struct.rb
  24. +1 −0 kernel/platform/posix.rb
  25. +8 −3 scripts/deploy.sh
  26. +4 −0 scripts/tag.sh
  27. +4 −7 spec/ruby/core/argf/close_spec.rb
  28. +3 −41 spec/ruby/core/argf/read_spec.rb
  29. +75 −0 spec/ruby/core/argf/readpartial_spec.rb
  30. +62 −0 spec/ruby/core/argf/shared/read.rb
  31. +66 −0 spec/ruby/core/array/bsearch_index_spec.rb
  32. +44 −0 spec/ruby/core/array/dig_spec.rb
  33. +15 −0 spec/ruby/core/bignum/negative_spec.rb
  34. +15 −0 spec/ruby/core/bignum/positive_spec.rb
  35. +2 −26 spec/ruby/core/comparable/equal_value_spec.rb
  36. +5 −1 spec/ruby/core/dir/close_spec.rb
  37. +2 −2 spec/ruby/core/dir/shared/open.rb
  38. +5 −19 spec/ruby/core/enumerable/chunk_spec.rb
  39. +36 −0 spec/ruby/core/enumerable/chunk_while_spec.rb
  40. +34 −0 spec/ruby/core/enumerable/grep_v_spec.rb
  41. +2 −26 spec/ruby/core/enumerable/slice_before_spec.rb
  42. +2 −2 spec/ruby/core/enumerator/lazy/drop_while_spec.rb
  43. +4 −0 spec/ruby/core/enumerator/lazy/fixtures/classes.rb
  44. +2 −2 spec/ruby/core/enumerator/lazy/grep_spec.rb
  45. +84 −0 spec/ruby/core/enumerator/lazy/grep_v_spec.rb
  46. +2 −2 spec/ruby/core/enumerator/lazy/initialize_spec.rb
  47. +2 −2 spec/ruby/core/enumerator/lazy/reject_spec.rb
  48. +2 −2 spec/ruby/core/enumerator/lazy/shared/collect_concat.rb
  49. +2 −2 spec/ruby/core/enumerator/lazy/shared/select.rb
  50. +1 −1 spec/ruby/core/enumerator/lazy/shared/to_enum.rb
  51. +2 −2 spec/ruby/core/enumerator/lazy/take_while_spec.rb
  52. +10 −0 spec/ruby/core/exception/receiver_spec.rb
  53. +2 −2 spec/ruby/core/exception/system_call_error_spec.rb
  54. +51 −0 spec/ruby/core/file/mkfifo_spec.rb
  55. +15 −0 spec/ruby/core/fixnum/negative_spec.rb
  56. +15 −0 spec/ruby/core/fixnum/positive_spec.rb
  57. +30 −0 spec/ruby/core/float/negative_spec.rb
  58. +30 −0 spec/ruby/core/float/positive_spec.rb
  59. +44 −0 spec/ruby/core/hash/dig_spec.rb
  60. +31 −0 spec/ruby/core/hash/fetch_values_spec.rb
  61. +13 −0 spec/ruby/core/hash/greater_than_or_equal_spec.rb
  62. +13 −0 spec/ruby/core/hash/greater_than_spec.rb
  63. +13 −0 spec/ruby/core/hash/less_than_or_equal_spec.rb
  64. +13 −0 spec/ruby/core/hash/less_than_spec.rb
  65. +15 −0 spec/ruby/core/hash/shared/comparison.rb
  66. +23 −0 spec/ruby/core/hash/shared/greater_than.rb
  67. +23 −0 spec/ruby/core/hash/shared/less_than.rb
  68. +20 −0 spec/ruby/core/hash/to_proc_spec.rb
  69. +4 −8 spec/ruby/core/io/close_read_spec.rb
  70. +2 −2 spec/ruby/core/io/close_spec.rb
  71. +4 −8 spec/ruby/core/io/close_write_spec.rb
  72. +21 −2 spec/ruby/core/io/puts_spec.rb
  73. +43 −11 spec/ruby/core/io/read_nonblock_spec.rb
  74. +9 −0 spec/ruby/core/io/shared/each.rb
  75. +13 −3 spec/ruby/core/io/write_nonblock_spec.rb
  76. +5 −0 spec/ruby/core/kernel/loop_spec.rb
  77. +66 −2 spec/ruby/core/kernel/rand_spec.rb
  78. +18 −0 spec/ruby/core/numeric/negative_spec.rb
  79. +18 −0 spec/ruby/core/numeric/positive_spec.rb
  80. +15 −0 spec/ruby/core/rational/negative_spec.rb
  81. +15 −0 spec/ruby/core/rational/positive_spec.rb
  82. +6 −0 spec/ruby/core/string/new_spec.rb
  83. +41 −0 spec/ruby/core/struct/dig_spec.rb
  84. +14 −0 spec/ruby/language/fixtures/super.rb
  85. +14 −0 spec/ruby/language/super_spec.rb
  86. +8 −0 spec/ruby/optional/capi/kernel_spec.rb
  87. +4 −6 spec/ruby/optional/capi/numeric_spec.rb
  88. +5 −0 spec/ruby/optional/capi/thread_spec.rb
  89. +1 −0 spec/tags/ruby/core/exception/receiver_tags.txt
  90. +1 −0 spec/tags/ruby/language/super_tags.txt
  91. +0 −2 vm/builtin/dir.cpp
  92. +0 −34 vm/builtin/io.cpp
  93. +0 −3 vm/builtin/io.hpp
  94. +8 −0 vm/capi/bignum.cpp
  95. +1 −2 vm/capi/kernel.cpp
  96. +2 −0 vm/capi/thread.cpp
  97. +1 −0 vm/ontology.cpp
@@ -1,12 +1,16 @@
language: cpp
compiler:
- clang
os:
- linux
- osx
sudo: false
ruby: 2.2.0
before_install:
- echo $LANG
- echo $LC_ALL
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/llvm.sh; fi
- if [ $TRAVIS_OS_NAME == osx ]; then brew update && brew install llvm35 && brew link --force llvm35; fi
- rvm use $RVM --install --binary --fuzzy
- gem update --system
- gem --version
before_script:
@@ -19,8 +23,6 @@ after_success:
branches:
only:
- master
- 1.8.7
- 2.2
- "/^v\\d+\\./"
notifications:
email: false
@@ -35,24 +37,9 @@ notifications:
on_success: change
on_failure: always
on_start: always
matrix:
exclude:
- compiler: clang
- os: linux
- os: osx
include:
- env: RVM=rbx-2
os: osx
- env: RVM=2.2.0
os: linux
compiler: clang
env:
global:
- LANG="en_US.UTF-8"
- secure: olbok/GN6rOYvPnHBYWGz7giCoCdLFpT/7WSBHukYO3E0uNeqAUOOgW2BFOwCVWdSEJ/iTvJXZQ4qVZHX+6jRfvILZeGv+D2P93VdD8UFQRoTOfFC7esAo525s9fuKm9ehUGWZxlzGOBHHckky1jn6pEf8mlXAVM5e76dlH0fck=
- secure: aqG9eB/PrzQ7XJQN6YX/00sNVvwSB77saxXQzguL2WFjAXB74h6168Hzq+awHtNX/vfOb6ta7fpWLHrA0D+gmZnvTR29VlP6nd0vs1tkdX1/jWbiBHjamRffp+NWVdKbJKYn5iLOGXcuUMOzY/opLKOdvxKZfkxGMxR2tTNLZUE=
- secure: eElvNLjuFZAuixJdgom4Kv8RDziE4ArFcSEwYctvprMe/414CAaJcFkjQKg0RrJzAxZ51oGjdcZhEfmjNXcUU1gA5l++IdnlQm0x4kt8r7aql+q2geHzrrjhhwPujT9a8JNtXs6dHnbi+quNlxyVItWzeGJsjyhJzH8hxiFhCYI=
os:
- linux
- osx
sudo: false
@@ -8,7 +8,7 @@ gem "daedalus-core", "~> 0.1"
gem "rubinius-build_tools", "~> 2.0"
gem "rubinius-developer_tools", "~> 2.0"

gem "rubysl", "~> 2.0"
gem "rubysl", "~> 2.2"
gem "rubysl-test-unit", "~> 2.0"
gem "minitest", "~> 4.7"
gem "racc", "~> 1.4"
@@ -2,7 +2,7 @@ GEM
remote: https://rubygems.org/
specs:
daedalus-core (0.5.0)
rake (10.4.2)
rake (10.5.0)
redcard (1.1.0)
rubinius-ast (2.3.2)
rubinius-bridge (1.1.0)
@@ -78,6 +78,7 @@ class Configure
@dtrace_const = false
@have_lchmod = false
@have_lchown = false
@have_mkfifo = false
@debug_build = false
@include_dirs = []
@lib_dirs = []
@@ -1290,6 +1291,10 @@ int main() { return tgetnum(""); }
if has_function("lchown", ["sys/stat.h", "unistd.h"])
@have_lchown = true
end

if has_function("mkfifo", ["sys/stat.h", "sys/types.h"])
@have_mkfifo = true
end
end

def detect_structures
@@ -1656,6 +1661,7 @@ int main() { return tgetnum(""); }
#define RBX_LIBC "#{@libc}"
#define RBX_HAVE_LCHMOD #{@have_lchmod}
#define RBX_HAVE_LCHOWN #{@have_lchown}
#define RBX_HAVE_MKFIFO #{@have_mkfifo}
#define RBX_DEBUG_BUILD #{@debug_build.inspect}
EOC

This file was deleted.

This file was deleted.

@@ -5,7 +5,7 @@ json-1.8.3.gem
minitest-4.7.5.gem
psych-2.0.17.gem
racc-1.4.14.gem
rake-10.4.2.gem
rake-10.5.0.gem
rb-readline-0.5.3.gem
rdoc-4.2.1.gem
redcard-1.1.0.gem
@@ -20,7 +20,7 @@ rubinius-melbourne-2.3.1.0.gem
rubinius-processor-2.3.0.gem
rubinius-profiler-2.0.2.gem
rubinius-toolset-2.3.1.gem
rubysl-2.1.0.gem
rubysl-2.2.0.gem
rubysl-abbrev-2.0.4.gem
rubysl-base64-2.0.0.gem
rubysl-benchmark-2.0.1.gem
@@ -70,9 +70,9 @@ rubysl-net-smtp-2.0.1.gem
rubysl-net-telnet-2.0.0.gem
rubysl-nkf-2.0.1.gem
rubysl-observer-2.0.0.gem
rubysl-open-uri-2.0.0.gem
rubysl-open3-2.0.0.gem
rubysl-openssl-2.8.0.gem
rubysl-open-uri-2.0.0.gem
rubysl-optparse-2.0.1.gem
rubysl-ostruct-2.1.0.gem
rubysl-pathname-2.1.0.gem
@@ -93,7 +93,7 @@ rubysl-securerandom-2.0.0.gem
rubysl-set-2.0.1.gem
rubysl-shellwords-2.0.0.gem
rubysl-singleton-2.0.0.gem
rubysl-socket-2.1.0.gem
rubysl-socket-2.1.1.gem
rubysl-stringio-2.0.0.gem
rubysl-strscan-2.0.0.gem
rubysl-sync-2.0.0.gem
@@ -107,6 +107,7 @@ rubysl-timeout-2.0.0.gem
rubysl-tmpdir-2.0.1.gem
rubysl-tsort-2.0.1.gem
rubysl-un-2.0.0.gem
rubysl-unicode_normalize-2.0.gem
rubysl-uri-2.0.0.gem
rubysl-weakref-2.0.0.gem
rubysl-webrick-2.0.0.gem
@@ -145,13 +145,6 @@ def socket_recv(bytes, flags, type)
raise PrimitiveFailure, "io_socket_read failed"
end

module Socketable
def accept
Rubinius.primitive :io_accept
raise PrimitiveFailure, "io_accept failed"
end
end

module TransferIO
def send_io
Rubinius.primitive :io_send_io
@@ -330,6 +330,7 @@ def readbyte
def read(bytes=nil, output=nil)
# The user might try to pass in nil, so we have to check here
output ||= default_value
output.clear

if bytes
bytes_left = bytes
@@ -401,6 +402,27 @@ def readlines(sep=$/)

alias_method :to_a, :readlines

def readpartial(maxlen, output=nil)
output ||= default_value

unless advance!
output.clear
raise EOFError, "ARGF at end"
end

begin
@stream.readpartial(maxlen, output)
rescue EOFError => e
raise e if @use_stdin_only

@stream.close
@advance = true
advance! or raise e
end

return output
end

#
# Rewind the stream to its beginning.
#
@@ -300,28 +300,30 @@ def <=>(other)

def ==(other)
return true if equal?(other)
unless other.kind_of? Array
return false unless other.respond_to? :to_ary

unless other.kind_of?(Array)
return false unless other.respond_to?(:to_ary)
return other == self
end

return false unless size == other.size

Thread.detect_recursion self, other do
m = Rubinius::Mirror::Array.reflect other
Thread.detect_recursion(self, other) do
mirror = Rubinius::Mirror::Array.reflect(other)

md = @tuple
od = m.tuple
self_tuple = @tuple
other_tuple = mirror.tuple

i = @start
j = m.start
self_idx = @start
other_idx = mirror.start

total = i + @total
total = self_idx + @total

while i < total
return false unless md[i] == od[j]
i += 1
j += 1
while self_idx < total
return false unless self_tuple[self_idx] == other_tuple[other_idx]

self_idx += 1
other_idx += 1
end
end

@@ -338,8 +340,20 @@ def assoc(obj)
nil
end

def bsearch
return to_enum :bsearch unless block_given?
def bsearch(&block)
return to_enum :bsearch unless block

i = bsearch_index(&block)
return unless i

m = Rubinius::Mirror::Array.reflect self
tuple = m.tuple

tuple.at(i)
end

def bsearch_index
return to_enum :bsearch_index unless block_given?

m = Rubinius::Mirror::Array.reflect self

@@ -354,7 +368,7 @@ def bsearch
while max >= min and i >= start and i < total
x = yield tuple.at(i)

return tuple.at(i) if x == 0
return i if x == 0

case x
when Numeric
@@ -369,14 +383,14 @@ def bsearch
when false, nil
min = i + 1
else
raise TypeError, "Array#bsearch block must return Numeric or boolean"
raise TypeError, "block must return Numeric or boolean"
end

i = min + (max - min) / 2
end

return tuple.at(i) if max > min
return tuple.at(last_true) if last_true
return i if max > min
return last_true if last_true

nil
end
@@ -583,6 +597,15 @@ def delete_if
self
end

def dig(index, *remaining_indeces)
item = self[index]
return item if remaining_indeces.empty? || item.nil?

raise TypeError, "#{item.class} does not have #dig method" unless item.respond_to?(:dig)

item.dig(*remaining_indeces)
end

def each_index
return to_enum(:each_index) { size } unless block_given?

@@ -11,7 +11,7 @@ def from_proc?
end

def self.self_context(recv, variables)
recv.equal?(Kernel) ? recv : variables.self
Rubinius::Type.object_equal(recv, Kernel) ? recv : variables.self
end
private :self_context

@@ -3,15 +3,11 @@ def ==(other)
return true if equal?(other)

return false if Thread.detect_recursion(self, other) do
begin
unless comp = (self <=> other)
return false
end

return Comparable.compare_int(comp) == 0
rescue StandardError
unless comp = (self <=> other)
return false
end

return Comparable.compare_int(comp) == 0
end
end

@@ -25,6 +25,8 @@ class Complex < Numeric
undef_method :step
undef_method :truncate
undef_method :i
undef_method :positive?
undef_method :negative?

def self.convert(real, imag = undefined)
if real.equal?(nil) || imag.equal?(nil)
Loading

0 comments on commit 7fe99ae

Please sign in to comment.