Skip to content

Releases: crystal-lang/crystal

0.9.1

30 Oct 04:12
Compare
Choose a tag to compare
  • Docs search now finds nested entries (thanks @adlerhsieh)
  • Many corrections and changes to the formatter, for better consistency and less obtrusion.
  • Added OpenSSL::Cipher and OpenSSL::Digest (thanks @benoist)
  • Added Char#+(String) (thanks @hangyas)
  • Added Hash#key and Hash#key? (thanks @adlerhsieh)
  • Added Time::Span#* and Time::Span#/ (thanks @jbaum98)
  • Added Slice#reverse_each (thanks @omninonsense)
  • Added docs for Random and Tempfile (thanks @adlerhsieh)
  • Fixed some bugs.

0.9.0

16 Oct 21:25
Compare
Choose a tag to compare
  • (breaking change) The CGI module's funcionality has been moved to URI and HTTP::Params
  • (breaking change) IO#read() is now IO#gets_to_end. Removed IO#read(count), added IO#skip(count)
  • (breaking change) json_mapping is now JSON.mapping. yaml_mapping is now YAML.mapping
  • (breaking change) StringIO is now MemoryIO
  • 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 use https://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 and connect_timeout to HTTP::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 argument
  • HTTP::Request provides access and mutation of query, path and query_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, and Hash#each_with_object (thanks @devdazed)
  • Added Hash#select(*keys) and Hash#reject(*keys) and their bang variant (thanks @sdogruyol)
  • Added Set#-, Set#^, and Set#subtract (thanks @js-ojus)
  • Allow running specs without colors (thanks @rhysd)
  • Added TypeNode#has_constant? and TypeNode#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 an HTTP::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) and Array#[]=(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

19 Sep 12:43
Compare
Choose a tag to compare
  • (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 raise ArgumentError now.
  • (breaking change) Renamed Type.cast to Type.new (for example, Int32.new instead of Int32.cast)
  • (breaking change) Removed all macro instance variables except @type
  • (breaking change) Removed undef
  • (breaking change) Removed length() and count() methods from collections. The only method for this is now size.
  • (breaking change) Removed the ability to invoke methods on a union class
  • Improved debugger support
  • crystal deps now delegates to shards. Removed Projecfile 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) and Array#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 and delay concurrency methods (thanks @technorama)
  • fork now returns a Process (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 of Exception (thanks @will)
  • Many bugs fixes

0.7.7

05 Sep 03:08
Compare
Choose a tag to compare
  • (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)) and write(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 and types to crystal tool ...
  • Added crystal tool context and crystal tool implementations for IDEs (thanks @bcardiff!!)
  • Int#>>(amount) and Int#<<(amount) now give zero when amount 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 to Hash#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 and Array.each_product (thanks @kostya)
  • Added Array#rotate and Array#rotate! (thanks @kostya)
  • Added MatchData#pre_match and MatchData#post_match (thanks @bjmllr)
  • Added Array#flatten
  • Added Range.reverse_each, along with Int#pred and Char#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 and Readline.done= (thanks @daphee)
  • Added Hash#all?, Hash#any? and Hash#inject (thanks @jreinert)
  • Added File#pos and File#pos=
  • Added Enum.from_value and Enum.from_value?
  • Added Deque (thanks @BlaXpirit)
  • Added lots of methods to StringScanner, and documented it, making it usable (thanks @will)
  • StringIO now quacks like a File.
  • Allow sending masked data through a WebSocket, and sending long data (thanks @kumpelblase2)
  • File.new now accepts an optional perm 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 and tell 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 receive TimeSpan 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

13 Aug 22:08
Compare
Choose a tag to compare
  • (breaking change) removed support for trailing while/until (read this)
  • (breaking change) Renamed Enumerable#drop to Enumerable#skip
  • (breaking change) Renamed Time.at to Time.epoch, and Time#to_i and Time#to_f to Time#epoch and Time#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#% and sprintf (thanks @zamith)
  • Added SecureRandom.base64, SecureRandom.urlsafe_base64 and SecureRandom.uuid (thanks @ysbaddaden)
  • Added File.link, File.symlink and File.symlink? (thanks @ysbaddaden)
  • Added Enumerable#in_groups_of (thanks @jalyna)
  • Added Array#zip? (thanks @yui-knk)
  • Added Array#permutations and Array#each_permutation (thanks @jalyna and @kostya)
  • Added IO#gets(limit : Int) and IO#gets(delimiter : Char, limit : Int)
  • Added Iterator#compact_map, Iterator#take_while and Iterator#skip_while (thanks @PragTob)
  • Added StringLiteral#to_i macro method
  • Added Crypto::Bcrypt (thanks @akaufmann)
  • Added Time.epoch_ms and Time#epoch_ms
  • Added BitArray#toggle and BitArray#invert (thanks @will)
  • Fixed IO#reopen swapped semantic (thanks @technorama)
  • Many bug fixes and improvements

0.7.5

30 Jul 17:42
Compare
Choose a tag to compare
  • (breaking change) 0 is not a prefix for octal numbers anymore. Use 0o
  • (breaking change) Renamed MissingKey to KeyError
  • (breaking change) Renamed IndexOutOfBounds to IndexError
  • 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 and StringInterpolation. And and Or have left and right methods.
  • Added -e option to hierarchy 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) and Hash#merge!(&block) (thanks @yui-knk)
  • Added Hash#invert (thanks @yui-knk)
  • Added Bool#^ (thanks @yui-knk)
  • Added Enumerable#drop, Enumerable#drop_while and Enumerable#take_while (thanks @PragTob)
  • Added Enumerable#none? (thanks @yui-knk)
  • Added Set#subset?, Set#superset? and Set#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) and Int#===(Char) (thanks @will)
  • Added StringLiteral#camelcase and StringLiteral#underscore in macros
  • Added Expressions#expressions in macros
  • Added Cast#obj and Cast#to in macros
  • Added ASTNode#class_name in macros (thanks @yui-knk)
  • Added Array#push/Array#<< and Array#unshift in macros (thanks @ysbaddaden)
  • Added Def#visibility in macros (thanks @ysbaddaden)
  • Added String#codepoints and String#each_codepoint (thanks @jhass)
  • Char#to_i(base) now supports bases from 2 to 36
  • Set#| 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 an HTTP::Response with a non-nil body_io property to consume the response's IO
  • Document URI, UDPSocket (thanks @davydovanton)
  • Improved URI class (thanks @will)
  • Define $~ in String#gsub and String#scan
  • Define $? in Process.run
  • Lots of bug fixes and small improvements

0.7.4

24 Jun 01:22
Compare
Choose a tag to compare
  • 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 and type_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 and HTTP::Request parsing.
  • FileDescriptorIO (superclass of File and Socket) has now buffering capabilities (use sync= and sync? to turn on/off). That means there's no need to use BufferedIO for these classes anymore.
  • Allow pointerof with class and global variables, and also foo.@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

07 Jun 16:47
Compare
Choose a tag to compare
  • Added Tuple.from_json and Tuple.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 and Time#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) and String#chomp(String)
  • Allow invoking debug() inside a macro to see what's being generated.
  • IO#puts and IO#print now receive a splat (thanks @rhysd)
  • Added Process.kill and Process.getpgid (thanks @barachy)
  • Signal is now an enum. Use it like Signal::INT.trap { ... } instead of Signal.trap(Signal::INT) { ... }
  • Added CSV.each_row (both in block and iterator forms)
  • Important fixes to non-blocking IO logic.

0.7.2

26 May 16:56
Compare
Choose a tag to compare
  • 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 in sprintf (thanks @yyyc514)
  • Optimized Int#to_s (thanks @yyyc514)
  • Added upcase option to Int#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 and Enumerable#each_cons (thanks @porras)
  • Added Iterator.of, Iterator#chain and Iterator#tap.
  • Allow top-level private macro (similar to top-level private 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 a Tuple (previously it returned an Array)
  • Tuple#class now returns a proper Class (previously it returned a Tuple of classes)
  • Lots of bug fixes.

0.7.1

01 May 01:23
Compare
Choose a tag to compare