Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add time zones support #5324

Merged
merged 9 commits into from
Jan 18, 2018
Merged

Conversation

straight-shoota
Copy link
Member

@straight-shoota straight-shoota commented Nov 24, 2017

Until now, instances of Time had a kind member which indicated, whether this instance holds a time in UTC, an unspecified "local" timezone or is entirely unspecified.

This PR adds a Time::Location class which represents a specific time zone. Each Time instance references a Location (i.e where this time applies). From this location's transition rules, the applicable offset at each point in time can be derived, including daylight savings time, time zone changes etc.

Storing only an offset from UTC is not enough, because from that you can't infer what timezone transition rules to apply. And offset changes inside a time zone happen quite frequently (for example daylight savings).

Time

The kind ivar in Time is replaced by location which is a pointer to a Location instance.

struct Time
  @seconds : Int64                    # 8 Byte
  @nanoseconds : Int32                # 4 Byte
  @kind : Time::Kind                  # 4 Byte
end

# Becomes:
struct Time
  @seconds : Int64                    # 8 Byte
  @nanoseconds : Int32                # 4 Byte
  @location : Pointer(Time::Location) # 8 Byte (64 bit architecture)
end

This means, each Time struct will require 24 bytes instead of the currently used 16 bytes (on 64-bit). This increases the size of a time struct slightly but it is inevitable to embed a reference to a time zone if proper time zone handling should be supported.

For incremental time (a reference to a a specific point in time), seconds and nanoseconds always represent time in UTC. The offset will only be added when needed (for example to access one of the date/time fields individually). This makes it easier than if it was stored with offset as that might lead to invalid or ambiguous instances (for example when an hour is skipped or happens twice at a DST switch). Another benefit is, that retrieving the offset (zone transitions are looked up by unix epoch) and comparing two instances requires no conversion. Converting a time between zones means just exchanging the location.

Time::Location

Each location can be one of the following

  • a timezone in the IANA time zone database read from a local copy of this database which is provided for by the operating system (available in most unix-like OS's) or a custom distribution (can be configured throught ZONEINFO environment variable)
  • A zone with a fixed-offset
  • Coordinated Universal Time, available as Time::Location::UTC
  • an unspecified time zone, indicating a floating time which is not tied to a specific time zone.

The concept for loading location data from system sources is inspired by Go's implementation which seems very reasonable for this.

Of course, it can't be expected to find that zoneinfo data available on every platform (hey, Windows!). Other systems will probably require some additional effort, but Go has implementations for a variety of platforms, so it can be done one way or another. As far as I understand, under Windows, timezone information is available (needs some translation and stuff, but it's usable) but only limited to the current applicable time zone data. Application that need to cover wider time frames will probably have to distribute their own copy of the timezone database. But in general, it is certainly best if we can rely on the operating system to provide that data.
For now, it should work for all currently supported Crystal targets.

Floating time

A floating time which is not tied to a specific time zone is currently indicated by the special location Location::UNSPECIFIED. Time instances created with Time.new and no location argument are by default floating times. This means, they don't represent a specific point in time but are only aplicable in a specific context.
A floating time 08:30 can for example represent each point in time, where the local time shows 08:30, independent of local time's timezone. If I set an alarm at 08:30, I want that alarm to trigger when it is 8:30 wherever I am at that point.
But it doesn't have to be that, it can also have a different meaning. Floating times have no semantic context.

Comparing or operating on floating and incremental times causes problems:

For example, my computer time says 2017-11-24 19:37, we'll use that as a floating time.
Another source tells me, the current time in UTC is 2017-11-24 18:37 UTC or in my local timezone: 2017-11-24 19:37 +01:00.
Let's compare that with the floating time:

floating = 2017-11-24 19:37
utc      = 2017-11-24 18:37 UTC
local    = 2017-11-24 19:37 +01:00

utc      == local # => true, both represent the same point in time
floating == utc   # => ?
floating == local # => ?

We know that all three readings have been observed a the same point in time, so the last two comparisons should both be true, but they are mutually exclusive.

These issues with floating time are present all over the place (what should the format %z (time zone) print?). I've tried to implement this as sane as possible, but it's still a conceptual problem.
To solve this, I've already brought up the proposal to add a dedicated type for floating time, but this is another issue.

Time representation

This PR also modifies the string representation of a Time instance (regarding #inspect, #to_s):

#  Floating times with unspecified location have no time zone attached and won't print any.
2017-11-25 22:06:17

# UTC times print time zone `UTC`
2017-11-25 22:06:17 UTC

# Times with a fixed-offset location print the timezone offset (seconds are truncated unless relevant)
2017-11-25 22:06:17 +01:00
2017-11-25 22:06:17 +01:00:37

# Times with a non-fixed-offset location print the timezone offset plus zone name
2017-11-25 22:06:17 +01:00 Europe/Berlin

Requires #5321
Fixes #2490
/cc #2481 #4556

@RX14
Copy link
Contributor

RX14 commented Nov 24, 2017

I don't think that times should have an unspecified timezone by default, in fact I think we should reconsider the existence of an unspecified time zone: does it have a valid usecase. Having the possibility of not being able to convert a given time to an instant in UTC adds a lot of error cases.

@straight-shoota straight-shoota force-pushed the jm-timezones branch 2 times, most recently from 21ce15e to 3b6e63e Compare November 24, 2017 19:50
@straight-shoota
Copy link
Member Author

Time.new could probably use the local timezone by default, but I'm not entirely sure about this. For now I've kept it as it has been before (only that until now it didn't have much effect anyway).
It could also make sense to promote the more descriptive constructor methods supporting date field arguments - namely Time.utc, Time.local (maybe Time.floating or similar) - and maybe make Time.now to require location instead of providing a default. This would be super expressive but I guess it's not as developer-friendly and easy-to-understand for beginners.

I'd favor to keep this PR focused on the implementation of time zones and have the general discussion about floating time in a separate issue. For now, I've tried to adjust the existing structure to the new concept, but this can be changed depending on the outcome of the floating time issue.

@straight-shoota
Copy link
Member Author

I've added a section about Time representation in the OP

src/time.cr Outdated
else
Format.new(" %::z").format(self, io)
end
io << " " << location.name unless location.fixed?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

" " could be a Char.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I intended to change that.
However, I'd rather welcome feedback on the general concept instead of such minor details ;)

@straight-shoota straight-shoota force-pushed the jm-timezones branch 3 times, most recently from 9c744c0 to 133b082 Compare November 26, 2017 14:32
@luislavena
Copy link
Contributor

Thank you @straight-shoota for this PR, your approach looks very interesting and will love to take a look and see this implementation against some apps I have in the following days.

Will be possible for you to include some examples on creation of time instances on fixed locations? For example, how will be possible to recreate certain date/time on EST/EDT or PST/PDT (perhaps adding that to the Time.new constructor documentation).

Also notice that Time.new with no argument will default to Time::Location.local while Time.new with arguments will default to unspecified (floating). It will be great to include more examples on that usage here in the PR or the code itself (I prefer the later).

Once again, thank you for your contribution and looking forward your responses!
❤️ ❤️ ❤️

@straight-shoota
Copy link
Member Author

@luislavena Some typical usage should be documented in the specs - but of course the documentation still needs to be improved further.

Some examples:

# using a fixed offset of 3:00:
location = Time::Location.fixed(3 * 3600)
time =  Time.new 2014, 10, 30, 21, 18, 13, location: location # => 2014-10-30 21:18:13 +03:00
# using a tz database location:
location = Time::Location.load("Europe/Berlin")
time = Time.new 2014, 10, 30, 21, 18, 13, location: location # => 2014-10-30 21:18:13 +01:00 Europe/Berlin
location = Time::Location.load("EST5EDT")
time = Time.new 2014, 10, 30, 21, 18, 13, location: location # => 2014-10-30 21:18:13 -04:00 EST5EDT
location = Time::Location.load("PST8PDT")
time = Time.new 2014, 10, 30, 21, 18, 13, location: location # => 2014-10-30 21:18:13 -07:00 PST8PDT

The use of Time::Location.load/Time::Location.fixed might be a bit tedious, but I'm not sure if and how this could be improved. It would be possible to allow location to receive a string or int and create the corresponding location accordingly. But I'm not sure if this would be a good idea as it would hide the fact that each call creates a new instance of Time::Location.

Time.new is essentially the same as Time.now, and for the current time it makes sense to be in the local timezone by default. Time.new with individual date/time fields is something different, and as long as there is no location provided, it makes sense to recognize this as "floating" time. It usually makes little sense to create a reference to an absolute wall time reading with a completely unknown zone offset - for all we know, Location.local could be anything at runtime, so it is essentially a floating date, not a specific instance in incremental time.
If you want to create a reference to an absolute point in time, you need to specific an explicit time zone reference, either by using Time.utc or specifying a concrete location (either fixed offset or named location).

So, clearly, the naming can be a bit confusing and should certainly be improved, but that will probably depend on what we decide to do about floating time. One solution could be to make Time.new always require a location and introduce a different means to create floating time (like Time.floating) which won't accept a different location.

@bew
Copy link
Contributor

bew commented Nov 26, 2017

Is it possible/want-able to create a Location object from a Time::Span object ?

@straight-shoota
Copy link
Member Author

@bew Do you have some usecase in mind?
It should be as easy as Location.fixed(span.total_seconds), so I don't think it would be worth adding a specific API for this.

@bew
Copy link
Contributor

bew commented Nov 26, 2017

No, no use-case in mind, I was just reading your example Time::Location.fixed(3 * 3600) and was thinking "hmm could we do Time::Location.fixed(3.hours) instead?"

@straight-shoota
Copy link
Member Author

Yeah, I think it should not be too common to use this constructor at all, and even less with a static value.
Creating fixed-offset locations should be avoided as much as possible anyway, unless there is no other way, for example when the time is read from an external source with only an offset and no time zone location attached.

Such absolute timepoints in machine-readable data don't need any offset at all and should better work directly in UTC.
Offsets are only relevant for human interaction, but then you need a proper timezone location anyway to accurately map time and offsets.

@luislavena
Copy link
Contributor

@straight-shoota will be possible for you to rebase against master now that #5321 has been merged?

Thank you.
❤️ ❤️ ❤️

@straight-shoota
Copy link
Member Author

Rebased.

@luislavena
Copy link
Contributor

Thank you @straight-shoota for the explanation and sorry for the delay on getting back to you on your comments.

re: floating time

From the example:

floating = 2017-11-24 19:37
utc      = 2017-11-24 18:37 UTC
local    = 2017-11-24 19:37 +01:00

utc      == local # => true, both represent the same point in time
floating == utc   # => ?
floating == local # => ?

I don't think floating == utc should return true. As described, the scenario of least surprise will be that floating compares the time and date elements of both dates disregard of the time location of each other.

That will allow me ask the question tell me when is 7pm independently of the time location the other time instance I'm comparing against it.

But I'm not sure if this would be a good idea as it would hide the fact that each call creates a new instance of Time::Location.

This will definitely need to be addressed via a cache per-process. Looked at this through the eyes of someone that had to load 6 different timezones and process 500K date records. Haven't converted the script to test this (is a Ruby one) but might do over the weekend for further comments.

Last but not least, really love the flexibility to move time instances across timezones:

ny = Time::Location.load("America/New_York")
ar = Time::Location.load("America/Buenos_Aires")

time1 = Time.now(location: ny)
pp time1 # => 2017-11-28 10:34:23 -05:00 America/New_York

time2 = time1.in(location: ar)
pp time2 # => 2017-11-28 12:34:23 -03:00 America/Buenos_Aires

❤️ ❤️ ❤️

@straight-shoota
Copy link
Member Author

Well, utc and local describe the same point in time, so why floating should really be equal utc when both are observed in the same time zone. This can't be decided conclusively. There will always be some kind of contradiction.
But I'm working on opening a separate issue about floating time, so we can focus here on the location implementation.

Caching location data is not as straightforward as it might seem, because the time zone database could get updated every now and then. You can imagine for example a server-process running for several years and the tz database had 10 releases alone in 2016. As we all know, cache-invalidation is one of the most difficult things in computer science.

The best way to handle this depend highly on the application. I like the idea to make (optional) caching of location data a job of the application or a 3rd party library. The current solution works well enough for stdlib and should be sufficient for many simple use cases. And it's easy to build upon.

@RX14
Copy link
Contributor

RX14 commented Nov 28, 2017

Floating doesn't have enough information to be compared, so it shouldn't. Always return false unless it's floating too.

@larubujo
Copy link
Contributor

this change makes all code (like an empty file or a hello world) require zip, zlib, flate, crc32. doesn't sound like a nice thing...

@straight-shoota
Copy link
Member Author

@larubujo Yes, thanks for noticing. This is only temporary to provide a prototype. These dependencies will be removed.
I'm planning on including a custom reader, like it is implemented in Go. This is pretty straightforward for uncompressed ZIP files, I just didn't want to spend the time on that when a working example can rely on the existing implementation.


negative, hours, minutes, seconds = local_time_zone_info
io << (negative ? "-" : "+")
io << "0" if hours < 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0" -> '0'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines were not modified by this PR (only whitespace change), so I think this could be fixed independently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also char is slower than string. the people that thought that char is more efficient got it wrong. same when you index a string with a char instead of a string. or starts_with. char is slower. so string is preferred.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larubujo Sure about this? My benchmark says otherwise. However, this is completely off-topic here. So, if you have some evidence to support your claim, please post a new issue about that. This would be quite unexpected.

Copy link
Contributor

@Sija Sija Nov 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larubujo it's true indeed for starts_with?(Char) overload—its performance was severely degraded since v0.23.1 btw:

Benchmark.ips do |x|
  x.report("starts_with? Char") { "foo".starts_with? 'f' }
  x.report("starts_with? String") { "foo".starts_with? "f" }
end

v0.23.1:

  starts_with? Char  457.3M (  2.19ns) (±19.03%)  1.02× slower
starts_with? String 468.03M (  2.14ns) (±17.47%)       fastest

master:

  starts_with? Char  207.7M (  4.81ns) (±13.71%)  2.23× slower
starts_with? String 463.22M (  2.16ns) (±13.89%)       fastest

Yet, passing a Char to IO is still faster:

Benchmark.ips do |x|
  io = IO::Memory.new

  x.report("io << Char") { io << 'f' }
  x.report("io << String") { io << "f" }
end

v0.23.1:

  io << Char 139.61M (  7.16ns) (±19.08%)       fastest
io << String  82.44M ( 12.13ns) (±20.64%)  1.69× slower

master:

  io << Char 142.37M (  7.02ns) (±17.83%)       fastest
io << String  83.37M ( 11.99ns) (±13.60%)  1.71× slower

Copy link
Contributor

@larubujo larubujo Nov 30, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems i was partially wrong. but it still slower for non-ascii:

require "benchmark"

haystack = "がこう"

needle_string = ""
needle_char = 'う'

a = 0
Benchmark.ips do |x|
  x.report("ends char") do
    a += haystack.ends_with?(needle_char) ? 1 : 0
  end
  x.report("ends string") do
    a += haystack.ends_with?(needle_string) ? 1 : 0
  end
end

Benchmark.ips do |x|
  x.report("starts char") do
    a += haystack.starts_with?(needle_char) ? 1 : 0
  end
  x.report("starts string") do
    a += haystack.starts_with?(needle_string) ? 1 : 0
  end
end

puts a

output

  ends char  97.43M ( 10.26ns) (±10.90%)  1.40× slower
ends string 136.87M (  7.31ns) (±11.64%)       fastest
  starts char  95.46M ( 10.48ns) (±10.51%)  1.40× slower
starts string 133.26M (   7.5ns) (±10.70%)       fastest

in any case times around nanosecond, so corrections like use '0' instead of "0" dont matter much

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that it doesn't matter much, but if you consider the future evolution of the standard library then using the char overload gives you much more optimization possibilities, even if the current performance is different.

If you notice a performance problem, make an issue please.

io << (negative ? "-" : "+")
io << "0" if hours < 10
io << hours
io << "0" if minutes < 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

@ysbaddaden ysbaddaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the work. Directly parsing the tzdata files is a welcomed achievement, and overall the PR is great!

I'd like to raise a few issues, thought:

  1. Requiring zlib in all Crystal programs that use Time, in the event that ZONEINFO may target a ZIP file. I'd assume this is a fairly uncommon practice (please correct me) and the Crystal compiler, for example, is expressly compiled without zlib. Maybe we can relax this, and assume zlib to be fairly available, but this adds yet-another-dependency that not be needed otherwise.

  2. Parsed locations appear to never be cached? Which means that Time.new will call Location.local which will lookup a zoneinfo (from TZ) or load /etc/localtime each time?

  3. Unspecified location and overall floating time support. IMHO this doesn't belong to this pull request, the related issue even states this is "far from ideal" and it raises concerns (floating time isn't a time with offset that happens to not have an offset, actually, but it's not UTC either, and... infinite rant). IMHO this should be dropped from this PR, and maybe reintroduced later (or not) depending on the outcome of [RFC] Supporting floating time #5332.

Once those 3 points and answered or fixed. This will be a great 👍 from me.

with_zoneinfo do
location = Time::Location.load("Europe/Berlin")
reference = Time.new(2017, 10, 28, 13, 37, location: location)
next_day = Time.new(2017, 10, 28, 13, 37, location: location)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? reference == next_day (same date, same time, same location); shouldn't next day be the 29th? Thus the assertion below should fail.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a typo. This example is marked as pending, thus it's not executed at all (and the error got unnoticed until now). With the current implemenation of Time::Span it won't work, because 1.day equals 24 hours, but from 2017-10-28 13:37 (CEST +02:00) to 2017-10-29 13:37 (CET +01:00) it is only 23 hours (but still 1 day).

zone.dst?.should be_false
end

it ".local" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you're copying the tzset behavior here, yet having TZ=nil mean local but TZ="" mean UTC is a bit confusing. It's also missing a test for an unknown location (eg: Unknown/Nowhere) that should fallback to UTC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur it is confusing, but so would it be if TC="" did not mean UTC in contrast to tzset... I'm not sure what would be better, but in doubt I'd rather mirror the behaviour of tzset instead of introducing new semantics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the semantics of TZ environment variable should stay the same, we could perhaps remove Location.load("") to mean UTC.

end

def self.load_localtime
if location = ::Time::Location.load("localtime", ["/etc/"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe consider a Location.load_file("/etc/localtime") to avoid instantiating an array just to throw it away.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it could just open the file here and use read_zoneinfo directly, skipping a few unnecessary steps in between.

return localtime
end
else
begin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Throwing an exception just to silence it is slow. Please introduce a nilable load?(name) method instead.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's sufficient to add load?(name, sources). At least for this usage we don't need all the special case checks.

# Parse "zoneinfo" time zone file.
# This is a fairly standard file format used on OS X, Linux, BSD, Sun, and others.
# See tzfile(5), http:#en.wikipedia.org/wiki/Zoneinfo,
# and ftp:#munnari.oz.au/pub/oldtz/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual documentation is the IANA. For tzdata this is https://data.iana.org/time-zones/tz-link.html with the source reference at https://github.com/eggert/tz (and of course the format spec in the tzfile(5) man page).

I'd say it's more than "fairly standard" but a "de-facto standard", used by most operating systems (even windows) if not all.

src/time.cr Outdated
end

# Returns a new `Time` instance at the specified time in local time zone.
def self.local(year, month, day, hour = 0, minute = 0, second = 0, *, nanosecond = 0) : Time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Time.new should already be localtime so it's a duplicate.

@@ -17,26 +18,16 @@ struct Time::Format
@pm = false
end

def time(kind = Time::Kind::Unspecified)
def time(location : Location = Location::UNSPECIFIED)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again: localtime.

end

# :nodoc:
def self.load_from_dir_or_zip(name, source)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really have to support ZONEINFO being a ZIP file? That requires all programs that use Time to always link against libz, for something that seems fairly uncommon.

Furthermore, we're compiling Crystal itself with -D without_zlib so it should at least be verified here, or just drop support for ZONEINFO altogether.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I get a thumbs up, I'll happily implement the simple ZIP access.

end

# :nodoc:
def self.zone_sources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just call Crystal::System::Time.zone_sources directly.

end

# :nodoc:
def self.load_localtime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto: just call Crystal::System::Time.load_localtime directly.

@straight-shoota
Copy link
Member Author

straight-shoota commented Nov 30, 2017

@ysbaddaden Thanks for the in-depth review!

  1. Please see my previous comment answering to @larubujo. I'd implement the ZIP reader directly - it doesn't need to support compression, so it's quite easy to do (essentially a port of this Go function). No need to depend on zlib. On most unix systems, time zone data should be readily available. But on other platforms like Windows (which will be supported eventually) there will be a need for applications to have some other source for a tzinfo database, preferably a ZIP file.

  2. Yes. This is surely open for debate. I've quickly touched this in a comment before:

Caching location data is not as straightforward as it might seem, because the time zone database could get updated every now and then. You can imagine for example a server-process running for several years and the tz database had 10 releases alone in 2016. As we all know, cache-invalidation is one of the most difficult things in computer science.

I think the best strategy for stdlib is to to provide the basic tools to have proper time zone support, but leave optimization layers like caching and maybe some sort of location registry to the application or 3rd party libraries. That's also the way they do it in Go (though I'm not sure if there are libraries for caching locations - but the general idea that the stdlib implementation always reads from the database directly).
If you just need the current timestamp, you can prevent a lookup of the local timezone by using Time.utc.

  1. We had Kind::Unspecified before, that's why I tried to incorporate this concept (even if it did not literally mean "floating time"). But I agree on your reasoning to remove it from this PR. Though I see a few (minor) issues that might need discussion. I will address that in a subsequent comment.

@straight-shoota
Copy link
Member Author

straight-shoota commented Dec 1, 2017

Ad 3. Removing Location::UNSPECIFIED

It is fairly straightforward to remove all the parts relating to floating time. However, there is an issue with the time format parser: The parser can always encounter time format without time zone which are by themselves not related to a location. How this is to be interpreted depends on the context. In YAML for example, a time without offset or time zone name is considered to be in UTC. In other cases it might mean local time (though that is quite imprecise) or just be undefined (=floating time).
Now, even if we don't support floating time explicitly, it should be possible to recognize that a time value without time zone was parsed. I think this can be handled with user code, such as creating a custom "unspecified" location instance and using this as default value. If the parsed time value has this location, it did not contain a time zone. This should be good without any additional help from stdlib.

The question is, should there be a default value for Time::Format::Parser#time(location) and if so, which would it be? I don't think we can just assume any specific default, because this can't be determined generally.
The culprit is that a default location is only needed for the relative uncommon parsing of a time format which does not include a time zone. For most use cases, it makes no sense to require a default location at all because it's simply never needed.

So, we could either select an arbitrary default location if none particular is specified by the caller, which could be completely wrong in some contexts but might go unnoticed, possibly introducing a subtle hidden bug. Or we could remove the requirement to have an implicit default location which would raise an exception if none is specified by the caller. This would also fail but at least it would be noticed.
I'd prefer the latter: if the format does not include time zone information and no default location was explicitly provided, there is no way to know how such a value should be represented as an instance of Time.

@RX14
Copy link
Contributor

RX14 commented Dec 1, 2017

Go for nillable default timezone with raise on get.

@straight-shoota
Copy link
Member Author

straight-shoota commented Jan 17, 2018

I've added two commits to get this running on windows. 💯

Only Location::UTC, Location.local and custom locations are supported for now. Loading tzdata files should work once File is properly ported.


time += (day - 1).days

return time.epoch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant return.

Copy link
Contributor

@RX14 RX14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typos in ae7e6b8's description

timei zone

Time::Loication


nodes = xml.xpath_nodes("/supplementalData/windowsZones/mapTimezones/mapZone[@territory=001]")

entries = [] of Tuple(String, Tuple(String, String), String)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use named tuples here for descripriveness?

@@ -41,6 +41,15 @@ lib LibC
daylightBias : LONG
end

# Daylight saving time is not used in the current time zone, because there are no transition dates or automatic adjustment for daylight saving time is disabled.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't typically doc these...

@@ -23,6 +23,9 @@ class Time::Location

# :nodoc:
def self.load_from_dir_or_zip(name : String, source : String)
{% if flag?(:win32) %}
raise NotImplementedError.new("Time::Location.load_from_dir_or_zip")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please indent these properly.

This adds basic support for using the new time zone model on windows.
* `Crystal::System::Time.zone_sources` returns an empty array because
  Windows does not include a copy of the tz database.
* `Crystal::System::Time.load_localtime` creates a local time zone
  `Time::Location` based on data provided by `GetTimeZoneInformation`.
* A mapping from Windows time zone names to identifiers used by the
  IANA timezone database is included as well as an automated generator
  for that file.
Trying to load a location from a file will fail because `File` is not
yet ported to windows.
@straight-shoota
Copy link
Member Author

@RX14 fixed the issues.

@RX14 RX14 requested a review from ysbaddaden January 18, 2018 11:59
@RX14 RX14 merged commit f3168b6 into crystal-lang:master Jan 18, 2018
@straight-shoota straight-shoota deleted the jm-timezones branch January 18, 2018 13:15
@straight-shoota
Copy link
Member Author

Awesome to see this merged! Thanks for all the reviews and suggestions helping to get this done 💯

chris-huxtable pushed a commit to chris-huxtable/crystal that referenced this pull request Apr 6, 2018
* Add cache for last zone to Time::Location#lookup

* Implement Time::Location including timezone data loader

Remove representation of floating time from `Time` (formerly expressed
as `Time::Kind::Unspecified`).

Floating time should not be represented as an instance of `Time` to avoid undefined operations through type safety (see crystal-lang#5332).
Breaking changes:
* Calls to `Time.new` and `Time.now` are now in the local time zone by
  default.
* `Time.parse`, `Time::Format.new` and `Time::Format.parse` don't specify a default location.
  If none is included in the time format and no default argument is provided, the parse method wil raise an exception because there is no way to know how such a value should be represented as an instance of `Time`.
  Applications expecting time values without time zone should provide default location to apply in such a case.

* Implement custom zip file reader to remove depenencies

* Add location cache for `Location.load`

* Rename `Location.local` to `.load_local` and make `local` a class property

* Fix env ZONEINFO

* Fix example code string representation of local Time instance

* Time zone implementation for win32

This adds basic support for using the new time zone model on windows.
* `Crystal::System::Time.zone_sources` returns an empty array because
  Windows does not include a copy of the tz database.
* `Crystal::System::Time.load_localtime` creates a local time zone
  `Time::Location` based on data provided by `GetTimeZoneInformation`.
* A mapping from Windows time zone names to identifiers used by the
  IANA timezone database is included as well as an automated generator
  for that file.

* Add stubs for methods with file acces

Trying to load a location from a file will fail because `File` is not
yet ported to windows.
chris-huxtable added a commit to chris-huxtable/crystal that referenced this pull request Apr 6, 2018
commit 680d3e0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Apr 6 08:24:25 2018 +0900

    Format: fix formatting call having trailing comma with block (crystal-lang#5855)

    Fix crystal-lang#5853

commit f22d689
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Apr 6 08:18:23 2018 +0900

    Refactor Colorize#surround (crystal-lang#4196)

    * Refactor Colorize#surround

    This is one of the separations of crystal-lang#3925.

    Remove `surround` and rename `push` to `surround`, now `push` is
    derecated.
    (This reason is dscribed in crystal-lang#3925 (comment))

    * Use #surround instead of #push

    * Apply 'crystal tool format'

    * Remove Colorize#push

commit 12488c2
Author: Benoit de Chezelles <[email protected]>
Date:   Thu Apr 5 07:49:51 2018 -0700

    Ensure cleanup tempfile after some specs (crystal-lang#5810)

    * Ensure cleanup tempfile after some specs

    * Fix compiler spec

commit ef85244
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Apr 5 20:59:33 2018 +0900

    Format: fix formatter bug on nesting begin/end

commit 8c737a0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Apr 5 22:54:20 2018 +0900

    Remove duplicated indefinite articles 'a a' in char.cr doc (crystal-lang#5894)

    * Fix duplicated articles 'a a' in char.cr doc

    * Shorten sentence

    crystal-lang#5894 (comment)

commit 73989e8
Author: maiha <[email protected]>
Date:   Thu Apr 5 22:43:43 2018 +0900

    fix example codes (2018-04) (crystal-lang#5912)

commit b62c4e1
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sun Apr 1 16:09:29 2018 +0200

    Refactor out variable name

commit c17ce2d
Author: Sankha Narayan Guria <[email protected]>
Date:   Thu Apr 5 01:58:11 2018 -0400

    UUID implements inspect (crystal-lang#5574)

commit 106d44d
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 23:01:43 2018 +0900

    MatchData: correct sample code for duplicated named capture

    Ref: crystal-lang#5912 (comment)

commit 011e688
Author: Paul Smith <[email protected]>
Date:   Wed Apr 4 13:37:41 2018 -0400

    Small typo fix in bash completion

commit b5a3a65
Author: Johannes Müller <[email protected]>
Date:   Wed Apr 4 15:59:33 2018 +0200

    Fix File.join with empty path component (crystal-lang#5915)

commit 9662abe
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 16:42:42 2018 +0900

    Fix `String#tr` 1 byte `from` optimization bug

    Ref: crystal-lang#5912 (comment)

    `"aabbcc".tr("a", "xyz")` yields `"xyzxyzbbcc"` currently.
    Of course it is unintentional behavior, in Ruby it yields `"xxbbcc"` and
    on shell `echo aabbcc | tr a xyz` shows `xxbbcc`.

commit ec423eb
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 02:38:21 2018 +0900

    Fix crystal-lang#5907 formatter bug (crystal-lang#5909)

    * Fix crystal-lang#5907 formatter bug

    * Apply new formatter

commit 5056859
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 02:33:07 2018 +0900

    Pass an unhandled exception to at_exit block as second argument (crystal-lang#5906)

    * Pass an unhandled exception to at_exit block as second argument

    Follow up crystal-lang#1921

    It is better in some ways:

      - it does not need a new exception like `SystemExit`.
      - it does not break compatibility in most cases because block fill up lacking arguments.

    * Add documentation for at_exit block arguments

    * Update `at_exit` block arguments description

    crystal-lang#5906 (comment)
    Thank you @jhass.

commit 82caaf0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 23:18:01 2018 +0900

    Semantic: don't guess ivar type from argument after assigned (crystal-lang#5166)

commit bb5bcd2
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 21:00:27 2018 +0900

    Colorize: abstract colors and support 8bit and true color (crystal-lang#5902)

    * Colorize: abstract colors and support 8bit and true color

    Closes crystal-lang#5900

    * Color#fore and #back take io to avoid memory allocation

    * Use character literal instead of 1 length string

commit 7eae5aa
Author: Benoit de Chezelles <[email protected]>
Date:   Mon Apr 2 16:43:52 2018 -0700

    Use LibCrystalMain.__crystal_main directly (crystal-lang#5899)

commit 60f675c
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 08:42:03 2018 +0900

    Format: fix indentation after backslash newline (crystal-lang#5901)

    crystal-lang#5892 (comment)

commit 4d2ad83
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 08:21:06 2018 +0900

    Prevent invoking `method_added` macro hook recursively (crystal-lang#5159)

    Fixed crystal-lang#5066

commit e17823f
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 07:56:52 2018 +0900

    Format: fix indentation in collection with comment after beginning delimiter (crystal-lang#5893)

commit 49d722c
Author: Chris Hobbs <[email protected]>
Date:   Sat Mar 31 19:30:54 2018 +0100

    Print exception cause when inspecting with backtrace (crystal-lang#5833)

commit 945557b
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Mar 31 20:30:15 2018 +0200

    Use Char for single char strings (crystal-lang#5882)

commit 4532389
Author: r00ster91 <[email protected]>
Date:   Sat Mar 31 15:35:08 2018 +0200

    Fix Random example (crystal-lang#5728)

commit 5cd78fa
Author: Benoit de Chezelles <[email protected]>
Date:   Fri Mar 30 15:29:30 2018 -0700

    Allow a path to declare a constant (crystal-lang#5883)

    * Allow a path to declare a constant

    * Add spec for type keeping when creating a constant using a Path

commit f33a910
Author: Carl Hörberg <[email protected]>
Date:   Fri Mar 30 20:40:31 2018 +0200

    Enqueue senders in Channel#close (crystal-lang#5880)

    Fixes crystal-lang#5875

commit 0424b22
Author: r00ster91 <[email protected]>
Date:   Thu Mar 29 16:17:20 2018 +0200

    Fix HEREDOC error message grammar (crystal-lang#5887)

    * Fix HEREDOC error message grammar

    * Update parser_spec.cr

commit 4927ecc
Author: Benoit de Chezelles <[email protected]>
Date:   Thu Mar 29 05:06:03 2018 -0700

    Fix typo (crystal-lang#5884)

commit c2efaff
Author: Will <[email protected]>
Date:   Thu Mar 29 08:05:05 2018 -0400

    Update docs for Enum (crystal-lang#5885)

commit 0970ee9
Author: Benoit de Chezelles <[email protected]>
Date:   Wed Mar 28 08:04:10 2018 -0700

    Fix exit in at_exit handlers (crystal-lang#5413)

    * Fix exit/raise in at_exit handlers

    * Add specs for exit & at_exit

    * Refactor handler loop

    * Disallow nested at_exit handlers

    * Print an unhandled exception after all at_exit handlers

    * Use try for the unhandled exception handler

    * Move the proc creation inside AtExitHandlers

    * Fix doc

    * Use a separate list for exceptions registered to print after at_exit handlers

    * Don't early return, always check for exceptions

    * Don't use a list for unhandled exceptions, store only one

commit 400bd0e
Author: Mark <[email protected]>
Date:   Wed Mar 28 05:44:58 2018 -0700

    Documentation: Add API docs for Array sorting methods (crystal-lang#5637)

    * Documentation: Add API docs for Array sorting methods
    - Array#sort(&block : T, T -> Int32)
    - Array#sort!(&block : T, T -> Int32)
    - Array#sort_by(&block : T -> _)
    - Array#sort_by!(&block : T -> _)

    * Documentation: Add API docs for Array#swap

    * Documentation: Update based on code review
    - Add explicit return types for sorting methods
    - Update descriptions based on code review
    - Format code using crystal's format tool

    * Documentation: Remove comments about optional blocks from Array#sort! and Array#sort

    * Documentation: Update descriptions for Array sorting methods

commit bc1c7a9
Author: Johannes Müller <[email protected]>
Date:   Tue Mar 27 23:05:30 2018 +0200

    Fix typo in IO doc

commit 9f28c77
Author: Heaven31415 <[email protected]>
Date:   Tue Mar 27 15:22:39 2018 +0200

    Make #read doc more clear in io.cr (crystal-lang#5873)

commit 9980a1f
Author: Jakub Jirutka <[email protected]>
Date:   Sun Mar 25 00:43:00 2018 +0100

    Add support for target aarch64-linux-musl

commit 9adbb92
Author: Jakub Jirutka <[email protected]>
Date:   Sat Mar 24 20:24:18 2018 +0100

    Makefile: Fix redirect to stderr to be more portable (crystal-lang#5859)

    `>/dev/stderr` does not work in some environments. Moreover, all POSIX
    compliant shells supports standard `>&2` for redirect stdout to stderr.

commit dedc726
Author: Benoit de Chezelles <[email protected]>
Date:   Fri Mar 23 06:57:01 2018 -0700

    Fix parser block arg newline (crystal-lang#5737)

    * parser: Add spec for method def block argument with new lines

    * parser: Handle space or newline after def's block arg's type

commit 2d93603
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Mar 21 06:49:50 2018 +0900

    Regex: fix invalid #inspect result against %r{\/} (crystal-lang#5841)

    `p %r{\/}` shows `/\\//`. It is invalid regexp.

commit 502ef40
Author: Johannes Müller <[email protected]>
Date:   Mon Mar 19 14:25:25 2018 +0100

    Fix URI encoding in StaticFileHandler#redirect_to (crystal-lang#5628)

commit 5d5c9ac
Author: Lachlan Dowding <[email protected]>
Date:   Mon Mar 19 00:46:24 2018 +1000

    Add JSON support to UUID (crystal-lang#5551)

commit c0cdbc2
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sun Mar 18 01:50:28 2018 +0100

    Use crystallang/crystal:nightly as docker nightly tag (crystal-lang#5837)

commit 863f301
Author: Anton Maminov <[email protected]>
Date:   Tue Mar 13 14:35:00 2018 +0200

    add HTTP OPTIONS method to HTTP::Client

commit 52fa3b2
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Sat Jan 27 22:48:08 2018 +0900

    Don't use heredoc inside interpolation

    heredoc inside interpolation is buggy and it is unuseful.
    It is a bit hard to fix this, so I'd like to forbid.

commit 077e0da
Author: Johannes Müller <[email protected]>
Date:   Tue Mar 13 20:10:11 2018 +0100

    Add boundary check for seconds in Time#initialize (crystal-lang#5786)

    Previously, `Time#add_span` did not handle times at the min or max range with positive or
    negative offsets correctly because `@seconds` can legitimately be `< 0` or `> MAX_SECONDS`
    when the offset is taken into account.
    The boundary check was moved to the constructor to prevent manually
    creating an invalid date.

commit dd0ed8c
Author: Johannes Müller <[email protected]>
Date:   Mon Mar 12 23:11:01 2018 +0100

    CHANGELOG: Change release dates to use ISO format

    Changes dates in DD-MM-YYYY to ISO format YYYY-MM-DD

commit 50aacaa
Author: asterite <[email protected]>
Date:   Mon Feb 5 09:22:35 2018 -0300

    Macro methods: set type of empty array literal

commit ed0aad8
Author: Benoit de Chezelles <[email protected]>
Date:   Sun Mar 11 09:36:14 2018 -0700

    Fix internal doc (typo & old invalid comment) (crystal-lang#5806)

    * Fix typo

    * Remove BNF for old def declaration without parentheses

commit 10fb1ff
Author: Benoit de Chezelles <[email protected]>
Date:   Sun Mar 11 05:14:06 2018 -0700

    Use the same llvm's version as crystal-lang package for CI's darwin build (crystal-lang#5804)

    * Use llvm5 for darwin build in CI

    * Force binaries of llvm in PATH

    * DRY for the llvm's version crystal-lang's depends on

    * Install jq

commit e8916bc
Author: Benoit de Chezelles <[email protected]>
Date:   Sat Mar 10 16:16:20 2018 -0800

    Restore STDIN|OUT|ERR blocking state on exit (crystal-lang#5802)

commit 92c3d42
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Mar 10 08:36:50 2018 -0300

    Update previous crystal release & docker images for ci to 0.24.2 (crystal-lang#5796)

    * Use crystallang/crystal-*-build docker images in ci

    * Update previous crystal to 0.24.2

commit 34b1101
Author: Johannes Müller <[email protected]>
Date:   Sat Mar 10 00:37:05 2018 +0100

    Add highlight to code tag in generated API docs (crystal-lang#5795)

commit 6696c88
Author: Donovan Glover <[email protected]>
Date:   Fri Mar 9 18:36:43 2018 -0500

    Fix unexpected h1 in CHANGELOG.md (crystal-lang#5576)

commit 731e9c0
Merge: 4f9ed8d 4ef9167
Author: Brian J. Cardiff <[email protected]>
Date:   Fri Mar 9 17:35:26 2018 -0300

    Merge changes from 0.24.2 with master

commit 4ef9167
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Sat Mar 10 00:40:35 2018 +0900

    Improve String#pretty_print output by splitting newline (crystal-lang#5750)

    Like Ruby's `pp`, String#pretty_print splits its content by newline and
    shows each lines with joining `+` operator.

    I believe this improves readability against large multiline string on `p`.

commit 5a189cb
Author: Cody Byrnes <[email protected]>
Date:   Fri Mar 9 06:09:41 2018 -0800

    Fix: File.extname edge case for dot in path with no extension (crystal-lang#5790)

commit f0bd6b6
Author: r00ster91 <[email protected]>
Date:   Fri Mar 9 00:48:03 2018 +0100

    Update readline.cr (crystal-lang#5791)

commit 224d489
Author: Johannes Müller <[email protected]>
Date:   Fri Mar 9 00:36:23 2018 +0100

    Return early in Time#add_span if arguments are zero (crystal-lang#5787)

commit 9d2dfbb
Author: Konstantin Makarchev <[email protected]>
Date:   Thu Mar 8 03:34:24 2018 +0300

    add *.dwarf to auto generated .gitignore

commit 4f9ed8d
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 23:55:26 2018 -0300

    Update changelog

commit 161bea6
Merge: 1445529 2dd3a87
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 20:20:20 2018 -0300

    Merge branch 'ci/nightly' into release/0.24

commit 2dd3a87
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 20:17:52 2018 -0300

    Run nightly on master

commit 3ad85aa
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 18:49:10 2018 -0300

    Use SHA1 to use fixed distribution-scripts version

commit 713fa33
Author: Johannes Müller <[email protected]>
Date:   Tue Mar 6 19:47:43 2018 +0000

    Fix `spawn` macro for call with receiver

commit 8e66045
Author: ven <[email protected]>
Date:   Tue Mar 6 16:24:56 2018 +0100

    Add an example of an operator delegation

commit 04755f9
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Mar 6 20:58:50 2018 -0300

    Run nightly at midnight

commit 3533460
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Mar 6 16:12:37 2018 -0300

    Update version branding

    Remove package iteration args
    Tidy up dist_docker args

commit 601d3c9
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Mar 6 11:47:54 2018 -0300

    Allow branding that does not match branch/tag

commit f0e2be1
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Mar 5 15:22:52 2018 -0300

    Add full workflows

    run dist only after test on all platforms run.
    split workflows for:
    1. test all platforms
    2. tagged releases
    3. nightly releases
    4. maintenance releases (specific branch build per commit)

commit 1b4261c
Author: Johannes Müller <[email protected]>
Date:   Mon Mar 5 20:49:21 2018 +0100

    Fix YAML core schema parses integer 0 (crystal-lang#5774)

    Parsing scalar `0` previously returned a string (`"0"`) instead of integer.
    This fixes it by adding a special case for `0`. Also adds a few specs for zero
    values (though binary, octal, hex were not broken).

commit 91cd833
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Mar 5 12:36:21 2018 -0300

    Add date as package iteration of nightly builds

commit 163c0cb
Author: Carlos Donderis <[email protected]>
Date:   Sun Feb 18 09:35:16 2018 +0900

    binding cmd-s and ctrl-s to runCode

commit 4cf8a7c
Author: Brian J. Cardiff <[email protected]>
Date:   Thu Mar 1 11:48:50 2018 -0300

    Update paths from distribution-scripts

commit 91a025f
Author: Olivier DOSSMANN <[email protected]>
Date:   Thu Jan 25 18:16:06 2018 +0100

    Missing ref to mkstemps in ARM

    Should fix crystal-lang#5264 for ARM architecture

commit 5a0e21f
Author: Julien Portalier <[email protected]>
Date:   Wed Feb 21 18:05:15 2018 +0100

    Refactor signal handlers (crystal-lang#5730)

    Breaking change:
    - Harness the SIGCHLD handling, which is required by Process#wait.
      Now we always handle SIGCHLD using SignalChildHandler. Trying to
      reset or ignore SIGCHLD will actually set the default handler,
      trying to trap SIGCHLD will wrap the custom handler instead.

    Fixes:
    - Synchronize some accesses using a Mutex and an Atomic to further
      enhance potential concurrency issues —probably impossible until
      parallelism is implemented.
    - No longer closes the file descriptor at exit, which prevents an
      unhandled exception when receiving a signal while the program is
      exiting.
    - Restore STDIN/OUT/ERR blocking state on exit.

    Simplify implementation:
    - Move private types (SignalHandler, SignalChildHandler) to the
      private Crystal namespace.
    - Rename SignalHandler to Crystal::Signal.
    - No more singleton classes.
    - Using a Channel directly instead of a Concurrent::Future.
    - Using macros under enum (it wasn't possible before).
    - Introduce LibC::SIG_DFL and LibC::SIG_IGN definitions.

commit 5911da0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Feb 21 01:57:22 2018 +0900

    Remove duplicated word 'the' (crystal-lang#5733)

commit 4f2e846
Author: Brandon McGinty-Carroll <[email protected]>
Date:   Wed Feb 14 23:18:44 2018 -0500

    Ensure that HTTP::WebSocket uses SNI, just like HTTP::Client.

commit 5d2fa25
Author: r00ster91 <[email protected]>
Date:   Tue Feb 13 17:37:43 2018 +0100

    Use double quotes in html_renderer.cr, begin_code (crystal-lang#5701)

    * Use double quotes in html_renderer.cr, begin_code

    It should use double quotes there instead of apostrophes. Because thats generating bad html code.
    For example this is what glitch.com (glitch is an online html editor) says to an markdown crystal code block:
    https://imgur.com/a/6nUKz
    And other sources say too that double quotes are better.

    * Update markdown_spec.cr

    * Update markdown_spec.cr

    * Update markdown_spec.cr

commit b30a9cc
Author: Johannes Müller <[email protected]>
Date:   Sat Feb 10 14:33:02 2018 +0100

    Fix YAML::Core parse float with leading 0 or . (crystal-lang#5699)

    Also adds some specs for parsing float values

commit ee271d8
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Fri Feb 2 20:51:26 2018 +0100

    Support BigDecimal comparison with and initialization from BigRational

commit 3086419
Author: asterite <[email protected]>
Date:   Thu Feb 8 09:00:42 2018 -0300

    Fix incorrect type for lib extern static array

commit ab8ed5c
Author: Ary Borenszweig <[email protected]>
Date:   Wed Feb 7 12:06:56 2018 -0300

    Fix custom array/hash-like literals in nested modules (crystal-lang#5685)

commit 19981d3
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Feb 7 03:35:37 2018 -0300

    Shorten jobs names

commit 66600d6
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Feb 6 14:05:47 2018 -0300

    Parametrise previous crystal release, package iteration and docker

commit e3c3f7f
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Feb 6 11:07:29 2018 -0300

    DRY checkout of distribution-scripts. Use docker executor where possible

commit 151c0da
Author: Johannes Müller <[email protected]>
Date:   Mon Feb 5 23:09:25 2018 +0100

    Add documentation for String#inspect and #dump methods and minor code improvements (crystal-lang#5682)

commit 80a1c4a
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Feb 5 11:52:44 2018 -0300

    Split build/publish docker targets. Build docs from docker image.

commit 47b45da
Author: Julien Portalier <[email protected]>
Date:   Sat Feb 3 17:46:43 2018 +0100

    Fix: uninitialized sa_mask value in sigfault ext

commit 322d1c4
Author: Johannes Müller <[email protected]>
Date:   Fri Feb 2 21:51:31 2018 +0100

    Fix: string/symbol array literals nesting and escaping (crystal-lang#5667)

    i# ase enter the commit message for your changes. Lines starting

commit 0491891
Author: Johannes Müller <[email protected]>
Date:   Fri Feb 2 18:57:39 2018 +0100

    Fix String#dump for UTF-8 charachters > \uFFFF (crystal-lang#5668)

commit aa6521f
Author: Ary Borenszweig <[email protected]>
Date:   Fri Feb 2 09:46:19 2018 -0300

    Fix ASTNode#raise macro method (crystal-lang#5670)

commit d5e952f
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Jan 30 02:45:46 2018 -0300

    Add docker image as nightly artifact

commit a4ed534
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Jan 29 16:16:32 2018 -0300

    Remove docs publishing from travis

    Make travis build ci branches

commit ccdf9c1
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Jan 29 16:12:33 2018 -0300

    Add docs as nightly artifacts

commit 85d895f
Author: Brian J. Cardiff <[email protected]>
Date:   Thu Jan 25 01:07:05 2018 -0300

    Collect dist packages of jobs as artifacts

commit bfc9f79
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Jan 24 14:13:36 2018 -0300

    Add darwin nightly artifacts

commit 5c06ff9
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Jan 23 11:59:59 2018 -0300

    Check if circle can handle release optimized builds

commit 9538efb
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Jan 22 14:18:50 2018 -0300

    Test nightly build

commit 1a1124b
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 21:16:50 2018 -0300

    Add branch and tag filter to ci

    Build master, release and ci branches
    Build tags

commit d08d7c9
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 20:12:51 2018 -0300

    Add linux builds for 64 and 32 bits

commit 6b655af
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 20:08:55 2018 -0300

    Enable ipv6 for docker in linux build

    Move setup from .travis.yml to /bin/ci

commit 6418ee4
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 20:06:58 2018 -0300

    Set TZ for osx builds

commit 8e621ad
Author: Brian J. Cardiff <[email protected]>
Date:   Fri Jan 19 15:45:35 2018 -0300

    Migrate to Circle 2.0

commit 995d3f9
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Mon Jan 29 22:51:07 2018 +0900

    Fix indentation after comment inside 'when'

    Fix crystal-lang#5654

commit bfd7c99
Author: asterite <[email protected]>
Date:   Fri Jan 26 20:25:45 2018 -0300

    Class: add comparison operators

commit ffda890
Author: Ary Borenszweig <[email protected]>
Date:   Sat Jan 27 12:54:15 2018 -0300

    Spec: implement `be_a` and `expect_raises` without macros (crystal-lang#5646)

    * Spec: implement `be_a` and `expect_raises` without macros

    * Simplify `expect_raises` code by adding an `else` clause

    * Remove redundant `begin` in `expect_raises`

    * More refactors in `expect_raises`

commit 1445529
Author: Matias Garcia Isaia <[email protected]>
Date:   Thu Jan 25 18:21:03 2018 -0300

    Version 0.24.2

commit 558a32a
Author: Juan Wajnerman <[email protected]>
Date:   Wed Jan 17 20:50:35 2018 -0300

    Bug: default_verify_param are inverted in SSL::Context::Client and SSL::Context::Server

    Fixes crystal-lang#5266

    x509 certificates have a purpose associated to them. Clients should
    verify that the server's certificate is intended to be used in a
    server, and servers should check the client's certificate is
    intended to be used for clients.

    Crystal was mistakingly checking those mixed up.

    See https://wiki.openssl.org/index.php?title=Manual:X509(1)&oldid=1797#CERTIFICATE_EXTENSIONS
    See https://tools.ietf.org/html/rfc5280#section-4.2.1.3

commit 7f05801
Author: Benoit de Chezelles <[email protected]>
Date:   Fri Dec 22 12:42:04 2017 +0100

    Add formatter spec for uppercased fun call

commit b793876
Author: Benoit de Chezelles <[email protected]>
Date:   Thu Dec 21 23:34:25 2017 +0100

    Fix formatting of lib's fun starting with uppercase letter

commit 0f9af00
Author: Martyn Jago <[email protected]>
Date:   Thu Jan 25 13:46:05 2018 +0000

    Raise ArgumentError if BigFloat initialized with invalid string (crystal-lang#5638)

    * Raise ArgumentError if BigFloat initialized with invalid string

    Raise ArgumentError if BigFloat.new() initialized with string
    that doesn't denote a valid float

    * fixup! Raise ArgumentError if BigFloat initialized with invalid string

commit 302ff6c
Author: RX14 <[email protected]>
Date:   Sat Jan 20 23:41:24 2018 +0000

    Correctly stub out Exception#backtrace?

commit 0ebc173
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Jan 5 03:12:05 2018 +0900

    Add ASTNode#single_expression and refactor with using it (crystal-lang#5513)

    * Add ASTNode#single_expression and refactor with using it

    Fixed crystal-lang#5482
    Fixed crystal-lang#5511

    But this commit contains no spec for crystal-lang#5511 because I don't know where to
    place such a spec.

    * Add spec for crystal-lang#5511

    Thank you @asterite!
    See: crystal-lang#5513 (comment)

commit b05ad8d
Author: Johannes Müller <[email protected]>
Date:   Tue Jan 23 11:25:37 2018 +0100

    Fix offset handling of String#rindex with Regex (crystal-lang#5594)

    * Fix offset handling of String#rindex with Regex

    This also addas a few specs to ensure all variants of #rindex treat offset similarly.

    * Fix negative offset and remove substring

commit ff02d2d
Author: asterite <[email protected]>
Date:   Fri Jan 19 16:44:07 2018 -0300

    HTTP::Client: execute `before_request`callbacks right before writing the request

commit fd55e8d
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Mon Jan 22 10:23:06 2018 +0900

    Remove TODO about duplicated named group Regex

commit e5da7d3
Author: Chris Hobbs <[email protected]>
Date:   Sun Jan 21 16:12:47 2018 +0000

    Add Int#bits_set? method (crystal-lang#5619)

commit e83e894
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sun Jan 21 01:24:33 2018 +0100

    Add additional parameters for Logger#new

commit 4c2f6f6
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Jan 20 23:37:48 2018 +0100

    Remove TODOs related to Crystal 0.22 (crystal-lang#5546)

commit 8bc3cee
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Jan 20 23:37:07 2018 +0100

    Add #clear method to ArrayLiteral/HashLiteral (crystal-lang#5265)

commit 6c2297b
Author: Julien Portalier <[email protected]>
Date:   Sat Jan 20 14:39:19 2018 +0100

    Fix bcrypt hard limit on passwords to 71 bytes (crystal-lang#5356)

    Despite the original bcrypt paper claiming passwords must be a
    maximum of 56 bytes, the implementations are compatible to up to 72
    bytes.

    Since increasing the limit doesn't break compatibility, but other
    implementations allow as many as 72 bytes, let's increase the
    arbitrary limitation of 51 characters (which was wrong anyway) to 72
    bytes, minus the leading null byte, that is a password of 71 bytes.

commit ddbcf6c
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Jan 20 12:38:58 2018 +0100

    BigDecimal.new(str : String) handles scientific notation (crystal-lang#5582)

    * BigDecimal.new(str : String) handles scientific notation

    * fixup! by @RX14

    * Spec with cases suggested by @RX14

    * Fix failing spec

    * Fixed another failing case

commit 3515968
Author: Johannes Müller <[email protected]>
Date:   Sat Jan 20 12:37:08 2018 +0100

    Remove unneeded parenthesis from calls in macro expression (crystal-lang#5493)

    * Remove parenthesis from macro calls without arguments: not needed anymore as of 0.24.0

    * Resolve TODO in urandom

commit a288123
Author: Johannes Müller <[email protected]>
Date:   Fri Jan 19 01:37:02 2018 +0100

    Fix HTTP::StaticFileHandler to properly parse HTTP date (crystal-lang#5607)

commit a29e21b
Author: Damian Hamill <[email protected]>
Date:   Thu Jan 18 20:36:36 2018 +0700

    return correct content type for SVG images (crystal-lang#5605)

commit 1210596
Author: Benny Bach <[email protected]>
Date:   Thu Jan 18 14:21:41 2018 +0100

    Add cache control headers to http static file handler + a few more mi… (crystal-lang#2470)

    * Add cache control headers to http static file handler + a few more mime types

    * Remove Cache-Control header from static file handler

    * Undo extra mime types in static file handler

    * Fix code review issues:

    * use HTTP.rfc3339_date formatter
    * parse time value from If-Modified-Since header
    * compare header and mtime as older or equals

    * use `headers["If-Modified-Since"]?`

commit 3b50388
Author: Juan Wajnerman <[email protected]>
Date:   Thu Jan 18 10:14:32 2018 -0300

    OpenSSL: Hide errors when either libcrypto or libssl are not found by pkg-config (crystal-lang#5603)

commit f3168b6
Author: Johannes Müller <[email protected]>
Date:   Thu Jan 18 14:09:46 2018 +0100

    Add time zones support (crystal-lang#5324)

    * Add cache for last zone to Time::Location#lookup

    * Implement Time::Location including timezone data loader

    Remove representation of floating time from `Time` (formerly expressed
    as `Time::Kind::Unspecified`).

    Floating time should not be represented as an instance of `Time` to avoid undefined operations through type safety (see crystal-lang#5332).
    Breaking changes:
    * Calls to `Time.new` and `Time.now` are now in the local time zone by
      default.
    * `Time.parse`, `Time::Format.new` and `Time::Format.parse` don't specify a default location.
      If none is included in the time format and no default argument is provided, the parse method wil raise an exception because there is no way to know how such a value should be represented as an instance of `Time`.
      Applications expecting time values without time zone should provide default location to apply in such a case.

    * Implement custom zip file reader to remove depenencies

    * Add location cache for `Location.load`

    * Rename `Location.local` to `.load_local` and make `local` a class property

    * Fix env ZONEINFO

    * Fix example code string representation of local Time instance

    * Time zone implementation for win32

    This adds basic support for using the new time zone model on windows.
    * `Crystal::System::Time.zone_sources` returns an empty array because
      Windows does not include a copy of the tz database.
    * `Crystal::System::Time.load_localtime` creates a local time zone
      `Time::Location` based on data provided by `GetTimeZoneInformation`.
    * A mapping from Windows time zone names to identifiers used by the
      IANA timezone database is included as well as an automated generator
      for that file.

    * Add stubs for methods with file acces

    Trying to load a location from a file will fail because `File` is not
    yet ported to windows.

commit 6a574f2
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Jan 18 10:47:54 2018 +0900

    Fix parsing an empty heredoc

commit 84288b7
Author: Ary Borenszweig <[email protected]>
Date:   Wed Jan 17 16:08:54 2018 -0300

    Compiler: add more locations (crystal-lang#5597)

commit bba4985
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Jan 18 04:00:01 2018 +0900

    Use join instead of each_with_index and `if i > 0` (crystal-lang#5599)

    Just a refactoring.

commit 8eb8554
Author: Ary Borenszweig <[email protected]>
Date:   Wed Jan 17 15:58:57 2018 -0300

    Correct implementation of heredoc (crystal-lang#5578)

    Now you can specify multiple heredocs in a single line, just like in Ruby.

commit 295ddc3
Author: Johannes Müller <[email protected]>
Date:   Sat Jan 13 12:49:02 2018 +0100

    Add overload to String.from_utf16 with pointer

commit 244da57
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Mon Jan 15 18:29:07 2018 +0100

    Allow leading + in number strings

commit 80cbe66
Author: asterite <[email protected]>
Date:   Sun Jan 14 10:46:11 2018 -0300

    Compiler: emit `.o` file to a temporary location and then atomically rename it

commit 597ccac
Author: Ary Borenszweig <[email protected]>
Date:   Mon Oct 23 21:15:37 2017 -0300

    Implement JSON::Any and YAML::Any without recursive aliases

commit b4fed51
Author: Guilherme Bernal <[email protected]>
Date:   Sun Jan 14 15:17:42 2018 -0300

    Fix strdup for LibXML: undefined behavior

    The last argument of xmlGcMemSetup is a GC-aware implementation of strdup. It should return a valid C-string with the null-character.

commit c7cc787
Author: Jamie Gaskins <[email protected]>
Date:   Sun Jan 14 06:52:32 2018 -0500

    Pretty-print objects in playground inspector (crystal-lang#4601)

commit d7c9551
Author: RX14 <[email protected]>
Date:   Fri Jan 12 23:32:10 2018 +0000

    Rename win_nt.cr to winnt.cr

    The header file is called winnt.h, the win_nt.cr was an error and should be
    merged with winnt.cr.

commit d294dd1
Author: RX14 <[email protected]>
Date:   Fri Jan 12 23:28:12 2018 +0000

    Reenable Crystal::Hasher seed randomisation on win32

commit 323613b
Author: RX14 <[email protected]>
Date:   Fri Jan 12 23:20:27 2018 +0000

    Ensure String#to_utf16 result has a null terminator

commit 48a1130
Author: Chris Hobbs <[email protected]>
Date:   Sat Jan 13 00:53:17 2018 +0000

    Simplify Crystal::System interface by adding File.stat? and lstat? (crystal-lang#5553)

    By providing these methods we can make the implementation of File.empty? and
    File.file? platform-unspecific. This makes the interface to
    Crystal::System::File smaller and cleaner.

commit 77de91f
Author: Lachlan Dowding <[email protected]>
Date:   Thu Jan 11 08:13:16 2018 +1000

    Fix Iterator spec typo: integreation -> integration

commit bd42727
Author: Johannes Müller <[email protected]>
Date:   Thu Jan 11 19:32:28 2018 +0100

    Reimplement Dir.glob  (crystal-lang#5179)

commit f16e63a
Author: Mark <[email protected]>
Date:   Thu Jan 11 10:28:54 2018 -0800

    Change Hash#key to Hash#key_for (crystal-lang#5444)

    * Change Hash#key to Hash#key_for

    * Update Spec description for Hash#key_for and Hash#key_for?

commit f59a349
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Jan 12 03:24:04 2018 +0900

    Fix to keep paren information for `to_s` on clone (crystal-lang#5454)

    Fixed crystal-lang#5415

    Added keeping information for `to_s` on clone check in `compiler/parser/to_s_spec.cr`.
    I think this property should be kept by all `ASTNode#clone` implementation.

commit 5eecd57
Author: Julien Portalier <[email protected]>
Date:   Wed Jan 10 17:38:18 2018 +0100

    Fix: decode DWARF line sequences with single program entry (crystal-lang#5565)

    Debug::DWARF::LineNumbers would skip the program statement when it
    contained a single entry, because of a wrong assumption of the
    sequence unit_length entry, which doesn't account for the unit
    length space in the standard, and was overlooked in checking whether
    the sequence had any program statement, or not.

commit 048f77e
Author: Julien Portalier <[email protected]>
Date:   Wed Jan 10 17:38:18 2018 +0100

    Fix: decode DWARF line sequences with single program entry (crystal-lang#5565)

    Debug::DWARF::LineNumbers would skip the program statement when it
    contained a single entry, because of a wrong assumption of the
    sequence unit_length entry, which doesn't account for the unit
    length space in the standard, and was overlooked in checking whether
    the sequence had any program statement, or not.

commit 972f2b3
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Dec 21 20:16:08 2017 +0900

    Fix to work formatting `foo.[bar] = baz`

    Fixed crystal-lang#5416

commit 157eca0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Sun Nov 5 23:30:20 2017 +0900

    Clone macro default argument before macro expansion

commit a3ca37e
Author: Michael Petö <[email protected]>
Date:   Wed Jan 10 14:47:44 2018 +0100

    Fix Time::Span multiply and divide (crystal-lang#5563)

commit 5f1440d
Author: Ary Borenszweig <[email protected]>
Date:   Tue Jan 9 17:25:51 2018 -0300

    Formatter: fix bug regarding backslash (crystal-lang#5194)

commit 77db65a
Author: Peter Leitzen <[email protected]>
Date:   Tue Jan 9 13:39:59 2018 +0100

    Fix spec name for parsing BigDecimal from floats (crystal-lang#5561)

    Follow-up to crystal-lang#5525

commit d8343a6
Author: Luke Rodgers <[email protected]>
Date:   Mon Jan 8 19:29:06 2018 -0500

    Define `new(JSON::PullParser)` on BigDecimal so it can be deserialized (crystal-lang#5525)

commit d023138
Author: Benoit de Chezelles <[email protected]>
Date:   Mon Jan 8 01:25:21 2018 +0100

    Allow to init a crystal app/lib in an empty directory (crystal-lang#4691)

commit f7a931c
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Mon Jan 8 01:19:37 2018 +0100

    Extend BigDecimal with a few things (crystal-lang#5390)

commit 3cb4b94
Author: Ary Borenszweig <[email protected]>
Date:   Sat Jan 6 15:17:23 2018 -0300

    CLI: remove deps command (crystal-lang#5544)

commit 525ea49
Author: Ary Borenszweig <[email protected]>
Date:   Sat Jan 6 11:04:16 2018 -0300

    Compiler: remove extra `shell` argument when executing macro run (crystal-lang#5543)

commit 161c17a
Author: Noriyo Akita <[email protected]>
Date:   Sat Jan 6 21:34:06 2018 +0900

    Fix typo mutli to multi (crystal-lang#5547)

    * tools/formatter: Fix typo

    mutli -> multi

    * Fix typo in comment

    Mutliple -> Multiple

commit e1680dd
Author: asterite <[email protected]>
Date:   Fri Jan 5 14:07:13 2018 -0300

    Include UUID in docs

commit a06bf0f
Author: asterite <[email protected]>
Date:   Fri Jan 5 14:07:13 2018 -0300

    Include UUID in docs

commit d3fed8b
Author: Johannes Müller <[email protected]>
Date:   Tue Jan 2 14:32:06 2018 +0100

    Rename skip() macro method to skip_file() in docs (crystal-lang#5488)

commit 4f56a57
Author: Brian J. Cardiff <[email protected]>
Date:   Fri Dec 29 20:38:36 2017 -0300

    Update gitignore template (crystal-lang#5480)

    * Fix docs directory in gitignore.ecr (renamed in crystal-lang#4937)

commit 12cc7f2
Author: Brian J. Cardiff <[email protected]>
Date:   Thu Dec 28 02:51:47 2017 -0300

    Fix missing Dir#each to be an Enumerable (crystal-lang#5458)

commit 4313e86
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Dec 26 21:59:22 2017 -0300

    Update bin/ci to use LIBRARY_PATH from 0.24.1 (crystal-lang#5461)

commit 68c0098
Author: Dominic Jodoin <[email protected]>
Date:   Thu Dec 21 12:40:38 2017 -0500

    Enable IPv6 in Docker (crystal-lang#5429)
chris-huxtable added a commit to chris-huxtable/crystal that referenced this pull request Apr 7, 2018
commit 7d64756
Author: Florin Lipan <[email protected]>
Date:   Fri Apr 6 19:56:50 2018 +0300

    Re-raise exceptions in parallel macro (crystal-lang#5726)

commit d536c9c
Author: William Woodruff <[email protected]>
Date:   Fri Apr 6 12:54:03 2018 -0400

    File: Add `mode` param to `File.write` (crystal-lang#5754)

    This allows `File.write` to optionally append to files (instead of
    truncating them).

commit 680d3e0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Apr 6 08:24:25 2018 +0900

    Format: fix formatting call having trailing comma with block (crystal-lang#5855)

    Fix crystal-lang#5853

commit f22d689
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Apr 6 08:18:23 2018 +0900

    Refactor Colorize#surround (crystal-lang#4196)

    * Refactor Colorize#surround

    This is one of the separations of crystal-lang#3925.

    Remove `surround` and rename `push` to `surround`, now `push` is
    derecated.
    (This reason is dscribed in crystal-lang#3925 (comment))

    * Use #surround instead of #push

    * Apply 'crystal tool format'

    * Remove Colorize#push

commit 12488c2
Author: Benoit de Chezelles <[email protected]>
Date:   Thu Apr 5 07:49:51 2018 -0700

    Ensure cleanup tempfile after some specs (crystal-lang#5810)

    * Ensure cleanup tempfile after some specs

    * Fix compiler spec

commit ef85244
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Apr 5 20:59:33 2018 +0900

    Format: fix formatter bug on nesting begin/end

commit 8c737a0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Apr 5 22:54:20 2018 +0900

    Remove duplicated indefinite articles 'a a' in char.cr doc (crystal-lang#5894)

    * Fix duplicated articles 'a a' in char.cr doc

    * Shorten sentence

    crystal-lang#5894 (comment)

commit 73989e8
Author: maiha <[email protected]>
Date:   Thu Apr 5 22:43:43 2018 +0900

    fix example codes (2018-04) (crystal-lang#5912)

commit b62c4e1
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sun Apr 1 16:09:29 2018 +0200

    Refactor out variable name

commit c17ce2d
Author: Sankha Narayan Guria <[email protected]>
Date:   Thu Apr 5 01:58:11 2018 -0400

    UUID implements inspect (crystal-lang#5574)

commit 106d44d
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 23:01:43 2018 +0900

    MatchData: correct sample code for duplicated named capture

    Ref: crystal-lang#5912 (comment)

commit 011e688
Author: Paul Smith <[email protected]>
Date:   Wed Apr 4 13:37:41 2018 -0400

    Small typo fix in bash completion

commit b5a3a65
Author: Johannes Müller <[email protected]>
Date:   Wed Apr 4 15:59:33 2018 +0200

    Fix File.join with empty path component (crystal-lang#5915)

commit 9662abe
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 16:42:42 2018 +0900

    Fix `String#tr` 1 byte `from` optimization bug

    Ref: crystal-lang#5912 (comment)

    `"aabbcc".tr("a", "xyz")` yields `"xyzxyzbbcc"` currently.
    Of course it is unintentional behavior, in Ruby it yields `"xxbbcc"` and
    on shell `echo aabbcc | tr a xyz` shows `xxbbcc`.

commit ec423eb
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 02:38:21 2018 +0900

    Fix crystal-lang#5907 formatter bug (crystal-lang#5909)

    * Fix crystal-lang#5907 formatter bug

    * Apply new formatter

commit 5056859
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Apr 4 02:33:07 2018 +0900

    Pass an unhandled exception to at_exit block as second argument (crystal-lang#5906)

    * Pass an unhandled exception to at_exit block as second argument

    Follow up crystal-lang#1921

    It is better in some ways:

      - it does not need a new exception like `SystemExit`.
      - it does not break compatibility in most cases because block fill up lacking arguments.

    * Add documentation for at_exit block arguments

    * Update `at_exit` block arguments description

    crystal-lang#5906 (comment)
    Thank you @jhass.

commit 82caaf0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 23:18:01 2018 +0900

    Semantic: don't guess ivar type from argument after assigned (crystal-lang#5166)

commit bb5bcd2
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 21:00:27 2018 +0900

    Colorize: abstract colors and support 8bit and true color (crystal-lang#5902)

    * Colorize: abstract colors and support 8bit and true color

    Closes crystal-lang#5900

    * Color#fore and #back take io to avoid memory allocation

    * Use character literal instead of 1 length string

commit 7eae5aa
Author: Benoit de Chezelles <[email protected]>
Date:   Mon Apr 2 16:43:52 2018 -0700

    Use LibCrystalMain.__crystal_main directly (crystal-lang#5899)

commit 60f675c
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 08:42:03 2018 +0900

    Format: fix indentation after backslash newline (crystal-lang#5901)

    crystal-lang#5892 (comment)

commit 4d2ad83
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 08:21:06 2018 +0900

    Prevent invoking `method_added` macro hook recursively (crystal-lang#5159)

    Fixed crystal-lang#5066

commit e17823f
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Tue Apr 3 07:56:52 2018 +0900

    Format: fix indentation in collection with comment after beginning delimiter (crystal-lang#5893)

commit 49d722c
Author: Chris Hobbs <[email protected]>
Date:   Sat Mar 31 19:30:54 2018 +0100

    Print exception cause when inspecting with backtrace (crystal-lang#5833)

commit 945557b
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Mar 31 20:30:15 2018 +0200

    Use Char for single char strings (crystal-lang#5882)

commit 4532389
Author: r00ster91 <[email protected]>
Date:   Sat Mar 31 15:35:08 2018 +0200

    Fix Random example (crystal-lang#5728)

commit 5cd78fa
Author: Benoit de Chezelles <[email protected]>
Date:   Fri Mar 30 15:29:30 2018 -0700

    Allow a path to declare a constant (crystal-lang#5883)

    * Allow a path to declare a constant

    * Add spec for type keeping when creating a constant using a Path

commit f33a910
Author: Carl Hörberg <[email protected]>
Date:   Fri Mar 30 20:40:31 2018 +0200

    Enqueue senders in Channel#close (crystal-lang#5880)

    Fixes crystal-lang#5875

commit 0424b22
Author: r00ster91 <[email protected]>
Date:   Thu Mar 29 16:17:20 2018 +0200

    Fix HEREDOC error message grammar (crystal-lang#5887)

    * Fix HEREDOC error message grammar

    * Update parser_spec.cr

commit 4927ecc
Author: Benoit de Chezelles <[email protected]>
Date:   Thu Mar 29 05:06:03 2018 -0700

    Fix typo (crystal-lang#5884)

commit c2efaff
Author: Will <[email protected]>
Date:   Thu Mar 29 08:05:05 2018 -0400

    Update docs for Enum (crystal-lang#5885)

commit 0970ee9
Author: Benoit de Chezelles <[email protected]>
Date:   Wed Mar 28 08:04:10 2018 -0700

    Fix exit in at_exit handlers (crystal-lang#5413)

    * Fix exit/raise in at_exit handlers

    * Add specs for exit & at_exit

    * Refactor handler loop

    * Disallow nested at_exit handlers

    * Print an unhandled exception after all at_exit handlers

    * Use try for the unhandled exception handler

    * Move the proc creation inside AtExitHandlers

    * Fix doc

    * Use a separate list for exceptions registered to print after at_exit handlers

    * Don't early return, always check for exceptions

    * Don't use a list for unhandled exceptions, store only one

commit 400bd0e
Author: Mark <[email protected]>
Date:   Wed Mar 28 05:44:58 2018 -0700

    Documentation: Add API docs for Array sorting methods (crystal-lang#5637)

    * Documentation: Add API docs for Array sorting methods
    - Array#sort(&block : T, T -> Int32)
    - Array#sort!(&block : T, T -> Int32)
    - Array#sort_by(&block : T -> _)
    - Array#sort_by!(&block : T -> _)

    * Documentation: Add API docs for Array#swap

    * Documentation: Update based on code review
    - Add explicit return types for sorting methods
    - Update descriptions based on code review
    - Format code using crystal's format tool

    * Documentation: Remove comments about optional blocks from Array#sort! and Array#sort

    * Documentation: Update descriptions for Array sorting methods

commit bc1c7a9
Author: Johannes Müller <[email protected]>
Date:   Tue Mar 27 23:05:30 2018 +0200

    Fix typo in IO doc

commit 9f28c77
Author: Heaven31415 <[email protected]>
Date:   Tue Mar 27 15:22:39 2018 +0200

    Make #read doc more clear in io.cr (crystal-lang#5873)

commit 9980a1f
Author: Jakub Jirutka <[email protected]>
Date:   Sun Mar 25 00:43:00 2018 +0100

    Add support for target aarch64-linux-musl

commit 9adbb92
Author: Jakub Jirutka <[email protected]>
Date:   Sat Mar 24 20:24:18 2018 +0100

    Makefile: Fix redirect to stderr to be more portable (crystal-lang#5859)

    `>/dev/stderr` does not work in some environments. Moreover, all POSIX
    compliant shells supports standard `>&2` for redirect stdout to stderr.

commit dedc726
Author: Benoit de Chezelles <[email protected]>
Date:   Fri Mar 23 06:57:01 2018 -0700

    Fix parser block arg newline (crystal-lang#5737)

    * parser: Add spec for method def block argument with new lines

    * parser: Handle space or newline after def's block arg's type

commit 2d93603
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Mar 21 06:49:50 2018 +0900

    Regex: fix invalid #inspect result against %r{\/} (crystal-lang#5841)

    `p %r{\/}` shows `/\\//`. It is invalid regexp.

commit 502ef40
Author: Johannes Müller <[email protected]>
Date:   Mon Mar 19 14:25:25 2018 +0100

    Fix URI encoding in StaticFileHandler#redirect_to (crystal-lang#5628)

commit 5d5c9ac
Author: Lachlan Dowding <[email protected]>
Date:   Mon Mar 19 00:46:24 2018 +1000

    Add JSON support to UUID (crystal-lang#5551)

commit c0cdbc2
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sun Mar 18 01:50:28 2018 +0100

    Use crystallang/crystal:nightly as docker nightly tag (crystal-lang#5837)

commit 863f301
Author: Anton Maminov <[email protected]>
Date:   Tue Mar 13 14:35:00 2018 +0200

    add HTTP OPTIONS method to HTTP::Client

commit 52fa3b2
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Sat Jan 27 22:48:08 2018 +0900

    Don't use heredoc inside interpolation

    heredoc inside interpolation is buggy and it is unuseful.
    It is a bit hard to fix this, so I'd like to forbid.

commit 077e0da
Author: Johannes Müller <[email protected]>
Date:   Tue Mar 13 20:10:11 2018 +0100

    Add boundary check for seconds in Time#initialize (crystal-lang#5786)

    Previously, `Time#add_span` did not handle times at the min or max range with positive or
    negative offsets correctly because `@seconds` can legitimately be `< 0` or `> MAX_SECONDS`
    when the offset is taken into account.
    The boundary check was moved to the constructor to prevent manually
    creating an invalid date.

commit dd0ed8c
Author: Johannes Müller <[email protected]>
Date:   Mon Mar 12 23:11:01 2018 +0100

    CHANGELOG: Change release dates to use ISO format

    Changes dates in DD-MM-YYYY to ISO format YYYY-MM-DD

commit 50aacaa
Author: asterite <[email protected]>
Date:   Mon Feb 5 09:22:35 2018 -0300

    Macro methods: set type of empty array literal

commit ed0aad8
Author: Benoit de Chezelles <[email protected]>
Date:   Sun Mar 11 09:36:14 2018 -0700

    Fix internal doc (typo & old invalid comment) (crystal-lang#5806)

    * Fix typo

    * Remove BNF for old def declaration without parentheses

commit 10fb1ff
Author: Benoit de Chezelles <[email protected]>
Date:   Sun Mar 11 05:14:06 2018 -0700

    Use the same llvm's version as crystal-lang package for CI's darwin build (crystal-lang#5804)

    * Use llvm5 for darwin build in CI

    * Force binaries of llvm in PATH

    * DRY for the llvm's version crystal-lang's depends on

    * Install jq

commit e8916bc
Author: Benoit de Chezelles <[email protected]>
Date:   Sat Mar 10 16:16:20 2018 -0800

    Restore STDIN|OUT|ERR blocking state on exit (crystal-lang#5802)

commit 92c3d42
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Mar 10 08:36:50 2018 -0300

    Update previous crystal release & docker images for ci to 0.24.2 (crystal-lang#5796)

    * Use crystallang/crystal-*-build docker images in ci

    * Update previous crystal to 0.24.2

commit 34b1101
Author: Johannes Müller <[email protected]>
Date:   Sat Mar 10 00:37:05 2018 +0100

    Add highlight to code tag in generated API docs (crystal-lang#5795)

commit 6696c88
Author: Donovan Glover <[email protected]>
Date:   Fri Mar 9 18:36:43 2018 -0500

    Fix unexpected h1 in CHANGELOG.md (crystal-lang#5576)

commit 731e9c0
Merge: 4f9ed8d 4ef9167
Author: Brian J. Cardiff <[email protected]>
Date:   Fri Mar 9 17:35:26 2018 -0300

    Merge changes from 0.24.2 with master

commit 4ef9167
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Sat Mar 10 00:40:35 2018 +0900

    Improve String#pretty_print output by splitting newline (crystal-lang#5750)

    Like Ruby's `pp`, String#pretty_print splits its content by newline and
    shows each lines with joining `+` operator.

    I believe this improves readability against large multiline string on `p`.

commit 5a189cb
Author: Cody Byrnes <[email protected]>
Date:   Fri Mar 9 06:09:41 2018 -0800

    Fix: File.extname edge case for dot in path with no extension (crystal-lang#5790)

commit f0bd6b6
Author: r00ster91 <[email protected]>
Date:   Fri Mar 9 00:48:03 2018 +0100

    Update readline.cr (crystal-lang#5791)

commit 224d489
Author: Johannes Müller <[email protected]>
Date:   Fri Mar 9 00:36:23 2018 +0100

    Return early in Time#add_span if arguments are zero (crystal-lang#5787)

commit 9d2dfbb
Author: Konstantin Makarchev <[email protected]>
Date:   Thu Mar 8 03:34:24 2018 +0300

    add *.dwarf to auto generated .gitignore

commit 4f9ed8d
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 23:55:26 2018 -0300

    Update changelog

commit 161bea6
Merge: 1445529 2dd3a87
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 20:20:20 2018 -0300

    Merge branch 'ci/nightly' into release/0.24

commit 2dd3a87
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 20:17:52 2018 -0300

    Run nightly on master

commit 3ad85aa
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Mar 7 18:49:10 2018 -0300

    Use SHA1 to use fixed distribution-scripts version

commit 713fa33
Author: Johannes Müller <[email protected]>
Date:   Tue Mar 6 19:47:43 2018 +0000

    Fix `spawn` macro for call with receiver

commit 8e66045
Author: ven <[email protected]>
Date:   Tue Mar 6 16:24:56 2018 +0100

    Add an example of an operator delegation

commit 04755f9
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Mar 6 20:58:50 2018 -0300

    Run nightly at midnight

commit 3533460
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Mar 6 16:12:37 2018 -0300

    Update version branding

    Remove package iteration args
    Tidy up dist_docker args

commit 601d3c9
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Mar 6 11:47:54 2018 -0300

    Allow branding that does not match branch/tag

commit f0e2be1
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Mar 5 15:22:52 2018 -0300

    Add full workflows

    run dist only after test on all platforms run.
    split workflows for:
    1. test all platforms
    2. tagged releases
    3. nightly releases
    4. maintenance releases (specific branch build per commit)

commit 1b4261c
Author: Johannes Müller <[email protected]>
Date:   Mon Mar 5 20:49:21 2018 +0100

    Fix YAML core schema parses integer 0 (crystal-lang#5774)

    Parsing scalar `0` previously returned a string (`"0"`) instead of integer.
    This fixes it by adding a special case for `0`. Also adds a few specs for zero
    values (though binary, octal, hex were not broken).

commit 91cd833
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Mar 5 12:36:21 2018 -0300

    Add date as package iteration of nightly builds

commit 163c0cb
Author: Carlos Donderis <[email protected]>
Date:   Sun Feb 18 09:35:16 2018 +0900

    binding cmd-s and ctrl-s to runCode

commit 4cf8a7c
Author: Brian J. Cardiff <[email protected]>
Date:   Thu Mar 1 11:48:50 2018 -0300

    Update paths from distribution-scripts

commit 91a025f
Author: Olivier DOSSMANN <[email protected]>
Date:   Thu Jan 25 18:16:06 2018 +0100

    Missing ref to mkstemps in ARM

    Should fix crystal-lang#5264 for ARM architecture

commit 5a0e21f
Author: Julien Portalier <[email protected]>
Date:   Wed Feb 21 18:05:15 2018 +0100

    Refactor signal handlers (crystal-lang#5730)

    Breaking change:
    - Harness the SIGCHLD handling, which is required by Process#wait.
      Now we always handle SIGCHLD using SignalChildHandler. Trying to
      reset or ignore SIGCHLD will actually set the default handler,
      trying to trap SIGCHLD will wrap the custom handler instead.

    Fixes:
    - Synchronize some accesses using a Mutex and an Atomic to further
      enhance potential concurrency issues —probably impossible until
      parallelism is implemented.
    - No longer closes the file descriptor at exit, which prevents an
      unhandled exception when receiving a signal while the program is
      exiting.
    - Restore STDIN/OUT/ERR blocking state on exit.

    Simplify implementation:
    - Move private types (SignalHandler, SignalChildHandler) to the
      private Crystal namespace.
    - Rename SignalHandler to Crystal::Signal.
    - No more singleton classes.
    - Using a Channel directly instead of a Concurrent::Future.
    - Using macros under enum (it wasn't possible before).
    - Introduce LibC::SIG_DFL and LibC::SIG_IGN definitions.

commit 5911da0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Wed Feb 21 01:57:22 2018 +0900

    Remove duplicated word 'the' (crystal-lang#5733)

commit 4f2e846
Author: Brandon McGinty-Carroll <[email protected]>
Date:   Wed Feb 14 23:18:44 2018 -0500

    Ensure that HTTP::WebSocket uses SNI, just like HTTP::Client.

commit 5d2fa25
Author: r00ster91 <[email protected]>
Date:   Tue Feb 13 17:37:43 2018 +0100

    Use double quotes in html_renderer.cr, begin_code (crystal-lang#5701)

    * Use double quotes in html_renderer.cr, begin_code

    It should use double quotes there instead of apostrophes. Because thats generating bad html code.
    For example this is what glitch.com (glitch is an online html editor) says to an markdown crystal code block:
    https://imgur.com/a/6nUKz
    And other sources say too that double quotes are better.

    * Update markdown_spec.cr

    * Update markdown_spec.cr

    * Update markdown_spec.cr

commit b30a9cc
Author: Johannes Müller <[email protected]>
Date:   Sat Feb 10 14:33:02 2018 +0100

    Fix YAML::Core parse float with leading 0 or . (crystal-lang#5699)

    Also adds some specs for parsing float values

commit ee271d8
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Fri Feb 2 20:51:26 2018 +0100

    Support BigDecimal comparison with and initialization from BigRational

commit 3086419
Author: asterite <[email protected]>
Date:   Thu Feb 8 09:00:42 2018 -0300

    Fix incorrect type for lib extern static array

commit ab8ed5c
Author: Ary Borenszweig <[email protected]>
Date:   Wed Feb 7 12:06:56 2018 -0300

    Fix custom array/hash-like literals in nested modules (crystal-lang#5685)

commit 19981d3
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Feb 7 03:35:37 2018 -0300

    Shorten jobs names

commit 66600d6
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Feb 6 14:05:47 2018 -0300

    Parametrise previous crystal release, package iteration and docker

commit e3c3f7f
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Feb 6 11:07:29 2018 -0300

    DRY checkout of distribution-scripts. Use docker executor where possible

commit 151c0da
Author: Johannes Müller <[email protected]>
Date:   Mon Feb 5 23:09:25 2018 +0100

    Add documentation for String#inspect and #dump methods and minor code improvements (crystal-lang#5682)

commit 80a1c4a
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Feb 5 11:52:44 2018 -0300

    Split build/publish docker targets. Build docs from docker image.

commit 47b45da
Author: Julien Portalier <[email protected]>
Date:   Sat Feb 3 17:46:43 2018 +0100

    Fix: uninitialized sa_mask value in sigfault ext

commit 322d1c4
Author: Johannes Müller <[email protected]>
Date:   Fri Feb 2 21:51:31 2018 +0100

    Fix: string/symbol array literals nesting and escaping (crystal-lang#5667)

    i# ase enter the commit message for your changes. Lines starting

commit 0491891
Author: Johannes Müller <[email protected]>
Date:   Fri Feb 2 18:57:39 2018 +0100

    Fix String#dump for UTF-8 charachters > \uFFFF (crystal-lang#5668)

commit aa6521f
Author: Ary Borenszweig <[email protected]>
Date:   Fri Feb 2 09:46:19 2018 -0300

    Fix ASTNode#raise macro method (crystal-lang#5670)

commit d5e952f
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Jan 30 02:45:46 2018 -0300

    Add docker image as nightly artifact

commit a4ed534
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Jan 29 16:16:32 2018 -0300

    Remove docs publishing from travis

    Make travis build ci branches

commit ccdf9c1
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Jan 29 16:12:33 2018 -0300

    Add docs as nightly artifacts

commit 85d895f
Author: Brian J. Cardiff <[email protected]>
Date:   Thu Jan 25 01:07:05 2018 -0300

    Collect dist packages of jobs as artifacts

commit bfc9f79
Author: Brian J. Cardiff <[email protected]>
Date:   Wed Jan 24 14:13:36 2018 -0300

    Add darwin nightly artifacts

commit 5c06ff9
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Jan 23 11:59:59 2018 -0300

    Check if circle can handle release optimized builds

commit 9538efb
Author: Brian J. Cardiff <[email protected]>
Date:   Mon Jan 22 14:18:50 2018 -0300

    Test nightly build

commit 1a1124b
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 21:16:50 2018 -0300

    Add branch and tag filter to ci

    Build master, release and ci branches
    Build tags

commit d08d7c9
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 20:12:51 2018 -0300

    Add linux builds for 64 and 32 bits

commit 6b655af
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 20:08:55 2018 -0300

    Enable ipv6 for docker in linux build

    Move setup from .travis.yml to /bin/ci

commit 6418ee4
Author: Brian J. Cardiff <[email protected]>
Date:   Sat Jan 20 20:06:58 2018 -0300

    Set TZ for osx builds

commit 8e621ad
Author: Brian J. Cardiff <[email protected]>
Date:   Fri Jan 19 15:45:35 2018 -0300

    Migrate to Circle 2.0

commit 995d3f9
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Mon Jan 29 22:51:07 2018 +0900

    Fix indentation after comment inside 'when'

    Fix crystal-lang#5654

commit bfd7c99
Author: asterite <[email protected]>
Date:   Fri Jan 26 20:25:45 2018 -0300

    Class: add comparison operators

commit ffda890
Author: Ary Borenszweig <[email protected]>
Date:   Sat Jan 27 12:54:15 2018 -0300

    Spec: implement `be_a` and `expect_raises` without macros (crystal-lang#5646)

    * Spec: implement `be_a` and `expect_raises` without macros

    * Simplify `expect_raises` code by adding an `else` clause

    * Remove redundant `begin` in `expect_raises`

    * More refactors in `expect_raises`

commit 1445529
Author: Matias Garcia Isaia <[email protected]>
Date:   Thu Jan 25 18:21:03 2018 -0300

    Version 0.24.2

commit 558a32a
Author: Juan Wajnerman <[email protected]>
Date:   Wed Jan 17 20:50:35 2018 -0300

    Bug: default_verify_param are inverted in SSL::Context::Client and SSL::Context::Server

    Fixes crystal-lang#5266

    x509 certificates have a purpose associated to them. Clients should
    verify that the server's certificate is intended to be used in a
    server, and servers should check the client's certificate is
    intended to be used for clients.

    Crystal was mistakingly checking those mixed up.

    See https://wiki.openssl.org/index.php?title=Manual:X509(1)&oldid=1797#CERTIFICATE_EXTENSIONS
    See https://tools.ietf.org/html/rfc5280#section-4.2.1.3

commit 7f05801
Author: Benoit de Chezelles <[email protected]>
Date:   Fri Dec 22 12:42:04 2017 +0100

    Add formatter spec for uppercased fun call

commit b793876
Author: Benoit de Chezelles <[email protected]>
Date:   Thu Dec 21 23:34:25 2017 +0100

    Fix formatting of lib's fun starting with uppercase letter

commit 0f9af00
Author: Martyn Jago <[email protected]>
Date:   Thu Jan 25 13:46:05 2018 +0000

    Raise ArgumentError if BigFloat initialized with invalid string (crystal-lang#5638)

    * Raise ArgumentError if BigFloat initialized with invalid string

    Raise ArgumentError if BigFloat.new() initialized with string
    that doesn't denote a valid float

    * fixup! Raise ArgumentError if BigFloat initialized with invalid string

commit 302ff6c
Author: RX14 <[email protected]>
Date:   Sat Jan 20 23:41:24 2018 +0000

    Correctly stub out Exception#backtrace?

commit 0ebc173
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Jan 5 03:12:05 2018 +0900

    Add ASTNode#single_expression and refactor with using it (crystal-lang#5513)

    * Add ASTNode#single_expression and refactor with using it

    Fixed crystal-lang#5482
    Fixed crystal-lang#5511

    But this commit contains no spec for crystal-lang#5511 because I don't know where to
    place such a spec.

    * Add spec for crystal-lang#5511

    Thank you @asterite!
    See: crystal-lang#5513 (comment)

commit b05ad8d
Author: Johannes Müller <[email protected]>
Date:   Tue Jan 23 11:25:37 2018 +0100

    Fix offset handling of String#rindex with Regex (crystal-lang#5594)

    * Fix offset handling of String#rindex with Regex

    This also addas a few specs to ensure all variants of #rindex treat offset similarly.

    * Fix negative offset and remove substring

commit ff02d2d
Author: asterite <[email protected]>
Date:   Fri Jan 19 16:44:07 2018 -0300

    HTTP::Client: execute `before_request`callbacks right before writing the request

commit fd55e8d
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Mon Jan 22 10:23:06 2018 +0900

    Remove TODO about duplicated named group Regex

commit e5da7d3
Author: Chris Hobbs <[email protected]>
Date:   Sun Jan 21 16:12:47 2018 +0000

    Add Int#bits_set? method (crystal-lang#5619)

commit e83e894
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sun Jan 21 01:24:33 2018 +0100

    Add additional parameters for Logger#new

commit 4c2f6f6
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Jan 20 23:37:48 2018 +0100

    Remove TODOs related to Crystal 0.22 (crystal-lang#5546)

commit 8bc3cee
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Jan 20 23:37:07 2018 +0100

    Add #clear method to ArrayLiteral/HashLiteral (crystal-lang#5265)

commit 6c2297b
Author: Julien Portalier <[email protected]>
Date:   Sat Jan 20 14:39:19 2018 +0100

    Fix bcrypt hard limit on passwords to 71 bytes (crystal-lang#5356)

    Despite the original bcrypt paper claiming passwords must be a
    maximum of 56 bytes, the implementations are compatible to up to 72
    bytes.

    Since increasing the limit doesn't break compatibility, but other
    implementations allow as many as 72 bytes, let's increase the
    arbitrary limitation of 51 characters (which was wrong anyway) to 72
    bytes, minus the leading null byte, that is a password of 71 bytes.

commit ddbcf6c
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Sat Jan 20 12:38:58 2018 +0100

    BigDecimal.new(str : String) handles scientific notation (crystal-lang#5582)

    * BigDecimal.new(str : String) handles scientific notation

    * fixup! by @RX14

    * Spec with cases suggested by @RX14

    * Fix failing spec

    * Fixed another failing case

commit 3515968
Author: Johannes Müller <[email protected]>
Date:   Sat Jan 20 12:37:08 2018 +0100

    Remove unneeded parenthesis from calls in macro expression (crystal-lang#5493)

    * Remove parenthesis from macro calls without arguments: not needed anymore as of 0.24.0

    * Resolve TODO in urandom

commit a288123
Author: Johannes Müller <[email protected]>
Date:   Fri Jan 19 01:37:02 2018 +0100

    Fix HTTP::StaticFileHandler to properly parse HTTP date (crystal-lang#5607)

commit a29e21b
Author: Damian Hamill <[email protected]>
Date:   Thu Jan 18 20:36:36 2018 +0700

    return correct content type for SVG images (crystal-lang#5605)

commit 1210596
Author: Benny Bach <[email protected]>
Date:   Thu Jan 18 14:21:41 2018 +0100

    Add cache control headers to http static file handler + a few more mi… (crystal-lang#2470)

    * Add cache control headers to http static file handler + a few more mime types

    * Remove Cache-Control header from static file handler

    * Undo extra mime types in static file handler

    * Fix code review issues:

    * use HTTP.rfc3339_date formatter
    * parse time value from If-Modified-Since header
    * compare header and mtime as older or equals

    * use `headers["If-Modified-Since"]?`

commit 3b50388
Author: Juan Wajnerman <[email protected]>
Date:   Thu Jan 18 10:14:32 2018 -0300

    OpenSSL: Hide errors when either libcrypto or libssl are not found by pkg-config (crystal-lang#5603)

commit f3168b6
Author: Johannes Müller <[email protected]>
Date:   Thu Jan 18 14:09:46 2018 +0100

    Add time zones support (crystal-lang#5324)

    * Add cache for last zone to Time::Location#lookup

    * Implement Time::Location including timezone data loader

    Remove representation of floating time from `Time` (formerly expressed
    as `Time::Kind::Unspecified`).

    Floating time should not be represented as an instance of `Time` to avoid undefined operations through type safety (see crystal-lang#5332).
    Breaking changes:
    * Calls to `Time.new` and `Time.now` are now in the local time zone by
      default.
    * `Time.parse`, `Time::Format.new` and `Time::Format.parse` don't specify a default location.
      If none is included in the time format and no default argument is provided, the parse method wil raise an exception because there is no way to know how such a value should be represented as an instance of `Time`.
      Applications expecting time values without time zone should provide default location to apply in such a case.

    * Implement custom zip file reader to remove depenencies

    * Add location cache for `Location.load`

    * Rename `Location.local` to `.load_local` and make `local` a class property

    * Fix env ZONEINFO

    * Fix example code string representation of local Time instance

    * Time zone implementation for win32

    This adds basic support for using the new time zone model on windows.
    * `Crystal::System::Time.zone_sources` returns an empty array because
      Windows does not include a copy of the tz database.
    * `Crystal::System::Time.load_localtime` creates a local time zone
      `Time::Location` based on data provided by `GetTimeZoneInformation`.
    * A mapping from Windows time zone names to identifiers used by the
      IANA timezone database is included as well as an automated generator
      for that file.

    * Add stubs for methods with file acces

    Trying to load a location from a file will fail because `File` is not
    yet ported to windows.

commit 6a574f2
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Jan 18 10:47:54 2018 +0900

    Fix parsing an empty heredoc

commit 84288b7
Author: Ary Borenszweig <[email protected]>
Date:   Wed Jan 17 16:08:54 2018 -0300

    Compiler: add more locations (crystal-lang#5597)

commit bba4985
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Jan 18 04:00:01 2018 +0900

    Use join instead of each_with_index and `if i > 0` (crystal-lang#5599)

    Just a refactoring.

commit 8eb8554
Author: Ary Borenszweig <[email protected]>
Date:   Wed Jan 17 15:58:57 2018 -0300

    Correct implementation of heredoc (crystal-lang#5578)

    Now you can specify multiple heredocs in a single line, just like in Ruby.

commit 295ddc3
Author: Johannes Müller <[email protected]>
Date:   Sat Jan 13 12:49:02 2018 +0100

    Add overload to String.from_utf16 with pointer

commit 244da57
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Mon Jan 15 18:29:07 2018 +0100

    Allow leading + in number strings

commit 80cbe66
Author: asterite <[email protected]>
Date:   Sun Jan 14 10:46:11 2018 -0300

    Compiler: emit `.o` file to a temporary location and then atomically rename it

commit 597ccac
Author: Ary Borenszweig <[email protected]>
Date:   Mon Oct 23 21:15:37 2017 -0300

    Implement JSON::Any and YAML::Any without recursive aliases

commit b4fed51
Author: Guilherme Bernal <[email protected]>
Date:   Sun Jan 14 15:17:42 2018 -0300

    Fix strdup for LibXML: undefined behavior

    The last argument of xmlGcMemSetup is a GC-aware implementation of strdup. It should return a valid C-string with the null-character.

commit c7cc787
Author: Jamie Gaskins <[email protected]>
Date:   Sun Jan 14 06:52:32 2018 -0500

    Pretty-print objects in playground inspector (crystal-lang#4601)

commit d7c9551
Author: RX14 <[email protected]>
Date:   Fri Jan 12 23:32:10 2018 +0000

    Rename win_nt.cr to winnt.cr

    The header file is called winnt.h, the win_nt.cr was an error and should be
    merged with winnt.cr.

commit d294dd1
Author: RX14 <[email protected]>
Date:   Fri Jan 12 23:28:12 2018 +0000

    Reenable Crystal::Hasher seed randomisation on win32

commit 323613b
Author: RX14 <[email protected]>
Date:   Fri Jan 12 23:20:27 2018 +0000

    Ensure String#to_utf16 result has a null terminator

commit 48a1130
Author: Chris Hobbs <[email protected]>
Date:   Sat Jan 13 00:53:17 2018 +0000

    Simplify Crystal::System interface by adding File.stat? and lstat? (crystal-lang#5553)

    By providing these methods we can make the implementation of File.empty? and
    File.file? platform-unspecific. This makes the interface to
    Crystal::System::File smaller and cleaner.

commit 77de91f
Author: Lachlan Dowding <[email protected]>
Date:   Thu Jan 11 08:13:16 2018 +1000

    Fix Iterator spec typo: integreation -> integration

commit bd42727
Author: Johannes Müller <[email protected]>
Date:   Thu Jan 11 19:32:28 2018 +0100

    Reimplement Dir.glob  (crystal-lang#5179)

commit f16e63a
Author: Mark <[email protected]>
Date:   Thu Jan 11 10:28:54 2018 -0800

    Change Hash#key to Hash#key_for (crystal-lang#5444)

    * Change Hash#key to Hash#key_for

    * Update Spec description for Hash#key_for and Hash#key_for?

commit f59a349
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Fri Jan 12 03:24:04 2018 +0900

    Fix to keep paren information for `to_s` on clone (crystal-lang#5454)

    Fixed crystal-lang#5415

    Added keeping information for `to_s` on clone check in `compiler/parser/to_s_spec.cr`.
    I think this property should be kept by all `ASTNode#clone` implementation.

commit 5eecd57
Author: Julien Portalier <[email protected]>
Date:   Wed Jan 10 17:38:18 2018 +0100

    Fix: decode DWARF line sequences with single program entry (crystal-lang#5565)

    Debug::DWARF::LineNumbers would skip the program statement when it
    contained a single entry, because of a wrong assumption of the
    sequence unit_length entry, which doesn't account for the unit
    length space in the standard, and was overlooked in checking whether
    the sequence had any program statement, or not.

commit 048f77e
Author: Julien Portalier <[email protected]>
Date:   Wed Jan 10 17:38:18 2018 +0100

    Fix: decode DWARF line sequences with single program entry (crystal-lang#5565)

    Debug::DWARF::LineNumbers would skip the program statement when it
    contained a single entry, because of a wrong assumption of the
    sequence unit_length entry, which doesn't account for the unit
    length space in the standard, and was overlooked in checking whether
    the sequence had any program statement, or not.

commit 972f2b3
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Thu Dec 21 20:16:08 2017 +0900

    Fix to work formatting `foo.[bar] = baz`

    Fixed crystal-lang#5416

commit 157eca0
Author: TSUYUSATO Kitsune <[email protected]>
Date:   Sun Nov 5 23:30:20 2017 +0900

    Clone macro default argument before macro expansion

commit a3ca37e
Author: Michael Petö <[email protected]>
Date:   Wed Jan 10 14:47:44 2018 +0100

    Fix Time::Span multiply and divide (crystal-lang#5563)

commit 5f1440d
Author: Ary Borenszweig <[email protected]>
Date:   Tue Jan 9 17:25:51 2018 -0300

    Formatter: fix bug regarding backslash (crystal-lang#5194)

commit 77db65a
Author: Peter Leitzen <[email protected]>
Date:   Tue Jan 9 13:39:59 2018 +0100

    Fix spec name for parsing BigDecimal from floats (crystal-lang#5561)

    Follow-up to crystal-lang#5525

commit d8343a6
Author: Luke Rodgers <[email protected]>
Date:   Mon Jan 8 19:29:06 2018 -0500

    Define `new(JSON::PullParser)` on BigDecimal so it can be deserialized (crystal-lang#5525)

commit d023138
Author: Benoit de Chezelles <[email protected]>
Date:   Mon Jan 8 01:25:21 2018 +0100

    Allow to init a crystal app/lib in an empty directory (crystal-lang#4691)

commit f7a931c
Author: Sijawusz Pur Rahnama <[email protected]>
Date:   Mon Jan 8 01:19:37 2018 +0100

    Extend BigDecimal with a few things (crystal-lang#5390)

commit 3cb4b94
Author: Ary Borenszweig <[email protected]>
Date:   Sat Jan 6 15:17:23 2018 -0300

    CLI: remove deps command (crystal-lang#5544)

commit 525ea49
Author: Ary Borenszweig <[email protected]>
Date:   Sat Jan 6 11:04:16 2018 -0300

    Compiler: remove extra `shell` argument when executing macro run (crystal-lang#5543)

commit 161c17a
Author: Noriyo Akita <[email protected]>
Date:   Sat Jan 6 21:34:06 2018 +0900

    Fix typo mutli to multi (crystal-lang#5547)

    * tools/formatter: Fix typo

    mutli -> multi

    * Fix typo in comment

    Mutliple -> Multiple

commit e1680dd
Author: asterite <[email protected]>
Date:   Fri Jan 5 14:07:13 2018 -0300

    Include UUID in docs

commit a06bf0f
Author: asterite <[email protected]>
Date:   Fri Jan 5 14:07:13 2018 -0300

    Include UUID in docs

commit d3fed8b
Author: Johannes Müller <[email protected]>
Date:   Tue Jan 2 14:32:06 2018 +0100

    Rename skip() macro method to skip_file() in docs (crystal-lang#5488)

commit 4f56a57
Author: Brian J. Cardiff <[email protected]>
Date:   Fri Dec 29 20:38:36 2017 -0300

    Update gitignore template (crystal-lang#5480)

    * Fix docs directory in gitignore.ecr (renamed in crystal-lang#4937)

commit 12cc7f2
Author: Brian J. Cardiff <[email protected]>
Date:   Thu Dec 28 02:51:47 2017 -0300

    Fix missing Dir#each to be an Enumerable (crystal-lang#5458)

commit 4313e86
Author: Brian J. Cardiff <[email protected]>
Date:   Tue Dec 26 21:59:22 2017 -0300

    Update bin/ci to use LIBRARY_PATH from 0.24.1 (crystal-lang#5461)

commit 68c0098
Author: Dominic Jodoin <[email protected]>
Date:   Thu Dec 21 12:40:38 2017 -0500

    Enable IPv6 in Docker (crystal-lang#5429)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't represent Time with specific offset
10 participants