-
-
Notifications
You must be signed in to change notification settings - Fork 925
Commit
Conflicts: truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java truffle/src/main/java/org/jruby/truffle/nodes/core/BasicObjectNodes.java
- 9.4.12.0
- 9.4.11.0
- 9.4.10.0
- 9.4.9.0
- 9.4.8.0
- 9.4.7.0
- 9.4.6.0
- 9.4.5.0
- 9.4.4.0
- 9.4.3.0
- 9.4.2.0
- 9.4.1.0
- 9.4.0.0
- 9.3.15.0
- 9.3.14.0
- 9.3.13.0
- 9.3.12.0
- 9.3.11.0
- 9.3.10.0
- 9.3.9.0
- 9.3.8.0
- 9.3.7.0
- 9.3.6.0
- 9.3.5.0
- 9.3.4.0
- 9.3.3.0
- 9.3.2.0
- 9.3.1.0
- 9.3.0.0
- 9.2.21.0
- 9.2.20.1
- 9.2.20.0
- 9.2.19.0
- 9.2.18.0
- 9.2.17.0
- 9.2.16.0
- 9.2.15.0
- 9.2.14.0
- 9.2.13.0
- 9.2.12.0
- 9.2.11.1
- 9.2.11.0
- 9.2.10.0
- 9.2.9.0
- 9.2.8.0
- 9.2.7.0
- 9.2.6.0
- 9.2.5.0
- 9.2.4.1
- 9.2.4.0
- 9.2.3.0
- 9.2.2.0
- 9.2.1.0
- 9.2.0.0
- 9.1.17.0
- 9.1.16.0
- 9.1.15.0
- 9.1.14.0
- 9.1.13.0
- 9.1.12.0
- 9.1.11.0
- 9.1.10.0
- 9.1.9.0
- 9.1.8.0
- 9.1.7.0
- 9.1.6.0
- 9.1.5.0
- 9.1.4.0
- 9.1.3.0
- 9.1.2.0
- 9.1.1.0
- 9.1.0.0
- 9.0.5.0
- 9.0.4.0
- 9.0.3.0
- 9.0.1.0
- 9.0.0.0
- 9.0.0.0.rc2
- 9.0.0.0.rc1
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
fails:Class.inherited is invoked with the child Class when self is subclassed | ||
fails(windows bug):Class.inherited is invoked only once per subclass | ||
windows:Class.inherited is invoked only once per subclass |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fails(windows bug):Encoding.default_internal with command line options returns Encoding::UTF_8 if ruby was invoked with -U | ||
fails(windows bug):Encoding.default_internal with command line options uses the encoding specified when ruby is invoked with an '-E :internal' argument | ||
fails(windows bug):Encoding.default_internal with command line options uses the encoding specified when ruby is invoked with an '-E external:internal' argument | ||
windows:Encoding.default_internal with command line options returns Encoding::UTF_8 if ruby was invoked with -U | ||
windows:Encoding.default_internal with command line options uses the encoding specified when ruby is invoked with an '-E :internal' argument | ||
windows:Encoding.default_internal with command line options uses the encoding specified when ruby is invoked with an '-E external:internal' argument |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
fails(inherited):Encoding#dummy? returns true for dummy encodings | ||
fails(windows bug):Encoding#dummy? returns true for dummy encodings | ||
windows:Encoding#dummy? returns true for dummy encodings |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fails:Enumerable#find_index passes each entry in enum to block while block when block is false | ||
fails:Enumerable#find_index returns nil when the block is false | ||
fails:Enumerable#find_index returns the first index for which the block is not false | ||
fails:Enumerable#find_index returns the first index found | ||
fails:Enumerable#find_index returns nil when the element not found | ||
fails:Enumerable#find_index ignores the block if an argument is given | ||
fails:Enumerable#find_index returns an Enumerator if no block given | ||
fails:Enumerable#find_index without block gathers whole arrays as elements when each yields multiple | ||
fails:Enumerable#find_index with block given a single yield parameter passes first element to the parameter | ||
fails:Enumerable#find_index with block given a greedy yield parameter passes a gathered array to the parameter |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
fails:Enumerable#to_a returns a tainted array if self is tainted | ||
fails:Enumerable#to_a returns an untrusted array if self is untrusted | ||
fails:Enumerable#to_a returns an array containing the elements | ||
fails:Enumerable#to_a passes through the values yielded by #each_with_index | ||
fails:Enumerable#to_a passes arguments to each |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fails:Enumerable#to_h converts empty enumerable to empty hash | ||
fails:Enumerable#to_h converts yielded [key, value] pairs to a hash | ||
fails:Enumerable#to_h uses the last value of a duplicated key | ||
fails:Enumerable#to_h calls #to_ary on contents | ||
fails:Enumerable#to_h forwards arguments to #each | ||
fails:Enumerable#to_h raises TypeError if an element is not an array | ||
fails:Enumerable#to_h raises ArgumentError if an element is not a [key, value] pair |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
fails:File includes File::Constants | ||
fails:File.file? accepts an object that has a #to_path method | ||
fails(windows bug):File.file? returns true if the named file exists and is a regular file. | ||
fails(windows bug):File.file? raises an ArgumentError if not passed one argument | ||
fails(windows bug):File.file? raises a TypeError if not passed a String type | ||
windows:File.file? returns true if the named file exists and is a regular file. | ||
windows:File.file? raises an ArgumentError if not passed one argument | ||
windows:File.file? raises a TypeError if not passed a String type |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
fails:File#path returns the pathname used to create file as a string | ||
fails(windows bug):File.path returns the full path for the given file | ||
windows:File.path returns the full path for the given file |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fails:File.readable? accepts an object that has a #to_path method | ||
fails(windows bug):File.readable? returns true if named file is readable by the effective user id of the process, otherwise false | ||
fails(windows bug):File.readable? returns false if the file does not exist | ||
windows:File.readable? returns true if named file is readable by the effective user id of the process, otherwise false | ||
windows:File.readable? returns false if the file does not exist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fails:File::Stat#sticky? returns true if the named file has the sticky bit, otherwise false | ||
fails:File::Stat#sticky? accepts an object that has a #to_path method | ||
fails:File::Stat#sticky? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
fails:File.file? accepts an object that has a #to_path method | ||
fails:File.file? returns true if the named file exists and is a regular file. | ||
fails:File.file? returns true if the null device exists and is a regular file. | ||
fails:File.file? raises an ArgumentError if not passed one argument | ||
fails:File.file? raises a TypeError if not passed a String type | ||
fails:FileTest.file? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
fails:FileTest.owned? accepts an object that has a #to_path method | ||
fails:FileTest.owned? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
fails:FileTest.pipe? accepts an object that has a #to_path method | ||
fails:FileTest.pipe? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:FileTest.setgid? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:FileTest.setuid? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
fails:FileTest.socket? accepts an object that has a #to_path method | ||
fails:FileTest.socket? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
fails:FileTest.symlink? returns true if the file is a link | ||
fails:FileTest.symlink? accepts an object that has a #to_path method | ||
fails:FileTest.symlink? returns false if the file does not exist |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:FileTest.world_readable? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:FileTest.world_writable? needs to be reviewed for spec completeness |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fails:Method#source_location works for methods defined with an UnboundMethod | ||
fails:Method#source_location for a Method generated by respond_to_missing? returns nil | ||
fails(windows bug):Method#source_location sets the first value to the path of the file in which the method was defined | ||
windows:Method#source_location sets the first value to the path of the file in which the method was defined |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:Rational#abs returns self's absolute value |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
fails:Signal.trap the special EXIT signal code accepts the EXIT code | ||
fails:Signal.trap the special EXIT signal code runs the proc before at_exit handlers | ||
fails(windows bug):Signal.trap returns the previous handler | ||
fails(windows bug):Signal.trap accepts a block in place of a proc/command argument | ||
fails(windows bug):Signal.trap ignores the signal when passed nil | ||
fails(windows bug):Signal.trap accepts 'DEFAULT' as a symbol in place of a proc | ||
fails(windows bug):Signal.trap accepts 'SIG_DFL' as a symbol in place of a proc | ||
fails(windows bug):Signal.trap accepts 'SIG_IGN' as a symbol in place of a proc | ||
fails(windows bug):Signal.trap accepts 'IGNORE' as a symbol in place of a proc | ||
fails(windows bug):Signal.trap accepts long names as Strings | ||
fails(windows bug):Signal.trap acceps short names as Strings | ||
fails(windows bug):Signal.trap accepts long names as Symbols | ||
fails(windows bug):Signal.trap accepts short names as Symbols | ||
fails(windows bug):Signal.trap accepts 'SIG_DFL' in place of a proc | ||
fails(windows bug):Signal.trap accepts 'DEFAULT' in place of a proc | ||
fails(windows bug):Signal.trap accepts 'SIG_IGN' in place of a proc | ||
fails(windows bug):Signal.trap accepts 'IGNORE' in place of a proc | ||
fails(windows bug):Signal.trap the special EXIT signal code can unset the handler | ||
windows:Signal.trap returns the previous handler | ||
windows:Signal.trap accepts a block in place of a proc/command argument | ||
windows:Signal.trap ignores the signal when passed nil | ||
windows:Signal.trap accepts 'DEFAULT' as a symbol in place of a proc | ||
windows:Signal.trap accepts 'SIG_DFL' as a symbol in place of a proc | ||
windows:Signal.trap accepts 'SIG_IGN' as a symbol in place of a proc | ||
windows:Signal.trap accepts 'IGNORE' as a symbol in place of a proc | ||
windows:Signal.trap accepts long names as Strings | ||
windows:Signal.trap acceps short names as Strings | ||
windows:Signal.trap accepts long names as Symbols | ||
windows:Signal.trap accepts short names as Symbols | ||
windows:Signal.trap accepts 'SIG_DFL' in place of a proc | ||
windows:Signal.trap accepts 'DEFAULT' in place of a proc | ||
windows:Signal.trap accepts 'SIG_IGN' in place of a proc | ||
windows:Signal.trap accepts 'IGNORE' in place of a proc | ||
windows:Signal.trap the special EXIT signal code can unset the handler |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
fails(windows bug):Struct#to_s is a synonym for inspect | ||
windows:Struct#to_s is a synonym for inspect |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,2 @@ | ||
fails:Time#_dump preserves the GMT flag | ||
fails:Time#_dump dumps a Time object to a bytestring | ||
fails:Time#_dump dumps an array with a date as first element | ||
fails:Time#_dump dumps an array with a time as second element | ||
fails:Time#_dump dumps like MRI's marshaled time format | ||
fails:Time#_dump preserves the GMT flag |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
fails:Time._load loads a time object in the new format | ||
fails:Time._load loads a time object in the old UNIX timestamp based format | ||
fails:Time._load loads MRI's marshaled time format | ||
fails:Time._load treats the data as binary data |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fails:Time#<=> returns 1 if the first argument is a point in time after the second argument | ||
fails:Time#<=> returns -1 if the first argument is a point in time before the second argument | ||
fails:Time#<=> returns 1 if the first argument is a fraction of a microsecond after the second argument | ||
fails:Time#<=> returns -1 if the first argument is a fraction of a microsecond before the second argument |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fails:Time#eql? returns false if self and other have differing numbers of microseconds | ||
fails:Time#eql? returns false if self and other have differing fractional microseconds |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
fails:Time#gmt_offset returns the offset in seconds between the timezone of time and UTC | ||
fails:Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change | ||
fails:Time#gmt_offset returns the correct offset for Hawaii around daylight savings time change | ||
fails:Time#gmt_offset returns the correct offset for New Zealand around daylight savings time change | ||
fails:Time#gmt_offset returns offset as Rational | ||
fails:Time#gmt_offset given positive offset returns a positive offset | ||
fails:Time#gmt_offset given negative offset returns a negative offset |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
fails:Time#gmtoff returns the offset in seconds between the timezone of time and UTC | ||
fails:Time#gmtoff returns the correct offset for US Eastern time zone around daylight savings time change | ||
fails:Time#gmtoff returns the correct offset for Hawaii around daylight savings time change | ||
fails:Time#gmtoff returns the correct offset for New Zealand around daylight savings time change | ||
fails:Time#gmtoff returns offset as Rational | ||
fails:Time#gmtoff given positive offset returns a positive offset | ||
fails:Time#gmtoff given negative offset returns a negative offset |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fails:Time#nsec returns the nanoseconds part of a Time constructed with a Float number of seconds | ||
fails:Time#nsec returns the nanoseconds part of a Time constructed with an Integer number of microseconds | ||
fails:Time#nsec returns the nanoseconds part of a Time constructed with an Float number of microseconds | ||
fails:Time#nsec returns the nanoseconds part of a Time constructed with a Rational number of seconds | ||
fails:Time#nsec returns the nanoseconds part of a Time constructed with an Rational number of microseconds |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,6 @@ | ||
fails:Time#strftime supports week of year format with %U and %W | ||
fails:Time#strftime supports 12-hr formatting with %l | ||
fails:Time#strftime supports AM/PM formatting with %p | ||
fails:Time#strftime returns the abbreviated weekday with %a | ||
fails:Time#strftime returns the full weekday with %A | ||
fails:Time#strftime returns the abbreviated month with %b | ||
fails:Time#strftime returns the full month with %B | ||
fails:Time#strftime returns the day of the month with %d | ||
fails:Time#strftime returns the 24-based hour with %H | ||
fails:Time#strftime returns the 12-based hour with %I | ||
fails:Time#strftime returns the Julian date with %j | ||
fails:Time#strftime returns the month with %m | ||
fails:Time#strftime returns the minute with %M | ||
fails:Time#strftime returns the second with %S | ||
fails:Time#strftime returns the enumerated day of the week with %w | ||
fails:Time#strftime returns the date alone with %x | ||
fails:Time#strftime returns the time alone with %X | ||
fails:Time#strftime returns the year wihout a century with %y | ||
fails:Time#strftime returns the year with %Y | ||
fails:Time#strftime returns the timezone with %Z | ||
fails:Time#strftime supports am/pm formatting with %P | ||
fails:Time#strftime returns the fractional seconds digits, default is 9 digits (nanosecond) with %N | ||
fails:Time#strftime supports GNU modificators | ||
fails:Time#strftime supports the '-' modifier to drop leading zeros | ||
fails:Time#strftime supports the '-' modifier for padded format directives | ||
fails:Time#strftime passes the format string's encoding to the result string | ||
fails:Time#strftime with %L formats the milliseconds of a second | ||
fails:Time#strftime with %N formats the nanoseconds of of the second with %N | ||
fails:Time#strftime with %N formats the milliseconds of of the second with %3N | ||
fails:Time#strftime with %N formats the microseconds of of the second with %6N | ||
fails:Time#strftime with %N formats the nanoseconds of of the second with %9N | ||
fails:Time#strftime with %N formats the picoseconds of of the second with %12N | ||
fails:Time#strftime with %z formats a UTC time offset as '+0000' | ||
fails:Time#strftime with %z formats a local time with positive UTC offset as '+HHMM' | ||
fails:Time#strftime with %z formats a local time with negative UTC offset as '-HHMM' | ||
fails:Time#strftime with %z formats a time with fixed positive offset as '+HHMM' | ||
fails:Time#strftime with %z formats a time with fixed negative offset as '-HHMM' | ||
fails:Time#strftime with %z formats a time with fixed offset as '+/-HH:MM' with ':' specifier | ||
fails:Time#strftime with %z formats a time with fixed offset as '+/-HH:MM:SS' with '::' specifier | ||
fails:Time#strftime with %z rounds fixed offset to the nearest second |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fails:Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Rational number of seconds | ||
fails:Time#subsec returns the fractional seconds as a Rational for a Time constructed with a Float number of seconds | ||
fails:Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Integer number of microseconds | ||
fails:Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Rational number of microseconds | ||
fails:Time#subsec returns the fractional seconds as a Rational for a Time constructed with an Float number of microseconds |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fails:Time#succ returns a new time one second later than time | ||
fails:Time#succ returns a new instance |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fails:Time#to_f returns the float number of seconds + usecs since the epoch |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
fails:Time#usec returns the microseconds part of a Time constructed with a Float number of seconds | ||
fails:Time#usec returns the microseconds part of a Time constructed with an Integer number of microseconds | ||
fails:Time#usec returns the microseconds part of a Time constructed with an Float number of microseconds > 1 | ||
fails:Time#usec returns 0 for a Time constructed with an Float number of microseconds < 1 | ||
fails:Time#usec returns the microseconds part of a Time constructed with a Rational number of seconds | ||
fails:Time#usec returns the microseconds part of a Time constructed with an Rational number of microseconds > 1 | ||
fails:Time#usec returns 0 for a Time constructed with an Rational number of microseconds < 1 | ||
fails:Time#usec returns the microseconds for time created by Time#local |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
fails:Time#utc_offset returns the offset in seconds between the timezone of time and UTC | ||
fails:Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change | ||
fails:Time#utc_offset returns the correct offset for Hawaii around daylight savings time change | ||
fails:Time#utc_offset returns the correct offset for New Zealand around daylight savings time change | ||
fails:Time#utc_offset returns offset as Rational | ||
fails:Time#utc_offset given positive offset returns a positive offset | ||
fails:Time#utc_offset given negative offset returns a negative offset |
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
fails:Time#zone returns the time zone used for time | ||
fails:Time#zone returns nil for a Time with a fixed offset | ||
fails:Time#zone returns the correct timezone for a local time | ||
fails:Time#zone returns nil when getting the local time with a fixed offset | ||
fails:Time#zone returns UTC when called on a UTC time | ||
fails:Time#zone Encoding.default_internal is set returns the string with the default internal encoding | ||
fails:Time#zone Encoding.default_internal is set doesn't raise errors for a Time with a fixed offset |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
fails(windows bug):The __FILE__ pseudo-variable equals the absolute path of a file loaded by an absolute path | ||
fails(windows bug):The __FILE__ pseudo-variable equals the absolute path of a file loaded by a relative path | ||
windows:The __FILE__ pseudo-variable equals the absolute path of a file loaded by an absolute path | ||
windows:The __FILE__ pseudo-variable equals the absolute path of a file loaded by a relative path |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
fails(inherited):The DATA constant succeeds in locking the file DATA came from | ||
fails:The DATA constant does not change when an included files also has a __END__ | ||
fails:The DATA constant is included in an otherwise empty file | ||
slow:The DATA constant exists when the main script contains __END__ | ||
slow:The DATA constant does not exist when the main script contains no __END__ | ||
slow:The DATA constant does not exist when an included file has a __END__ | ||
slow:The DATA constant does not change when an included files also has a __END__ | ||
slow:The DATA constant is included in an otherwise empty file | ||
fails(windows bug):The DATA constant exists when the main script contains __END__ | ||
fails(windows bug):The DATA constant does not exist when the main script contains no __END__ | ||
fails(windows bug):The DATA constant does not exist when an included file has a __END__ | ||
fails(windows bug):The DATA constant does not change when an included files also has a __END__ | ||
fails(windows bug):The DATA constant is included in an otherwise empty file | ||
windows:The DATA constant exists when the main script contains __END__ | ||
windows:The DATA constant does not exist when the main script contains no __END__ | ||
windows:The DATA constant does not change when an included files also has a __END__ |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
/* | ||
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved. This | ||
* code is released under a tri EPL/GPL/LGPL license. You can use it, | ||
* redistribute it and/or modify it under the terms of the: | ||
* | ||
* Eclipse Public License version 1.0 | ||
* GNU General Public License version 2 | ||
* GNU Lesser General Public License version 2.1 | ||
*/ | ||
package org.jruby.truffle.nodes.core; | ||
|
||
import com.oracle.truffle.api.dsl.Specialization; | ||
import com.oracle.truffle.api.source.SourceSection; | ||
import org.joda.time.DateTimeZone; | ||
import org.jruby.truffle.runtime.RubyContext; | ||
import org.jruby.truffle.runtime.core.RubyTime; | ||
|
||
@CoreClass(name = "Time") | ||
public abstract class TimeNodes { | ||
|
||
@CoreMethod(names = "_gmt?") | ||
public abstract static class InternalGMTNode extends CoreMethodNode { | ||
|
||
public InternalGMTNode(RubyContext context, SourceSection sourceSection) { | ||
super(context, sourceSection); | ||
} | ||
|
||
public InternalGMTNode(InternalGMTNode prev) { | ||
super(prev); | ||
} | ||
|
||
@Specialization | ||
public boolean internalGMT(RubyTime time) { | ||
// TODO CS 15-Feb-15 we've ended up with both null and nil here - should simplify | ||
return (time.getOffset() == null || time.getOffset() == getContext().getCoreLibrary().getNilObject()) && (time.getDateTime().getZone().equals(DateTimeZone.UTC) || time.getDateTime().getZone().getOffset(time.getDateTime().getMillis()) == 0); | ||
} | ||
} | ||
|
||
@CoreMethod(names = "_set_gmt", required = 1) | ||
public abstract static class InternalSetGMTNode extends CoreMethodNode { | ||
|
||
public InternalSetGMTNode(RubyContext context, SourceSection sourceSection) { | ||
super(context, sourceSection); | ||
} | ||
|
||
public InternalSetGMTNode(InternalSetGMTNode prev) { | ||
super(prev); | ||
} | ||
|
||
@Specialization | ||
public boolean internalSetGMT(RubyTime time, Object setGMT) { | ||
throw new UnsupportedOperationException("_set_gmt" + setGMT.getClass()); | ||
} | ||
} | ||
|
||
@CoreMethod(names = "_offset") | ||
public abstract static class InternalOffsetNode extends CoreMethodNode { | ||
|
||
public InternalOffsetNode(RubyContext context, SourceSection sourceSection) { | ||
super(context, sourceSection); | ||
} | ||
|
||
public InternalOffsetNode(InternalOffsetNode prev) { | ||
super(prev); | ||
} | ||
|
||
@Specialization | ||
public Object internalOffset(RubyTime time) { | ||
throw new UnsupportedOperationException("_offset"); | ||
} | ||
} | ||
|
||
@CoreMethod(names = "_set_offset", required = 1) | ||
public abstract static class InternalSetOffsetNode extends CoreMethodNode { | ||
|
||
public InternalSetOffsetNode(RubyContext context, SourceSection sourceSection) { | ||
super(context, sourceSection); | ||
} | ||
|
||
public InternalSetOffsetNode(InternalSetOffsetNode prev) { | ||
super(prev); | ||
} | ||
|
||
@Specialization | ||
public boolean internalSetGMT(RubyTime time, Object setOffset) { | ||
throw new UnsupportedOperationException("_set_offset " + setOffset.getClass()); | ||
} | ||
} | ||
|
||
} |