Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dff821d37ad0
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c8c5c86f94c2
Choose a head ref
  • 3 commits
  • 6 files changed
  • 1 contributor

Commits on May 20, 2016

  1. Copy the full SHA
    7328844 View commit details
  2. Copy the full SHA
    9ee70f4 View commit details
  3. Copy the full SHA
    c8c5c86 View commit details
5 changes: 0 additions & 5 deletions truffle/src/main/ruby/core.rb
Original file line number Diff line number Diff line change
@@ -106,11 +106,6 @@
Truffle::Boot.require_core 'core/rationalizer'
Truffle::Boot.require_core 'core/complex'
Truffle::Boot.require_core 'core/complexifier'

# Load delta

Truffle::Boot.require_core 'core/delta/file'
Truffle::Boot.require_core 'core/delta/module'
Truffle::Boot.require_core 'core/class'

# Load JRuby+Truffle classes
16 changes: 16 additions & 0 deletions truffle/src/main/ruby/core/common/file.rb
Original file line number Diff line number Diff line change
@@ -51,6 +51,11 @@ class NoFileError < FileError; end
class UnableToStat < FileError; end
class PermissionError < FileError; end

# these will be necessary when we run on Windows
DOSISH = false # !!(RUBY_PLATFORM =~ /mswin/)
CASEFOLD_FILESYSTEM = DOSISH
FNM_SYSCASE = CASEFOLD_FILESYSTEM ? FNM_CASEFOLD : 0

module Constants
F_GETFL = Rubinius::Config['rbx.platform.fcntl.F_GETFL']
F_SETFL = Rubinius::Config['rbx.platform.fcntl.F_SETFL']
@@ -98,6 +103,8 @@ module Constants
else
NULL = '/dev/null'
end

FNM_SYSCASE = File::FNM_SYSCASE
end

FFI = Rubinius::FFI
@@ -1315,6 +1322,15 @@ def size
raise IOError, "closed stream" if closed?
stat.size
end

##
# Return the equivalent S-Expression of the file given.
# Raises +SyntaxError+ if there is a syntax issue in the
# file, making it unparsable.
# File.to_sexp("/tmp/test.rb") #=> s(...)
def self.to_sexp(name)
File.read(name).to_sexp(name)
end
end # File

# Inject the constants into IO
20 changes: 20 additions & 0 deletions truffle/src/main/ruby/core/common/module.rb
Original file line number Diff line number Diff line change
@@ -914,4 +914,24 @@ def attr_writer(name)
# Not sure what this does - but we seem better off not doing it
def attr_reader_specific(a, b)
end

def prepended(mod); end
private :prepended

def prepend(*modules)
modules.reverse_each do |mod|
if !mod.kind_of?(Module) or mod.kind_of?(Class)
raise TypeError, "wrong argument type #{mod.class} (expected Module)"
end

Rubinius.privately do
mod.prepend_features self
end

Rubinius.privately do
mod.prepended self
end
end
self
end
end
45 changes: 0 additions & 45 deletions truffle/src/main/ruby/core/delta/file.rb

This file was deleted.

71 changes: 0 additions & 71 deletions truffle/src/main/ruby/core/delta/module.rb

This file was deleted.

50 changes: 50 additions & 0 deletions truffle/src/main/ruby/core/post.rb
Original file line number Diff line number Diff line change
@@ -6,6 +6,32 @@
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

# Copyright (c) 2007-2015, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Rubinius nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ARGV.push *Truffle::Boot.original_argv

$LOAD_PATH.push *Truffle::Boot.original_load_path
@@ -33,3 +59,27 @@
class Object
remove_const :Psych
end

class Module

# Invokes <code>Module#append_features</code> and
# <code>Module#included</code> on each argument, passing in self.
#
def include(*modules)
modules.reverse_each do |mod|
if !mod.kind_of?(Module) or mod.kind_of?(Class)
raise TypeError, "wrong argument type #{mod.class} (expected Module)"
end

Rubinius.privately do
mod.append_features self
end

Rubinius.privately do
mod.included self
end
end
self
end

end