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: d4747889f6fe
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7210eb1075e6
Choose a head ref
  • 2 commits
  • 12 files changed
  • 1 contributor

Commits on Feb 15, 2015

  1. Copy the full SHA
    2455443 View commit details
  2. Copy the full SHA
    7210eb1 View commit details
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/day_tags.txt

This file was deleted.

29 changes: 0 additions & 29 deletions spec/truffle/tags/core/time/gm_tags.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,4 @@
fails:Time.gm creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)
fails:Time.gm interprets pre-Gregorian reform dates using Gregorian proleptic calendar
fails:Time.gm interprets Julian-Gregorian gap dates using Gregorian proleptic calendar
fails:Time.gm interprets post-Gregorian reform dates using Gregorian calendar
fails:Time.gm accepts 1 argument (year)
fails:Time.gm accepts 2 arguments (year, month)
fails:Time.gm accepts 3 arguments (year, month, day)
fails:Time.gm accepts 4 arguments (year, month, day, hour)
fails:Time.gm accepts 5 arguments (year, month, day, hour, minute)
fails:Time.gm accepts nil month, day, hour, minute, and second
fails:Time.gm handles a String year
fails:Time.gm coerces the year with #to_int
fails:Time.gm handles a String month given as a numeral
fails:Time.gm handles a String month given as a short month name
fails:Time.gm coerces the month with #to_str
fails:Time.gm coerces the month with #to_int
fails:Time.gm handles a String day
fails:Time.gm coerces the day with #to_int
fails:Time.gm handles a String hour
fails:Time.gm coerces the hour with #to_int
fails:Time.gm handles a String minute
fails:Time.gm coerces the minute with #to_int
fails:Time.gm handles a String second
fails:Time.gm coerces the second with #to_int
fails:Time.gm interprets all numerals as base 10
fails:Time.gm handles fractional seconds as a Float
fails:Time.gm handles fractional seconds as a Rational
fails:Time.gm handles years from 0 as such
fails:Time.gm returns subclass instances
fails:Time.gm handles string arguments
fails:Time.gm handles float arguments
fails:Time.gm handles microseconds
@@ -35,4 +7,3 @@ fails:Time.gm handles fractional microseconds as a Rational
fails:Time.gm ignores fractional seconds if a passed whole number of microseconds
fails:Time.gm ignores fractional seconds if a passed fractional number of microseconds
fails:Time.gm creates a time based on given values, interpreted as UTC (GMT)
fails:Time.gm accepts various year ranges
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/hour_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/mday_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/min_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/mon_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/month_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/strftime_tags.txt
Original file line number Diff line number Diff line change
@@ -3,6 +3,5 @@ fails:Time#strftime with %N formats the nanoseconds of of the second with %N
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 rounds fixed offset to the nearest second
fails:Time#strftime formats time according to the directives in the given format string
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/sunday_tags.txt

This file was deleted.

29 changes: 0 additions & 29 deletions spec/truffle/tags/core/time/utc_tags.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
fails:Time#utc? returns true if time represents a time in UTC (GMT)
fails:Time.utc creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)
fails:Time.utc interprets pre-Gregorian reform dates using Gregorian proleptic calendar
fails:Time.utc interprets Julian-Gregorian gap dates using Gregorian proleptic calendar
fails:Time.utc interprets post-Gregorian reform dates using Gregorian calendar
fails:Time.utc accepts 1 argument (year)
fails:Time.utc accepts 2 arguments (year, month)
fails:Time.utc accepts 3 arguments (year, month, day)
fails:Time.utc accepts 4 arguments (year, month, day, hour)
fails:Time.utc accepts 5 arguments (year, month, day, hour, minute)
fails:Time.utc accepts nil month, day, hour, minute, and second
fails:Time.utc handles a String year
fails:Time.utc coerces the year with #to_int
fails:Time.utc handles a String month given as a numeral
fails:Time.utc handles a String month given as a short month name
fails:Time.utc coerces the month with #to_str
fails:Time.utc coerces the month with #to_int
fails:Time.utc handles a String day
fails:Time.utc coerces the day with #to_int
fails:Time.utc handles a String hour
fails:Time.utc coerces the hour with #to_int
fails:Time.utc handles a String minute
fails:Time.utc coerces the minute with #to_int
fails:Time.utc handles a String second
fails:Time.utc coerces the second with #to_int
fails:Time.utc interprets all numerals as base 10
fails:Time.utc handles fractional seconds as a Float
fails:Time.utc handles fractional seconds as a Rational
fails:Time.utc handles years from 0 as such
fails:Time.utc returns subclass instances
fails:Time.utc handles string arguments
fails:Time.utc handles float arguments
fails:Time.utc handles microseconds
@@ -36,5 +8,4 @@ fails:Time.utc handles fractional microseconds as a Rational
fails:Time.utc ignores fractional seconds if a passed whole number of microseconds
fails:Time.utc ignores fractional seconds if a passed fractional number of microseconds
fails:Time.utc creates a time based on given values, interpreted as UTC (GMT)
fails:Time.utc accepts various year ranges
fails:Time#utc returns the utc representation of time
1 change: 0 additions & 1 deletion spec/truffle/tags/core/time/year_tags.txt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -147,7 +147,13 @@ public RubyArray timeDecompose(RubyTime time) {
final int day = dateTime.getDayOfMonth();
final int month = dateTime.getMonthOfYear();
final int year = dateTime.getYear();
final int wday = dateTime.getDayOfWeek();

int wday = dateTime.getDayOfWeek();

if (wday == 7) {
wday = 0;
}

final int yday = dateTime.getDayOfYear();
final boolean isdst = false;

@@ -253,6 +259,9 @@ public RubyTime timeSFromArray(RubyClass timeClass, int sec, int min, int hour,
DebugOperations.send(getContext(), getContext().getCoreLibrary().getENV(), "[]", null, getContext().makeString("TZ")).toString());
final DateTime dateTime = new DateTime(year, month, mday, hour, min, sec, nsec / 1_000_000, zone);
return new RubyTime(timeClass, dateTime, null);
} else if (isdst == -1 && fromutc && utcoffset == getContext().getCoreLibrary().getNilObject()) {
final DateTime dateTime = new DateTime(year, month, mday, hour, min, sec, nsec / 1_000_000, DateTimeZone.UTC);
return new RubyTime(timeClass, dateTime, utcoffset);
} else {
throw new UnsupportedOperationException(String.format("%s %s %s %s", isdst, fromutc, utcoffset, utcoffset.getClass()));
}
@@ -272,6 +281,13 @@ public RubyTime timeSFromArray(RubyClass timeClass, double sec, int min, int hou
return timeSFromArray(timeClass, secondsWhole, min, hour, mday, month, year, nanosecondsFractional, isdst, fromutc, utcoffset);
}

@Specialization
public RubyTime timeSFromArray(RubyClass timeClass, double sec, int min, int hour, int mday, int month, int year,
int nsec, int isdst, boolean fromutc, Object utcoffset) {
final int secondsWhole = (int) sec;
return timeSFromArray(timeClass, secondsWhole, min, hour, mday, month, year, nsec, isdst, fromutc, utcoffset);
}

private int cast(Object value) {
if (value instanceof Integer) {
return (int) value;