Skip to content

Commit 1768599

Browse files
committedMay 2, 2015
Merge remote-tracking branch 'origin' into 1.8.7
Conflicts: kernel/common/array.rb
2 parents 89422b6 + fce5982 commit 1768599

File tree

10 files changed

+55
-4
lines changed

10 files changed

+55
-4
lines changed
 

Diff for: ‎kernel/bootstrap/logger.rb

+5
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ def initialize(name)
4949
@format = "#{name}: %s"
5050
end
5151

52+
def write(message)
53+
Rubinius.primitive :logger_write
54+
raise PrimitiveFailure, "Rubinius::Logger#write primitive failed"
55+
end
56+
5257
def fatal(message)
5358
Rubinius.primitive :logger_fatal
5459
raise PrimitiveFailure, "Rubinius::Logger#fatal primitive failed"

Diff for: ‎spec/ruby/core/time/shared/local.rb

+23
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@
1212
[0, 0, 0, 1, 1, 1910, 6, 1, false, "AMT"]
1313
end
1414
end
15+
16+
describe "timezone changes" do
17+
it "correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'" do
18+
with_timezone("Europe/Istanbul") do
19+
Time.send(@method, 1910, 10, 1).to_a.should ==
20+
[4, 3, 0, 1, 10, 1910, 6, 274, false, "EET"]
21+
end
22+
end
23+
24+
it "correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'" do
25+
with_timezone("Europe/Lisbon") do
26+
Time.send(@method, 1912, 1, 1).to_a.should ==
27+
[45, 36, 0, 1, 1, 1912, 1, 1, false, "WET"]
28+
end
29+
end
30+
31+
it "correctly adjusts the timezone change to 'CEST' on 'Europe/Amsterdam'" do
32+
with_timezone("Europe/Amsterdam") do
33+
Time.send(@method, 1940, 5, 16).to_a.should ==
34+
[0, 40, 1, 16, 5, 1940, 4, 137, true, "CEST"]
35+
end
36+
end
37+
end
1538
end
1639

1740
describe :time_local_10_arg, :shared => true do

Diff for: ‎spec/tags/ruby/core/time/local_tags.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fails:Time.local timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
2+
fails:Time.local timezone changes correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'

Diff for: ‎spec/tags/ruby/core/time/mktime_tags.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fails:Time.mktime timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
2+
fails:Time.mktime timezone changes correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'

Diff for: ‎spec/tags/ruby/core/time/new_tags.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fails:Time.new timezone changes correctly adjusts the timezone change to 'EET' on 'Europe/Istanbul'
2+
fails:Time.new timezone changes correctly adjusts the timezone change to 'WET' on 'Europe/Lisbon'

Diff for: ‎vm/builtin/array.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,17 @@ namespace rubinius {
186186
}
187187

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

193-
tuple(state, nt);
194200
start(state, Fixnum::from(0));
195201
total(state, Fixnum::from(new_size));
196202

Diff for: ‎vm/builtin/jit.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "builtin/block_environment.hpp"
22
#include "builtin/jit.hpp"
33
#include "builtin/list.hpp"
4+
#include "configuration.hpp"
45

56
#include "ontology.hpp"
67

Diff for: ‎vm/builtin/logger.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ namespace rubinius {
2525
return logger;
2626
}
2727

28+
Object* Logger::write(STATE, String* message) {
29+
logger::write(format()->c_str(state), message->c_str(state));
30+
return cNil;
31+
}
32+
2833
Object* Logger::fatal(STATE, String* message) {
2934
logger::fatal(format()->c_str(state), message->c_str(state));
3035
return cNil;

Diff for: ‎vm/builtin/logger.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ namespace rubinius {
2727
// Rubinius.primitive+ :logger_allocate
2828
static Logger* allocate(STATE, Object* self);
2929

30+
// Rubinius.primitive :logger_write
31+
Object* write(STATE, String* message);
32+
3033
// Rubinius.primitive :logger_fatal
3134
Object* fatal(STATE, String* message);
3235

Diff for: ‎vm/signal.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ namespace rubinius {
109109
function("ruby version: %s", RBX_RUBY_VERSION);
110110
function("release date: %s", RBX_RELEASE_DATE);
111111
function("build revision: %s", RBX_BUILD_REV);
112+
#if ENABLE_LLVM
112113
function("llvm version: %s", RBX_LLVM_VERSION);
114+
#endif
113115
function("jit status: %s",
114116
CBOOL(signal_thread_->shared().env()->state->globals().jit.get()->enabled())
115117
? "enabled" : "disabled");

0 commit comments

Comments
 (0)
Please sign in to comment.