diff --git a/README b/README index a65aaa08..17e38a69 100644 --- a/README +++ b/README @@ -38,9 +38,10 @@ Hostname defaults to "ec2.amazonaws.com". Then you can simply call, e.g. erlcloud_ec2:describe_images(). You don't need to call erlcloud_ec2:configure() if you provide your credentials -in the AMAZON_ACCESS_KEY_ID and AMAZON_SECRET_ACCESS_KEY environmental -variables. +in the environmental variables +> AWS_ACCESS_KEY_ID +> AWS_SECRET_ACCESS_KEY Configuration object usage: @@ -55,3 +56,12 @@ For usage information, consult the source code and refer to the API reference at - http://docs.amazonwebservices.com/AWSEC2/2009-11-30/APIReference/ - http://docs.amazonwebservices.com/AmazonS3/2006-03-01/API/ - http://docs.amazonwebservices.com/AmazonSimpleDB/latest/DeveloperGuide/ + +Roadmap +------- + +v0.8.0 +* Existing code + +v1.0.0 +* Refactored code for better return values (issue #7) diff --git a/package.exs b/package.exs new file mode 100644 index 00000000..05f6c596 --- /dev/null +++ b/package.exs @@ -0,0 +1,5 @@ +Expm.Package.new(name: "erlcloud", description: "Cloud Computing library for Erlang (Amazon EC2, S3, SQS, SimpleDB, Mechanical Turk, ELB) ", + version: "0.8.0", keywords: ["cloud", "api", "amazon", "ec2", "s3", "sqs"], + maintainers: [[name: "Gleb Peregud", + email: "gleber.p@gmail.com"]], + repositories: [[github: "gleber/erlcloud"]]) \ No newline at end of file diff --git a/src/erlcloud.app.src b/src/erlcloud.app.src index 91678f60..3838924f 100644 --- a/src/erlcloud.app.src +++ b/src/erlcloud.app.src @@ -8,8 +8,8 @@ {applications, [stdlib, kernel, sasl, - public_key, crypto, + public_key, ssl, xmerl, inets]}, diff --git a/src/erlcloud.erl b/src/erlcloud.erl index 884dea45..7fd98d41 100644 --- a/src/erlcloud.erl +++ b/src/erlcloud.erl @@ -6,5 +6,5 @@ start() -> application:load(?APP), {ok, Apps} = application:get_key(?APP, applications), - lists:foreach(fun application:start/1, Apps), + [application:start(App) || App <- Apps], application:start(?APP). diff --git a/src/erlcloud_s3.erl b/src/erlcloud_s3.erl index 38d7e824..60162d00 100644 --- a/src/erlcloud_s3.erl +++ b/src/erlcloud_s3.erl @@ -439,7 +439,7 @@ get_object_metadata(BucketName, Key, Options, Config) -> {version_id, proplists:get_value("x-amz-version-id", Headers, "false")}|extract_metadata(Headers)]. extract_metadata(Headers) -> - [{Key, Value} || {["x-amz-meta-"|Key], Value} <- Headers]. + [{Key, Value} || {Key = "x-amz-meta-" ++ _, Value} <- Headers]. -spec get_object_torrent(string(), string()) -> proplist(). @@ -547,7 +547,7 @@ put_object(BucketName, Key, Value, Options, HTTPHeaders, Config) when is_list(BucketName), is_list(Key), is_list(Value) orelse is_binary(Value), is_list(Options) -> RequestHeaders = [{"x-amz-acl", encode_acl(proplists:get_value(acl, Options))}|HTTPHeaders] - ++ [{["x-amz-meta-"|string:to_lower(MKey)], MValue} || + ++ [{"x-amz-meta-" ++ string:to_lower(MKey), MValue} || {MKey, MValue} <- proplists:get_value(meta, Options, [])], ContentType = proplists:get_value("content-type", HTTPHeaders, "application/octet_stream"), POSTData = {iolist_to_binary(Value), ContentType},