diff --git a/.github/workflows/crystal.yml b/.github/workflows/crystal.yml index 23f382d..4c06b3f 100644 --- a/.github/workflows/crystal.yml +++ b/.github/workflows/crystal.yml @@ -18,10 +18,18 @@ jobs: run: crystal tool format --check test: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - { os: ubuntu-latest } + - { os: windows-latest } + runs-on: ${{ matrix.os }} steps: - name: Install Crystal uses: crystal-lang/install-crystal@v1 + with: + crystal: ${{ matrix.crystal }} - name: Check out repository code uses: actions/checkout@v4 - name: Install dependencies diff --git a/src/ipapi.cr b/src/ipapi.cr index 3d800da..3422c86 100644 --- a/src/ipapi.cr +++ b/src/ipapi.cr @@ -38,7 +38,7 @@ module Ipapi # Retrive the location of a specific IP address. # If `ip_address` is `nil`, use the client's IP. def locate(ip_address : String? = nil) : Location? - url = Path.new([API_URL, ip_address, "json"].compact).to_s + url = Path.posix([API_URL, ip_address, "json"].compact).to_s url = url + "?key=#{@api_key}" if @api_key response = HTTP::Client.get(url) @@ -50,7 +50,7 @@ module Ipapi # Retrive {{description.id}} of a specific IP address. # If `ip_address` is `nil`, use the client's IP. def {{field.id}}(ip_address : String? = nil) : String - url = Path.new([API_URL, ip_address, "{{field.id}}"].compact).to_s + url = Path.posix([API_URL, ip_address, "{{field.id}}"].compact).to_s url = url + "?key=#{@api_key}" if @api_key