Skip to content
Permalink
Browse files
Merge pull request #3518 from rubinius/2.2
WIP: 2.2 compat
  • Loading branch information
chuckremes committed Jan 4, 2016
2 parents 6b35d17 + 649739c commit d8e5c64aa4edfe95c1e969f635f0faa2cf648a8b
Showing with 1,386 additions and 332 deletions.
  1. +40 −0 configure
  2. +5 −0 kernel/bootstrap/stat.rb
  3. +6 −2 kernel/common/binding.rb
  4. +5 −0 kernel/common/dir.rb
  5. +218 −142 kernel/common/enumerable.rb
  6. +2 −22 kernel/common/eval.rb
  7. +3 −0 kernel/common/exception.rb
  8. +83 −51 kernel/common/file.rb
  9. +28 −0 kernel/common/float.rb
  10. +34 −0 kernel/common/method.rb
  11. +1 −2 kernel/common/process_mirror.rb
  12. +1 −1 kernel/common/throw_catch.rb
  13. +26 −0 kernel/common/variable_scope.rb
  14. +29 −0 spec/ruby/core/binding/local_variables_spec.rb
  15. +11 −0 spec/ruby/core/binding/receiver_spec.rb
  16. +16 −19 spec/ruby/core/dir/fileno_spec.rb
  17. +1 −1 spec/ruby/core/enumerable/each_cons_spec.rb
  18. +1 −1 spec/ruby/core/enumerable/each_entry_spec.rb
  19. +1 −1 spec/ruby/core/enumerable/each_slice_spec.rb
  20. +38 −0 spec/ruby/core/enumerable/max_by_spec.rb
  21. +48 −15 spec/ruby/core/enumerable/max_spec.rb
  22. +40 −3 spec/ruby/core/enumerable/min_by_spec.rb
  23. +34 −2 spec/ruby/core/enumerable/min_spec.rb
  24. +53 −0 spec/ruby/core/enumerable/slice_after_spec.rb
  25. +1 −1 spec/ruby/core/enumerable/slice_before_spec.rb
  26. +36 −0 spec/ruby/core/enumerable/slice_when_spec.rb
  27. +56 −0 spec/ruby/core/file/birthtime_spec.rb
  28. +1 −1 spec/ruby/core/file/ctime_spec.rb
  29. +18 −0 spec/ruby/core/file/stat/birthtime_spec.rb
  30. +28 −2 spec/ruby/core/file/utime_spec.rb
  31. +44 −0 spec/ruby/core/float/next_float_spec.rb
  32. +44 −0 spec/ruby/core/float/prev_float_spec.rb
  33. +4 −4 spec/ruby/core/kernel/catch_spec.rb
  34. +18 −0 spec/ruby/core/kernel/frozen_spec.rb
  35. +4 −6 spec/ruby/core/kernel/itself_spec.rb
  36. +2 −2 spec/ruby/core/kernel/throw_spec.rb
  37. +38 −0 spec/ruby/core/method/curry_spec.rb
  38. +12 −0 spec/ruby/core/method/fixtures/classes.rb
  39. +39 −0 spec/ruby/core/method/super_method_spec.rb
  40. +1 −0 spec/ruby/core/proc/curry_spec.rb
  41. +103 −0 spec/ruby/core/string/unicode_normalize_spec.rb
  42. +3 −0 spec/ruby/core/unboundmethod/fixtures/classes.rb
  43. +26 −0 spec/ruby/core/unboundmethod/super_method_spec.rb
  44. +17 −0 spec/ruby/language/block_spec.rb
  45. +12 −1 spec/ruby/language/def_spec.rb
  46. +7 −7 spec/ruby/language/hash_spec.rb
  47. +17 −0 spec/ruby/language/lambda_spec.rb
  48. +0 −1 spec/ruby/language/regexp/character_classes_spec.rb
  49. +6 −6 spec/ruby/language/throw_spec.rb
  50. +8 −8 spec/ruby/optional/capi/kernel_spec.rb
  51. +21 −13 spec/ruby/shared/process/spawn.rb
  52. +1 −0 spec/tags/ruby/core/file/stat/birthtime_tags.txt
  53. +0 −10 spec/tags/ruby/core/io/popen_tags.txt
  54. +3 −0 spec/tags/ruby/core/kernel/frozen_tags.txt
  55. +1 −0 spec/tags/ruby/core/method/curry_tags.txt
  56. +1 −0 spec/tags/ruby/core/proc/curry_tags.txt
  57. +14 −0 spec/tags/ruby/core/string/unicode_normalize_tags.txt
  58. +2 −0 spec/tags/ruby/language/block_tags.txt
  59. +1 −0 spec/tags/ruby/language/def_tags.txt
  60. +4 −0 spec/tags/ruby/language/hash_tags.txt
  61. +2 −0 spec/tags/ruby/language/lambda_tags.txt
  62. +2 −2 vm/builtin/access_variable.cpp
  63. +6 −0 vm/builtin/dir.cpp
  64. +3 −0 vm/builtin/dir.hpp
  65. +10 −3 vm/builtin/object.cpp
  66. +7 −0 vm/builtin/object.hpp
  67. +36 −3 vm/builtin/stat.cpp
  68. +3 −0 vm/builtin/stat.hpp
@@ -1239,6 +1239,46 @@ int main() { return tgetnum(""); }
@defines << "HAVE_GETTID"
end

if has_struct_member("stat", "st_atim", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_ATIM"
end

if has_struct_member("stat", "st_atimespec", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_ATIMESPEC"
end

if has_struct_member("stat", "st_atimensec", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_ATIMENSEC"
end

if has_struct_member("stat", "st_mtim", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_MTIM"
end

if has_struct_member("stat", "st_mtimespec", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_MTIMESPEC"
end

if has_struct_member("stat", "st_mtimensec", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_MTIMENSEC"
end

if has_struct_member("stat", "st_ctim", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_CTIM"
end

if has_struct_member("stat", "st_ctimespec", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_CTIMESPEC"
end

if has_struct_member("stat", "st_ctimensec", ["sys/stat.h"])
@defines << "HAVE_STRUCT_STAT_ST_CTIMENSEC"
end

if has_struct_member("stat", "st_birthtimespec", ["sys/stat.h"])
@defines << "HAVE_ST_BIRTHTIME"
end

# glibc has useless lchmod() so we don't try to use lchmod() on linux
if !@linux and has_function("lchmod", ["sys/stat.h", "unistd.h"])
@have_lchmod = true
@@ -87,6 +87,11 @@ def ctime
raise PrimitiveFailure, "Rubinius::Stat#ctime primitive failed"
end

def birthtime
Rubinius.primitive :stat_birthtime
raise NotImplementedError, "birthtime() function is unimplemented on this machine"
end

def inspect
"#<#{self.class.name} dev=0x#{self.dev.to_s(16)}, ino=#{self.ino}, " \
"mode=#{sprintf("%07d", self.mode.to_s(8).to_i)}, nlink=#{self.nlink}, " \
@@ -3,8 +3,8 @@ class Binding
attr_accessor :compiled_code
attr_accessor :constant_scope
attr_accessor :proc_environment
attr_accessor :self
attr_accessor :location
attr_accessor :receiver

def from_proc?
@proc_environment
@@ -29,7 +29,7 @@ def self.self_context(recv, variables)
def self.setup(variables, code, constant_scope, recv=nil, location=nil)
bind = allocate()

bind.self = self_context(recv, variables)
bind.receiver = self_context(recv, variables)
bind.variables = variables
bind.compiled_code = code
bind.constant_scope = constant_scope
@@ -54,4 +54,8 @@ def eval(expr, filename=nil, lineno=nil)

Kernel.eval(expr, self, filename, lineno)
end

def local_variables
variables.local_variables
end
end
@@ -174,6 +174,11 @@ def each
self
end

def fileno
Rubinius.primitive :dir_fileno
raise PrimitiveFailure, "Dir#fileno primitive failed"
end

attr_reader :path

alias_method :to_path, :path
Loading

0 comments on commit d8e5c64

Please sign in to comment.