icyleaf / halite

💎HTTP Requests Client with a chainable REST API, built-in sessions and middlewares.
MIT License
170 stars 13 forks source link

Some errors when building against crystal HEAD #6

Closed bararchy closed 7 years ago

bararchy commented 7 years ago
in src/protocols/http/crawler.cr:33: instantiating 'Halite::Client:Class#new()'

        client = Halite::Client.new
                                ^~~

in lib/halite/src/halite/client.cr:42: instantiating 'Halite::Options:Class#new()'

    def initialize(@options : Halite::Options = Options.new)
                                                        ^~~

in lib/halite/src/halite/options.cr:30: instantiating 'parse_headers(Hash(String, Nil))'

      @headers = parse_headers(options).merge!(default_headers)
                 ^~~~~~~~~~~~~

in lib/halite/src/halite/options.cr:171: no overload matches 'HTTP::Headers.escape' with type Nil
Overloads are:
 - Halite::Ext::HTTPHeaders::Escape#escape(data : Hash(String, _) | NamedTuple)

        HTTP::Headers.escape(headers)
                      ^~~~~~
icyleaf commented 7 years ago

Added new test, It passed. What's your code to use?

Test: https://github.com/icyleaf/halite/blob/master/spec/halite_spec.cr#L14

Result: https://circleci.com/gh/icyleaf/halite/96

bararchy commented 7 years ago

I'm using crystal master , not 0.23.1 , this error started when I switched so it might happen only with latest crystal master .

This means that when 0.24 will be out this issue will also happen , so better we try and tackle now ?

icyleaf commented 7 years ago

It works, please update to HEAD version.

bararchy commented 7 years ago

@icyleaf Verified working, thank you :)