Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
0.9.1
- Docs search now finds nested entries (thanks @adlerhsieh)
- Many corrections and changes to the formatter, for better consistency and less obtrusion.
- Added
OpenSSL::Cipher
andOpenSSL::Digest
(thanks @benoist) - Added
Char#+(String)
(thanks @hangyas) - Added
Hash#key
andHash#key?
(thanks @adlerhsieh) - Added
Time::Span#*
andTime::Span#/
(thanks @jbaum98) - Added
Slice#reverse_each
(thanks @omninonsense) - Added docs for
Random
andTempfile
(thanks @adlerhsieh) - Fixed some bugs.
0.9.0
- (breaking change) The
CGI
module's funcionality has been moved toURI
andHTTP::Params
- (breaking change)
IO#read()
is nowIO#gets_to_end
. RemovedIO#read(count)
, addedIO#skip(count)
- (breaking change)
json_mapping
is nowJSON.mapping
.yaml_mapping
is nowYAML.mapping
- (breaking change)
StringIO
is nowMemoryIO
- Added
crystal tool format
that automatically formats your code protected
methods can now be invoked between types inside a same namespace- Removed
curses
, you can usehttps://github.com/jreinert/ncurses-crystal
to_unsafe
and numeric conversions are now also automatically performed in C struct and union fields- Added
{% begin %} ... {% end %}
as an alternative to{% if true %} ... {% end %}
- Added
~!
operator - Added debug metadata for char, float, bool and enums. Also for classes and structs (experimental)
Dir.glob
now works well with recursive patterns like**
(thanks @pgkos)- Added
read_timeout
andconnect_timeout
toHTTP::Client
(thanks @benoist) - Added
Zlib
(thanks @datanoise and @bcardiff) - Added
HTTP::DeflateHandler
(thanks @bcardiff) - Added
ENV#fetch
(thanks @tristil) Hash#new
now accepts an initialize capacity argumentHTTP::Request
provides access and mutation ofquery
,path
andquery_params
(thanks @waterlink)- Added
XML::Node#content=
and#name=
- Allow passing handlers and a block to an
HTTP::Server
(thanks @RX14) crystal init
now tries to use your github username if available (thanks @jreinert)- Added
Hash#select
,Hash#reject
and their bang variant, andHash#each_with_object
(thanks @devdazed) - Added
Hash#select(*keys)
andHash#reject(*keys)
and their bang variant (thanks @sdogruyol) - Added
Set#-
,Set#^
, andSet#subtract
(thanks @js-ojus) - Allow running specs without colors (thanks @rhysd)
- Added
TypeNode#has_constant?
andTypeNode#type_vars
in macros (thanks @jreinert) - Added
String#compare
that allows case insensitive comparisons - Added
File#truncate
(thanks @porras) CSV
is now a class for iterating rows, optionally with headers access- Allow setting multiple
before_request
callbacks to anHTTP::Client
- Added
Dir.cd(&block)
(thanks @rhysd) - Added
Class#cast
(thanks @will) - Fixes and additions to WebSocket, like the possibility of streaming data (thanks @jreinert)
- Added
SemanticVersion
class (thanks @technorama) loop
now yields a counter- Added
Array#[]=(index, count, value)
andArray#[]=(range, value)
- Added argless
sleep
IO#write(slice)
now writes the full slice or raises on error- Added some docs for ECR, Markdown, Hash, File, Time, Time::Span, Colorize, String, SecureRandom, YAML (thanks @adlerhsieh, @chdorner, @vjdhama, @rmosolgo)
- Many bug fixes
0.8.0
- (breaking change) Renamed a couple of types:
ChannelClosed
->Channel::ClosedError
,
UnbufferedChannel
->Channel::Unbuffered
,BufferedChannel
->Channel::Buffered
,
DayOfWeek
->Time::DayOfWeek
,MonthSpan
->Time::MonthSpan
,TimeSpan
->Time::Span
,
TimeFormat
->Time::Format
,EmptyEnumerable
->Enumerable::EmptyError
,SocketError
->Socket::Error
,
MatchData
->Regex::MatchData
,SignedInt
->Int::Signed
,UnsignedInt
->Int::Unsigned
,
FileDescriptorIO
->IO::FileDescriptor
,BufferedIO
->IO::Buffered
,CharReader
->Char::Reader
,
PointerAppender
->Pointer::Appender
. - (breaking change) All places that raised
DomainError
raiseArgumentError
now. - (breaking change) Renamed
Type.cast
toType.new
(for example,Int32.new
instead ofInt32.cast
) - (breaking change) Removed all macro instance variables except
@type
- (breaking change) Removed
undef
- (breaking change) Removed
length()
andcount()
methods from collections. The only method for this is nowsize
. - (breaking change) Removed the ability to invoke methods on a union class
- Improved debugger support
crystal deps
now delegates to shards. RemovedProjecfile
support.- Automatically convert numeric types when invoking C functions
- Automatically define questions methods for enum members
- Support quotes inside quoted symbols (thanks @wolflee)
- Allow marking
initialize
as private - Added
method_added
macro hook (thanks @makenowjust) - Added
ArrayLiteral#includes?(obj)
in macros - Added
ASTNode#symbolize
in macros (thanks @kirbyfan64) - Added experimental
yaml_mapping
- Added nilable variants to
Enumerable#max
,Enumerable#min
, and others (thanks @technorama) - Added
Iterator#flatten
(thanks @jpellerin) - Added setting a read timeout to
HTTP::Client
(thanks @benoist) - Added
Array#delete_at(index, count)
andArray#delete_at(range)
(thanks @tebakane) - Added
HTTP::Cookies
(thanks @netfeed) - Added
Tuple#reverse
(thanks @jhass) - Added
Number#clamp
(thanks @technorama) - Added serveral socket options (thanks @technorama)
- Added
WebSocket.open
(thanks @kumpelblase2) - Added
Enum.flags
macro - Added support for sending chunked content in HTTP server (thanks @bcardiff)
- Added
future
,lazy
anddelay
concurrency methods (thanks @technorama) fork
now returns aProcess
(thanks @technorama)- Documented
Set
, and added a couple of methods (thanks @will) - Nicer formatting in
Benchmark.ips
, and interactive mode (thanks @will) - The
-f
format output is now honored in compiler errors (thanks @kirbyfan64) - Fixed an ambiguity with the
crystal build
command (thanks @makenowjust) - Cast exceptions now raise
TypeCastError
instead ofException
(thanks @will) - Many bugs fixes
0.7.7
- (breaking change) Reimplemented
Process.run
to allow configuring input, output and error, as well as behaving well regarding non-blocking IO (thanks @technorama) - (breaking change) Removed the
alias_method
macro. - (breaking change) Disallow declaring defs, classes and other declarations "dynamically" (for example inside an
if
... this of course didn't work, but incorrectly compiled). - (breaking change)
require
is now only allowed at the top-level, never inside other types or methods. - (breaking change) Removed
Nil#to_i
- (breaking change) Changed API of
Channel#select
toward a thread-safe one. - (breaking change) The two methods that IO must implement are now
read(slice : Slice(UInt8))
andwrite(slice : Slice(UInt8))
. - New beautiful, searchable and more functional API docs. Thanks @rosylilly for the initial design, and @BlaXpirit for some improvements.
- CLI: Moved
browser
,hierarchy
andtypes
tocrystal tool ...
- Added
crystal tool context
andcrystal tool implementations
for IDEs (thanks @bcardiff!!) Int#>>(amount)
andInt#<<(amount)
now give zero whenamount
is greater than the number of bits of the integer representation.- Added
\%
escape sequence inside macros. - Added aliases for the many C types (thanks @BlaXpirit)
- Added
Iterator#in_groups_of
(thanks @PragTob) - Added optional
offset
argument toHash#each_with_index
(thanks @sergey-kucher) - Added
Array#combinations
,Array#each_combination
,Array#repeated_combinations
,Array#each_repeated_combination
,Array#repeated_permutations
,Array#each_repeated_permutation
,Array.product
andArray.each_product
(thanks @kostya) - Added
Array#rotate
andArray#rotate!
(thanks @kostya) - Added
MatchData#pre_match
andMatchData#post_match
(thanks @bjmllr) - Added
Array#flatten
- Added
Range.reverse_each
, along withInt#pred
andChar#pred
(thanks @BlaXpirit) - Added
XML.parse_html
(thanks @ryanworl) - Added
ENV.keys
andENV.values
(thanks @will) - Added
StaticArray==(other : StaticArray)
(thanks @tatey) - Added
String#sub
in many variants (thanks @jhass) - Added
Readline.bind_key
,Readline.unbind_key
,Readline.done
andReadline.done=
(thanks @daphee) - Added
Hash#all?
,Hash#any?
andHash#inject
(thanks @jreinert) - Added
File#pos
andFile#pos=
- Added
Enum.from_value
andEnum.from_value?
- Added
Deque
(thanks @BlaXpirit) - Added lots of methods to
StringScanner
, and documented it, making it usable (thanks @will) StringIO
now quacks like aFile
.- Allow sending masked data through a
WebSocket
, and sending long data (thanks @kumpelblase2) File.new
now accepts an optionalperm
argument (thanks @technorama)FileDescriptorIO
now has configurable read/write timeouts (thanks @technorama)- Signal handling is more robust and allows any kind of code (thanks @technorama)
- Correctly handle
WebSocket
close packet (thanks @bebac) - Correctly implement
seek
andtell
in buffered IOs (thanks @lbguilherme) - Allow setting several options on sockets (thanks @technorama)
- Some improvements to
crystal init
for the "app" case (thanks @krisleech) sleep
and IO timeouts can receiveTimeSpan
as arguments (thanks @BlaXpirit)- Handle
HTTP::Response
without content-length (thanks @lbguilherme) - Added docs for OptionParser, ENV, Regex, Enumerable, Iterator and some Array methods (thanks @porras, @will, @bjmllr, @PragTob, @decioferreira)
- Lots of bug fixes and small improvements
0.7.6
- (breaking change) removed support for trailing
while
/until
(read this) - (breaking change) Renamed
Enumerable#drop
toEnumerable#skip
- (breaking change) Renamed
Time.at
toTime.epoch
, andTime#to_i
andTime#to_f
toTime#epoch
andTime#epoch_f
- (breaking change)
inherited
macro now runs before a class' body - Renamed
--no-build
flag to--no-codegen
- Allow interpolations in heredocs (thanks @jessedoyle)
- Allow hash substitutions in
String#%
andsprintf
(thanks @zamith) - Added
SecureRandom.base64
,SecureRandom.urlsafe_base64
andSecureRandom.uuid
(thanks @ysbaddaden) - Added
File.link
,File.symlink
andFile.symlink?
(thanks @ysbaddaden) - Added
Enumerable#in_groups_of
(thanks @jalyna) - Added
Array#zip?
(thanks @yui-knk) - Added
Array#permutations
andArray#each_permutation
(thanks @jalyna and @kostya) - Added
IO#gets(limit : Int)
andIO#gets(delimiter : Char, limit : Int)
- Added
Iterator#compact_map
,Iterator#take_while
andIterator#skip_while
(thanks @PragTob) - Added
StringLiteral#to_i
macro method - Added
Crypto::Bcrypt
(thanks @akaufmann) - Added
Time.epoch_ms
andTime#epoch_ms
- Added
BitArray#toggle
andBitArray#invert
(thanks @will) - Fixed
IO#reopen
swapped semantic (thanks @technorama) - Many bug fixes and improvements
0.7.5
- (breaking change)
0
is not a prefix for octal numbers anymore. Use0o
- (breaking change) Renamed
MissingKey
toKeyError
- (breaking change) Renamed
IndexOutOfBounds
toIndexError
- Fixed all exception-handling related bugs.
- Allow nested and multiline ternary expressions (thanks @daviswahl)
- Allow assigning to
_
(underscore), give error when trying to read from it - Macros can now also receive the following nodes:
And
,Or
,Case
,RangeLiteral
andStringInterpolation
.And
andOr
haveleft
andright
methods. - Added
-e
option tohierarchy
command to filter types by a regex - Added
-v
as an alias of--version
- Added
-h
as an alias of--help
- Added
Array#transpose
(thanks @rhysd) - Added
Benchmark#ips
(thanks @will) - Added
Hash#merge(&block)
andHash#merge!(&block)
(thanks @yui-knk) - Added
Hash#invert
(thanks @yui-knk) - Added
Bool#^
(thanks @yui-knk) - Added
Enumerable#drop
,Enumerable#drop_while
andEnumerable#take_while
(thanks @PragTob) - Added
Enumerable#none?
(thanks @yui-knk) - Added
Set#subset?
,Set#superset?
andSet#intersects?
(thanks @yui-knk) - Added
Set#new(Enumerable)
(thanks @yui-knk) - Added
String#succ
(thanks @porras and @exilor) - Added
Array#*
(thanks @porras) - Added
Char#===(Int)
andInt#===(Char)
(thanks @will) - Added
StringLiteral#camelcase
andStringLiteral#underscore
in macros - Added
Expressions#expressions
in macros - Added
Cast#obj
andCast#to
in macros - Added
ASTNode#class_name
in macros (thanks @yui-knk) - Added
Array#push
/Array#<<
andArray#unshift
in macros (thanks @ysbaddaden) - Added
Def#visibility
in macros (thanks @ysbaddaden) - Added
String#codepoints
andString#each_codepoint
(thanks @jhass) Char#to_i(base)
now supports bases from 2 to 36Set#|
now correctly accepts a set of a possible different type (thanks @yui-knk)- Flush
STDERR
on exit (thanks @jbbarth) HTTP::Client
methods accept an optional block, which will yield anHTTP::Response
with a non-nilbody_io
property to consume the response's IO- Document
URI
,UDPSocket
(thanks @davydovanton) - Improved
URI
class (thanks @will) - Define
$~
inString#gsub
andString#scan
- Define
$?
inProcess.run
- Lots of bug fixes and small improvements
0.7.4
- Added Float module and remainder (thanks @wmoxam)
- Show elapsed time in HTTP::LogHandler (thanks @zamith for the suggestion)
- Added
0o
as a prefix for octal numbers (thanks @asb) - Allow spaces before the closing tag of a heredoc (thanks @zamith)
String#split(Regex)
now includes captures in the results- Added
union?
,union_types
andtype_params
in macro methods - Improved
MatchData#to_s
to show named groups (thanks @will) - Optimized Base64 encode/decode (thanks @kostya)
- Added basic docs for spec (thanks @PragTob)
- Added docs for Benchmark (thanks @daneb)
- Added
ARGF
- Non-matching regex captures now return
nil
instead of an empty string (thanks @will) - Added
$1?
,$2?
, etc., as a nilable alternative to$1
,$2
, etc. - Added user, password, fragment and opaque to URI (thanks @will)
HTTP::Client.exec
now honors user/password info from URI- Set default user agent in
HTTP::Client
- Added
String#chop
- Fixed
crystal deps
behaviour with empty git repositories (thanks @tkrajcar) - Optimized
HTTP::Headers
andHTTP::Request
parsing. FileDescriptorIO
(superclass ofFile
andSocket
) has now buffering capabilities (usesync=
andsync?
to turn on/off). That means there's no need to useBufferedIO
for these classes anymore.- Allow
pointerof
with class and global variables, and alsofoo.@bar
access - Optimized fibers performance.
- Added inline assembly support.
- The
.crystal
cache dir is now configurable with an ENV variable (thanks @jhass) - Generic type variables names can now also be a single letter followed by a digit.
0.7.3
- Added
Tuple.from_json
andTuple.to_json
- The
method_missing
macro now accepts a 1 argument variant that is a Call node. The 3 arguments variant will be deprecated. - Flush STDOUT at program exit (fixes
print
not showing any output) - Added
Time#to_utc
andTime#to_local
(thanks @datanoise) - Time comparison is now correct when comparing local vs. utc times
- Support timezone offsets in Time parsing and formatting
- Added
IO#gets(delimiter : String)
- Added
String#chomp(Char)
andString#chomp(String)
- Allow invoking
debug()
inside a macro to see what's being generated. IO#puts
andIO#print
now receive a splat (thanks @rhysd)- Added
Process.kill
andProcess.getpgid
(thanks @barachy) Signal
is now an enum. Use it likeSignal::INT.trap { ... }
instead ofSignal.trap(Signal::INT) { ... }
- Added
CSV.each_row
(both in block and iterator forms) - Important fixes to non-blocking IO logic.
0.7.2
- Improved performance of
Regex
- Fixed lexing of octal characters and strings (thanks @rhysd)
- Time.parse can return UTC times (thanks @will)
- Handle dashes in
crystal init
(thanks @niftyn8) - Generic type varaibles can now only be single letters (T, U, A, B, etc.)
- Support
%x
and%X
insprintf
(thanks @yyyc514) - Optimized
Int#to_s
(thanks @yyyc514) - Added
upcase
option toInt#to_s
, and use downcase by default. - Improved
String#to_i
and fixed the many variants (to_i8
,to_u64
, etc.) - Added
Time.at
(thanks @jeromegn) - Added
Int#upto
,Int#downto
,Int#to
iterators. - Added
Iterator#cons
andEnumerable#each_cons
(thanks @porras) - Added
Iterator.of
,Iterator#chain
andIterator#tap
. - Allow top-level
private macro
(similar to top-levelprivate def
) - Optimized
BufferedIO
writing performance and memory usage. - Added
Channel#close
,Channel#closed?
,Channel#receive?
and allow them to send/receive nil values (thanks @datanoise). - Fixed
Process#run
after introducing non-blocking IO (thanks @will) Tuple#map
now returns aTuple
(previously it returned anArray
)Tuple#class
now returns a properClass
(previously it returned aTuple
of classes)- Lots of bug fixes.