From 5c9dcbdf10ae311d99f9e79e041da70a9b0ddd6b Mon Sep 17 00:00:00 2001 From: Adam Kittelson Date: Wed, 29 Apr 2015 11:43:57 -0500 Subject: [PATCH] fix fetching library version for request headers --- README.md | 2 +- lib/zencoder/resource.ex | 4 +++- mix.exs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6306693..2854111 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Install the [Hex.pm](http://hex.pm) package ```elixir def deps do [ - {:zencoder, "~> 1.0.0"}, + {:zencoder, "~> 1.0.1"}, {:ibrowse, github: "cmullaparthi/ibrowse", tag: "v4.1.0"}, ] end diff --git a/lib/zencoder/resource.ex b/lib/zencoder/resource.ex index ea4ebc9..9734392 100644 --- a/lib/zencoder/resource.ex +++ b/lib/zencoder/resource.ex @@ -20,11 +20,13 @@ defmodule Zencoder.Resource do end def headers(options) do + {:ok, version} = :application.get_key(:zencoder, :vsn) + [ {"Accept", "application/json"}, {"Content-Type", "application/json"}, {"Zencoder-Api-Key", options[:api_key] || Zencoder.api_key}, - {"User-Agent", "Zencoder-Elixir v#{Zencoder.Mixfile.project[:version]}"} + {"User-Agent", "Zencoder-Elixir v#{version}"} ] end diff --git a/mix.exs b/mix.exs index bedf111..b236d1f 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Zencoder.Mixfile do def project do [ app: :zencoder, - version: "1.0.0", + version: "1.0.1", elixir: "~> 1.0.0", test_coverage: [tool: ExCoveralls], deps: deps,