Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
0.14.2
0.14.1
0.14.1 (2016-03-21)
- Fixed some regressions in the formatter
0.14.0 (2016-03-21)
- (breaking change) The syntax of a method argument with a default value and a type restriction is now
def foo(arg : Type = default_value)
. Runcrystal tool format
to automatically upgrade exsiting code to this new syntax. The olddef foo(arg = default_value : Type)
was removed. - (breaking change)
Enumerable#take(n)
andIterator#take(n)
were renamed tofirst(n)
- (breaking change)
Socket#addr
andSocket#peeraddr
were renamed tolocal_address
andremote_address
respectively - (breaking change) Removed
Comparable#between?(a, z)
. Usea <= x <= z
instead - (breaking change)
HTTP::WebSocketHandler
callbacks can now access theHTTP::Context
. If you had a forwarding method to it you'll need to update it. See #2313. - New command
crystal play
that opens a playground for you to play in the browser :-) (thanks @bcardiff) - New command
crystal env
that prints environment information Spec
: you can now run multiple files with specified line numbers, as incrystal spec file1.cr:10 file2.cr:20 ...
- Initial support for musl-libc (thanks @ysbaddaden)
- Added
FileUtils.cp
(thanks @Dreauw) - Added
Array#first(n)
andArray#last(n)
(thanks @greyblake) - Added
WebSocket#close
and properly handle disconnections - Added
UDPSocket#send
andUDPSocket#receive
(thanks @tatey) - Added
Char#uppercase?
andChar#lowercase?
(thanks @MaloJaffre`) - Added
sync_close
property toOpenSSL::SSL::Socket
,Zlib::Inflate
andZlib::Deflate
- Added
XML::Node#encoding
andXML::Node#version
- Added
HTTP::Client::Response#success?
(thanks @marceloboeira) - Added
StaticArray#shuffle!(random)
(thanks @Nesqwik) - Added
Splat#exp
method in macros - Added fiber-safe
Mutex
- All
Int
types (exceptBigInt
) can now be used inJSON
andYAML
mappings (thanks @marceloboeira) - Instance variable declarations/initializations now correctly work in generic classes and modules
- Lots of bug fixes
0.14.0
- (breaking change) The syntax of a method argument with a default value and a type restriction is now
def foo(arg : Type = default_value)
. The olddef foo(arg = default_value : Type)
was removed. - (breaking change)
Enumerable#take(n)
andIterator#take(n)
were renamed tofirst(n)
- (breaking change)
Socket#addr
andSocket#peeraddr
were renamed tolocal_address
andremote_address
respectively - (breaking change) Removed
Comparable#between?(a, z)
. Usea <= x <= z
instead - (breaking change)
HTTP::WebSocketHandler
callbacks can now access theHTTP::Context
. If you had a forwarding method to it you'll need to update it. See #2313. - New command
crystal play
that opens a playground for you to play in the browser :-) (thanks @bcardiff) - New command
crystal env
that prints environment information Spec
: you can now run multiple files with specified line numbers, as incrystal spec file1.cr:10 file2.cr:20 ...
- Initial support for musl-libc (thanks @ysbaddaden)
- Added
FileUtils.cp
(thanks @Dreauw) - Added
Array#first(n)
andArray#last(n)
(thanks @greyblake) - Added
WebSocket#close
and properly handle disconnections - Added
UDPSocket#send
andUDPSocket#receive
(thanks @tatey) - Added
Char#uppercase?
andChar#lowercase?
(thanks @MaloJaffre`) - Added
sync_close
property toOpenSSL::SSL::Socket
,Zlib::Inflate
andZlib::Deflate
- Added
XML::Node#encoding
andXML::Node#version
- Added
HTTP::Client::Response#success?
(thanks @marceloboeira) - Added
StaticArray#shuffle!(random)
(thanks @Nesqwik) - Added
Splat#exp
method in macros - Added fiber-safe
Mutex
- All
Int
types (exceptBigInt
) can now be used inJSON
andYAML
mappings (thanks @marceloboeira) - Instance variable declarations/initializations now correctly work in generic classes and modules
- Lots of bug fixes
0.13.0
- (breaking change)
Matrix
was moved to a separate shard: https://github.com/Exilor/matrix - The syntax of a method argument with a default value and a type restriction is now
def foo(arg : Type = default_value)
. Runcrystal tool format
to automatically upgrade exsiting code to this new syntax. The olddef foo(arg = default_value : Type)
syntax will be removed in a next release. - Special handling of
case
with a tuple literal. See #2258. - Keywords can now be used for variable declaration, so
property end : Time
works as expected. - Comparison of signed vs. unsigned integers now always give a correct result
- Allow declaring instance variables in non-generic module types (
module Moo; @x : Int32; end
) - Allow initializing instance variables in non-generic module types (
module Moo; @x = 1; end
) Spec
: allow setting multiple output formatters (thanks @marceloboeira)StringScanner
: improved performance- Added
foo.[0] = 1
andfoo.[0]
as valid syntax, similar to the one in&.
blocks (thanks @makenowjust) CSV
: allow separate and quote characters different than comma and doble quote (thanks @jreinert)YAML
: support merge operator (<<
) (thanks @jreinert)- Allow redefining primitive methods like
Int32#+(other : Int32)
- Allow defining macros with operator names like
[]
Levenshtein
: improved performance (thanks @tcrouch)HTTP::Client
: fixed incorrect parsing of chunked bodyHTTP::Client
: added a constructor with anURI
argument (thanks @plukevdh)String
:sub
andgsub
now understand backreferences (thanks @bjmllr)Random
: addedRandom#rand(Float64)
andRandom#rand(Range(Float, Float))
(thanks @AlexWayfer)HTML
:HTLM.escape
includes more characters (thanks @Ryuuzakis)- Added
TypeNode.class
method in macros (thanks @waterlink) run
inside macros now also work with absolute paths (useful when used with__DIR__
)- Added docs for
Math
andStaticArray
(thanks @zavydiel, @HeleneMyr) - Many bug fixes and some micro-optimizations
0.12.0
- (breaking change) When used with a type declaration, the macros
property
,getter
,setter
, etc., declare instance variables with those types. - (breaking change)
JSON.mapping
andYAML.mapping
declare instance variables with the given types. - (breaking change)
YAML.load
was renamed toYAML.parse
, and it now returns aYAML::Any
. - (breaking change)
embed_ecr
andecr_file
were renamed toECR.embed
andECR.def_to_s
(the old methods now produce a warning and will be removed in the next release). - Added encoding support:
IO#set_encoding
,String#encode
, andHTTP::Client
charset check. - Segmentation faults are now trapped and shown in a more friendlier way.
- The
record
macro can now accept type declarations (for examplerecord Point, x : Int32, y : Int32
) - Added
Iterator#step
(thanks @jhass) Array#push
andArray#unshift
can now accept multiple values and add the elements in an efficient way (thanks @arktisklada)- Added
default
option toJSON.mapping
(thanks @kostya) - Added
default
option toYAML.mapping
(thanks @jreinert) - Allow doing
case foo; when Foo.class
(andFoo(T)
andFoo(T).class
) in case expressions. - Added
Class#|
so a union type can be expresses asInt32 | Char
in regular code. - Added
File.real_path
(thanks @jreinert) - Added
dns_timeout
forHTTP::Client
(thanks @kostya) - Added dynamic width precision to
sprintf
(thanks @gtramontina) Markdown
now supports blockquotes and 1 level of list nesting (thanks @SebastianSzturo)p
now accepts multiple arguments- Many bug fixes and some optimizations
0.11.1
0.11.0
- (breaking change) Syntax for type declarations changed from
var :: Type
tovar : Type
. The old syntax is still allowed but will be deprecated in the next version (runcrystal tool format
to automatically fix this) - (breaking change) Syntax for uninitialized variables, which used to be
var :: Type
, is nowvar = uninitialized Type
. The old syntax is still allowed but will be deprecated in the next version (runcrystal tool format
to automatically fix this) - (breaking change)
HTTP::Server
refactor to support streaming. Check the docs ofHTTP::Server
for upgrade instructions - (breaking change) Renamed
HTTP::WebSocketSession
toHTTP::WebSocket
. - (breaking change) Heredocs now remove indentations according to the indentation of the closing identifier (thanks @rhysd)
- (breaking change) Renamed
Enumerable#inject
toEnumerable#reduce
- (breaking change)
next
andreturn
semantic inside captured block has been swapped (#420) - Fibers context switch is now faster, done with inline assembly.
libpcl
is no longer used - Allow annotating the type of class and global variables
- Support comments in ECR (thanks @ysbaddaden)
- Security improvements to
HTTP::StaticFileHandler
(thanks @makenowjust) - Moved
seek
,tell
,pos
andpos=
fromFile
toIO::FileDescriptor
(affectsTempfile
) URI.parse
is now faster (thanks @will)- Many bug fixes, some really old ones involving issues with order of declaration
0.10.2
- Fixed Directory Traversal Vulnerability in HTTP::StaticFileHandler (thanks @makenowjust)
0.10.1
0.10.0
- (breaking change)
def
arguments must always be enclosed in parentheses - (breaking change) A space is now required before and after def return type restriction
- (breaking change) Renamed
Dir.working_dir
toDir.current
- (breaking change) Moved
HTML::Builder
to its own shard - (breaking change)
String#split
now always keeps all results (never drops trailing empty strings) - (breaking change) Removed
Array#buffer
,StaticArray#buffer
andSlice#buffer
. Useto_unsafe
instead (so unsafe usages are easier to spot) - (breaking change) Removed
String#cstr
. Useto_unsafe
instead (so unsafe usages are easier to spot) - Optimized Range#sum (thanks @makenowjust)
- Allow forward declarations for lib external vars
- Added
Int#to_s(base)
forbase = 62
(thanks @jhass) JSON.parse
now returnsJSON::Any
, which allows traversal of JSON objects with less casts- Added
OpenSSL::PKCS5
(thanks @benoist) - MemoryIO can now be created to read/write from a Slice(UInt8). In this mode MemoryIO can't be exapnded, and can optionally be written. And when creating a MemoryIO from a String, it's non-resizeable and read-only.
- Added
Object#!~
(the opposite of=~
) at_exit
now receives that exit status code in the block (thanks @makenowjust)- Allow using
Set
in JSON mappings (thanks @benoist) - Added
File.executable?
,File.readable?
andFile.writeable?
(thanks @mverzilli) Array#sort_by
andArray#sort_by!
now use a Schwartzian transform (thanks @radarek)- Added
Array#each_permutation
,Array#each_combination
andArray#each_repeated_combination
iterators - Added optional random argument to
Array#sample
andArray#shuffle
- The
delegate
macro can now delegate multiple methods to an object (thanks @elthariel) - Added basic YAML generation (thanks @porras)