1
0
Fork 0
mirror of https://github.com/edgurgel/httparrot synced 2025-04-05 08:12:31 -04:00

Update to Elixir 0.13.1

This commit is contained in:
Eduardo Gurgel 2014-04-27 13:57:26 +12:00
parent 757c9f3d70
commit 6978ab9a59
6 changed files with 20 additions and 17 deletions

View file

@ -1,15 +1,18 @@
language: erlang
notifications:
recipients:
- eduardo@gurgel.me
otp_release:
- R16B
- R16B01
- R16B02
script: mix test --no-start
install: mix deps.get
before_install:
- wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
- sudo dpkg -i erlang-solutions_1.0_all.deb
- sudo apt-get update
- sudo apt-get install erlang
- mkdir -p vendor/elixir
- wget -q https://github.com/elixir-lang/elixir/releases/download/v0.12.4/Precompiled.zip && unzip -qq Precompiled.zip -d vendor/elixir
- wget -q https://github.com/elixir-lang/elixir/releases/download/v0.13.1/Precompiled.zip && unzip -qq Precompiled.zip -d vendor/elixir
- wget -q https://github.com/rebar/rebar/wiki/rebar
- cp rebar vendor/elixir/bin
- chmod +x vendor/elixir/bin/rebar
- export PATH="$PATH:$PWD/vendor/elixir/bin"
- rebar --version
- export MIX_ENV=test

View file

@ -53,7 +53,7 @@ defmodule HTTParrot do
def prettify_json(status, headers, body, req) do
if JSEX.is_json? body do
body = JSEX.prettify!(body)
headers = ListDict.put(headers, "content-length", integer_to_list(String.length(body)))
headers = List.keystore(headers, "content-length", 0, {"content-length", integer_to_list(String.length(body))})
{:ok, req} = :cowboy_req.reply(status, headers, body, req)
end
req

View file

@ -16,7 +16,7 @@ defmodule HTTParrot.SetCookiesHandler do
{name, req} = :cowboy_req.binding(:name, req, nil)
if name do
{value, req} = :cowboy_req.binding(:value, req, nil)
{false, req, Dict.merge([{name, value}], qs_vals)}
{false, req, List.keystore(qs_vals, name, 0, {name, value})}
else
if Enum.empty?(qs_vals), do: {true, req, state}, else: {false, req, qs_vals}
end

View file

@ -5,7 +5,7 @@ defmodule Httparrot.Mixfile do
[ app: :httparrot,
version: "0.1.0",
name: "HTTParrot",
elixir: "~> 0.12.4",
elixir: "~> 0.13.1",
deps: deps(Mix.env) ]
end
@ -20,12 +20,12 @@ defmodule Httparrot.Mixfile do
defp deps(:dev) do
[ {:cowboy, github: "extend/cowboy", tag: "0.9.0" },
{:jsex, github: "talentdeficit/jsex" } ]
{:jsex, github: "talentdeficit/jsex", tag: "v1.0.2" } ]
end
defp deps(:test) do
deps(:dev) ++
[ {:meck, github: "eproxus/meck", tag: "0.8.1" } ]
[ {:meck, github: "eproxus/meck", ref: "69f02255a8219185bf55da303981d86886b3c24b" } ]
end
defp deps(_), do: deps(:dev)

View file

@ -1,6 +1,6 @@
[ "cowboy": {:git, "git://github.com/extend/cowboy.git", "db52494371ea249f38d51108c7d79cf487ff6374", [tag: "0.9.0"]},
%{"cowboy": {:git, "git://github.com/extend/cowboy.git", "db52494371ea249f38d51108c7d79cf487ff6374", [tag: "0.9.0"]},
"cowlib": {:git, "git://github.com/extend/cowlib.git", "63298e8e160031a70efff86a1acde7e7db1fcda6", [ref: "0.4.0"]},
"jsex": {:git, "git://github.com/talentdeficit/jsex.git", "65aa6ae7c1543a0c4e83032c04626af7be7a7f3e", []},
"jsx": {:git, "git://github.com/talentdeficit/jsx.git", "e50af6e109cb03bd26acf715cbc77de746507d1d", [tag: "v1.4.3"]},
"meck": {:git, "git://github.com/eproxus/meck.git", "1286aba1cb6bbd6c9fc3f817740758b224843ee7", [tag: "0.8.1"]},
"ranch": {:git, "git://github.com/extend/ranch.git", "5df1f222f94e08abdcab7084f5e13027143cc222", [ref: "0.9.0"]} ]
"jsex": {:git, "git://github.com/talentdeficit/jsex.git", "8a92e26180cb11c858130f9693a195a0fad1ecf9", [tag: "v1.0.2"]},
"jsx": {:git, "git://github.com/talentdeficit/jsx.git", "507fa4c41db33c81e925ab53f4d789d234aaff2f", [tag: "v2.0.1"]},
"meck": {:git, "git://github.com/eproxus/meck.git", "69f02255a8219185bf55da303981d86886b3c24b", [ref: "69f02255a8219185bf55da303981d86886b3c24b"]},
"ranch": {:git, "git://github.com/extend/ranch.git", "5df1f222f94e08abdcab7084f5e13027143cc222", [ref: "0.9.0"]}}

View file

@ -26,7 +26,7 @@ defmodule HTTParrot.SetCookiesHandlerTest do
expect(:cowboy_req, :binding, [{[:name, :req2, nil], {"name", :req3}},
{[:value, :req3, nil], {"value", :req4}}])
assert malformed_request(:req1, :state) == {false, :req4, [{"name", "value2"}]}
assert malformed_request(:req1, :state) == {false, :req4, [{"name", "value"}]}
assert validate :cowboy_req
end