Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into codedb
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Jan 25, 2016
2 parents d0d5ff6 + fa397f8 commit 7fe99ae
Show file tree
Hide file tree
Showing 97 changed files with 1,460 additions and 353 deletions.
23 changes: 5 additions & 18 deletions .travis.yml
@@ -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:
Expand All @@ -19,8 +23,6 @@ after_success:
branches:
only:
- master
- 1.8.7
- 2.2
- "/^v\\d+\\./"
notifications:
email: false
Expand All @@ -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
2 changes: 1 addition & 1 deletion Gemfile.installed
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions configure
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
8 changes: 0 additions & 8 deletions dockerfiles/ubuntu/14.04/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions dockerfiles/ubuntu/15.10/Dockerfile

This file was deleted.

9 changes: 5 additions & 4 deletions gems_list.txt
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
7 changes: 0 additions & 7 deletions kernel/bootstrap/io.rb
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions kernel/common/argf.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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.
#
Expand Down
61 changes: 42 additions & 19 deletions kernel/common/array.rb
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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?

Expand Down
2 changes: 1 addition & 1 deletion kernel/common/binding.rb
Expand Up @@ -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

Expand Down
10 changes: 3 additions & 7 deletions kernel/common/comparable.rb
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions kernel/common/complex.rb
Expand Up @@ -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)
Expand Down

0 comments on commit 7fe99ae

Please sign in to comment.