Skip to content

Releases: crystal-lang/crystal

0.14.2

23 Mar 10:39
Compare
Choose a tag to compare
  • Fixed regression with formatter (#2348)
  • Fixed regression with block return types (#2347)
  • Fixed regression with openssl (78c12ca)

0.14.1

22 Mar 10:59
Compare
Choose a tag to compare

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). Run crystal tool format to automatically upgrade exsiting code to this new syntax. The old def foo(arg = default_value : Type) was removed.
  • (breaking change) Enumerable#take(n) and Iterator#take(n) were renamed to first(n)
  • (breaking change) Socket#addr and Socket#peeraddr were renamed to local_address and remote_address respectively
  • (breaking change) Removed Comparable#between?(a, z). Use a <= x <= z instead
  • (breaking change) HTTP::WebSocketHandler callbacks can now access the HTTP::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 in crystal spec file1.cr:10 file2.cr:20 ...
  • Initial support for musl-libc (thanks @ysbaddaden)
  • Added FileUtils.cp (thanks @Dreauw)
  • Added Array#first(n) and Array#last(n) (thanks @greyblake)
  • Added WebSocket#close and properly handle disconnections
  • Added UDPSocket#send and UDPSocket#receive (thanks @tatey)
  • Added Char#uppercase? and Char#lowercase? (thanks @MaloJaffre`)
  • Added sync_close property to OpenSSL::SSL::Socket, Zlib::Inflate and Zlib::Deflate
  • Added XML::Node#encoding and XML::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 (except BigInt) can now be used in JSON and YAML mappings (thanks @marceloboeira)
  • Instance variable declarations/initializations now correctly work in generic classes and modules
  • Lots of bug fixes

0.14.0

22 Mar 10:59
Compare
Choose a tag to compare
  • (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 old def foo(arg = default_value : Type) was removed.
  • (breaking change) Enumerable#take(n) and Iterator#take(n) were renamed to first(n)
  • (breaking change) Socket#addr and Socket#peeraddr were renamed to local_address and remote_address respectively
  • (breaking change) Removed Comparable#between?(a, z). Use a <= x <= z instead
  • (breaking change) HTTP::WebSocketHandler callbacks can now access the HTTP::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 in crystal spec file1.cr:10 file2.cr:20 ...
  • Initial support for musl-libc (thanks @ysbaddaden)
  • Added FileUtils.cp (thanks @Dreauw)
  • Added Array#first(n) and Array#last(n) (thanks @greyblake)
  • Added WebSocket#close and properly handle disconnections
  • Added UDPSocket#send and UDPSocket#receive (thanks @tatey)
  • Added Char#uppercase? and Char#lowercase? (thanks @MaloJaffre`)
  • Added sync_close property to OpenSSL::SSL::Socket, Zlib::Inflate and Zlib::Deflate
  • Added XML::Node#encoding and XML::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 (except BigInt) can now be used in JSON and YAML mappings (thanks @marceloboeira)
  • Instance variable declarations/initializations now correctly work in generic classes and modules
  • Lots of bug fixes

0.13.0

07 Mar 19:11
Compare
Choose a tag to compare
  • (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). Run crystal tool format to automatically upgrade exsiting code to this new syntax. The old def 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 and foo.[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 body
  • HTTP::Client: added a constructor with an URI argument (thanks @plukevdh)
  • String: sub and gsub now understand backreferences (thanks @bjmllr)
  • Random: added Random#rand(Float64) and Random#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 and StaticArray (thanks @zavydiel, @HeleneMyr)
  • Many bug fixes and some micro-optimizations

0.12.0

16 Feb 16:26
Compare
Choose a tag to compare
  • (breaking change) When used with a type declaration, the macros property, getter, setter, etc., declare instance variables with those types.
  • (breaking change) JSON.mapping and YAML.mapping declare instance variables with the given types.
  • (breaking change) YAML.load was renamed to YAML.parse, and it now returns a YAML::Any.
  • (breaking change) embed_ecr and ecr_file were renamed to ECR.embed and ECR.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, and HTTP::Client charset check.
  • Segmentation faults are now trapped and shown in a more friendlier way.
  • The record macro can now accept type declarations (for example record Point, x : Int32, y : Int32)
  • Added Iterator#step (thanks @jhass)
  • Array#push and Array#unshift can now accept multiple values and add the elements in an efficient way (thanks @arktisklada)
  • Added default option to JSON.mapping (thanks @kostya)
  • Added default option to YAML.mapping (thanks @jreinert)
  • Allow doing case foo; when Foo.class (and Foo(T) and Foo(T).class) in case expressions.
  • Added Class#| so a union type can be expresses as Int32 | Char in regular code.
  • Added File.real_path (thanks @jreinert)
  • Added dns_timeout for HTTP::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

25 Jan 16:26
Compare
Choose a tag to compare
  • Fixed #2050, #2054, #2057, #2059, #2064
  • Fixed bug: HTTP::Server::Response headers weren't cleared after each request
  • Formatter would incorrectly change property x :: Int32 to property x = uninitialized Int32

0.11.0

23 Jan 18:42
Compare
Choose a tag to compare
  • (breaking change) Syntax for type declarations changed from var :: Type to var : Type. The old syntax is still allowed but will be deprecated in the next version (run crystal tool format to automatically fix this)
  • (breaking change) Syntax for uninitialized variables, which used to be var :: Type, is now var = uninitialized Type. The old syntax is still allowed but will be deprecated in the next version (run crystal tool format to automatically fix this)
  • (breaking change) HTTP::Server refactor to support streaming. Check the docs of HTTP::Server for upgrade instructions
  • (breaking change) Renamed HTTP::WebSocketSession to HTTP::WebSocket.
  • (breaking change) Heredocs now remove indentations according to the indentation of the closing identifier (thanks @rhysd)
  • (breaking change) Renamed Enumerable#inject to Enumerable#reduce
  • (breaking change) next and return 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 and pos= from File to IO::FileDescriptor (affects Tempfile)
  • URI.parse is now faster (thanks @will)
  • Many bug fixes, some really old ones involving issues with order of declaration

0.10.2

13 Jan 17:26
Compare
Choose a tag to compare
  • Fixed Directory Traversal Vulnerability in HTTP::StaticFileHandler (thanks @makenowjust)

0.10.1

08 Jan 01:50
Compare
Choose a tag to compare
  • Added Int#popcount (thanks @rmosolgo)
  • Added @[Naked] attribute for ommiting a method's prelude
  • Check that abstract methods are implemented by subtypes
  • Some bug fixes

0.10.0

23 Dec 18:00
Compare
Choose a tag to compare
  • (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 to Dir.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 and Slice#buffer. Use to_unsafe instead (so unsafe usages are easier to spot)
  • (breaking change) Removed String#cstr. Use to_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) for base = 62 (thanks @jhass)
  • JSON.parse now returns JSON::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? and File.writeable? (thanks @mverzilli)
  • Array#sort_by and Array#sort_by! now use a Schwartzian transform (thanks @radarek)
  • Added Array#each_permutation, Array#each_combination and Array#each_repeated_combination iterators
  • Added optional random argument to Array#sample and Array#shuffle
  • The delegate macro can now delegate multiple methods to an object (thanks @elthariel)
  • Added basic YAML generation (thanks @porras)