Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into 1.8.7
Browse files Browse the repository at this point in the history
Conflicts:
	kernel/common/array.rb
  • Loading branch information
brixen committed May 2, 2015
2 parents 89422b6 + fce5982 commit 1768599
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 4 deletions.
5 changes: 5 additions & 0 deletions kernel/bootstrap/logger.rb
Expand Up @@ -49,6 +49,11 @@ def initialize(name)
@format = "#{name}: %s"
end

def write(message)
Rubinius.primitive :logger_write
raise PrimitiveFailure, "Rubinius::Logger#write primitive failed"
end

def fatal(message)
Rubinius.primitive :logger_fatal
raise PrimitiveFailure, "Rubinius::Logger#fatal primitive failed"
Expand Down
23 changes: 23 additions & 0 deletions spec/ruby/core/time/shared/local.rb
Expand Up @@ -12,6 +12,29 @@
[0, 0, 0, 1, 1, 1910, 6, 1, false, "AMT"]
end
end

describe "timezone changes" do
it "correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'" do
with_timezone("Europe/Istanbul") do
Time.send(@method, 1910, 10, 1).to_a.should ==
[4, 3, 0, 1, 10, 1910, 6, 274, false, "EET"]
end
end

it "correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'" do
with_timezone("Europe/Lisbon") do
Time.send(@method, 1912, 1, 1).to_a.should ==
[45, 36, 0, 1, 1, 1912, 1, 1, false, "WET"]
end
end

it "correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'" do
with_timezone("Europe/Amsterdam") do
Time.send(@method, 1940, 5, 16).to_a.should ==
[0, 40, 1, 16, 5, 1940, 4, 137, true, "CEST"]
end
end
end
end

describe :time_local_10_arg, :shared => true do
Expand Down
2 changes: 2 additions & 0 deletions spec/tags/ruby/core/time/local_tags.txt
@@ -0,0 +1,2 @@
fails:Time.local timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
fails:Time.local timezone changes correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'
2 changes: 2 additions & 0 deletions spec/tags/ruby/core/time/mktime_tags.txt
@@ -0,0 +1,2 @@
fails:Time.mktime timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
fails:Time.mktime timezone changes correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'
2 changes: 2 additions & 0 deletions spec/tags/ruby/core/time/new_tags.txt
@@ -0,0 +1,2 @@
fails:Time.new timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
fails:Time.new timezone changes correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'
14 changes: 10 additions & 4 deletions vm/builtin/array.cpp
Expand Up @@ -186,11 +186,17 @@ namespace rubinius {
}

native_int new_size = size() + osize;
Tuple* nt = Tuple::create(state, new_size);
nt->copy_from(state, tuple_, start_, total_, Fixnum::from(0));
nt->copy_from(state, other->tuple(), other->start(), other->total(), total_);
if(new_size <= tuple_->num_fields()) {
// There is enough space in the current tuple, so just copy into it.
tuple_->copy_from(state, other->tuple(), other->start(), other->total(), total_);
} else {
// We need to create a bigger tuple, then copy both tuples into it.
Tuple* nt = Tuple::create_dirty(state, new_size);
nt->copy_from(state, tuple_, start_, total_, Fixnum::from(0));
nt->copy_from(state, other->tuple(), other->start(), other->total(), total_);
tuple(state, nt);
}

tuple(state, nt);
start(state, Fixnum::from(0));
total(state, Fixnum::from(new_size));

Expand Down
1 change: 1 addition & 0 deletions vm/builtin/jit.cpp
@@ -1,6 +1,7 @@
#include "builtin/block_environment.hpp"
#include "builtin/jit.hpp"
#include "builtin/list.hpp"
#include "configuration.hpp"

#include "ontology.hpp"

Expand Down
5 changes: 5 additions & 0 deletions vm/builtin/logger.cpp
Expand Up @@ -25,6 +25,11 @@ namespace rubinius {
return logger;
}

Object* Logger::write(STATE, String* message) {
logger::write(format()->c_str(state), message->c_str(state));
return cNil;
}

Object* Logger::fatal(STATE, String* message) {
logger::fatal(format()->c_str(state), message->c_str(state));
return cNil;
Expand Down
3 changes: 3 additions & 0 deletions vm/builtin/logger.hpp
Expand Up @@ -27,6 +27,9 @@ namespace rubinius {
// Rubinius.primitive+ :logger_allocate
static Logger* allocate(STATE, Object* self);

// Rubinius.primitive :logger_write
Object* write(STATE, String* message);

// Rubinius.primitive :logger_fatal
Object* fatal(STATE, String* message);

Expand Down
2 changes: 2 additions & 0 deletions vm/signal.cpp
Expand Up @@ -109,7 +109,9 @@ namespace rubinius {
function("ruby version: %s", RBX_RUBY_VERSION);
function("release date: %s", RBX_RELEASE_DATE);
function("build revision: %s", RBX_BUILD_REV);
#if ENABLE_LLVM
function("llvm version: %s", RBX_LLVM_VERSION);
#endif
function("jit status: %s",
CBOOL(signal_thread_->shared().env()->state->globals().jit.get()->enabled())
? "enabled" : "disabled");
Expand Down

0 comments on commit 1768599

Please sign in to comment.