Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Used by "mix format"
[
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"]
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
]
27 changes: 23 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
/_build
/cover
/deps
# The directory Mix will write compiled artifacts to.
/_build/

# If you run "mix test --cover", coverage assets end up here.
/cover/

# The directory Mix downloads your dependencies sources to.
/deps/

# Where third-party dependencies like ExDoc output generated docs.
/doc/

# Ignore .fetch files in case you like to edit your project deps locally.
/.fetch

# If the VM crashes, it generates a dump, let's ignore it too.
erl_crash.dump

# Also ignore archive artifacts (built via "mix archive.build").
*.ez

/.elixir_ls
# Ignore package tarball (built via "mix hex.build").
cloudex-*.tar

# Temporary files, for example, from tests.
/tmp/
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# 1.4.1 (2020-03-01)
- Thanks @tonnenpinguin for adding options to delete private images like: `Cloudex.delete(public_id, %{resource_type: "image", type: "private"})`

# 1.4.0 (2020-02-27)
- Thanks @davepersing to Allow S3 paths to be passed to Cloudinary when using a private bucket.
- Thanks @saicoder for bumping httpoison and timex


## 1.3.0 (2019-06-07)

Expand Down
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Cloudex
======

[![](https://img.shields.io/hexpm/v/cloudex.svg)](https://hex.pm/packages/cloudex) ![](https://img.shields.io/hexpm/dt/cloudex.svg) ![](https://img.shields.io/hexpm/dw/cloudex.svg) ![](https://img.shields.io/coveralls/smeevil/cloudex.svg) [![](https://img.shields.io/github/issues/smeevil/cloudex.svg)](https://github.com/smeevil/cloudex/issues) [![](https://img.shields.io/github/issues-pr/smeevil/cloudex.svg)](https://github.com/smeevil/cloudex/pulls) ![](https://semaphoreci.com/api/v1/smeevil/cloudex/branches/master/shields_badge.svg)

Cloudex is an Elixir library that can upload image files or urls to Cloudinary.
Expand All @@ -9,11 +10,13 @@ There is also a [CLI tool](https://github.com/smeevil/cloudex_cli) available.

```elixir
defp deps do
[ {:cloudex, "~> 1.3.0"}, ]
[
{:cloudex, "~> 1.3.0"},
]
end
```

If you are using elixir 1.4, you can skip this step.
If you are using Elixir 1.4 onwards, you can skip this step.
The Cloudex app must be started. This can be done by adding :cloudex to
the applications list in your mix.exs file. An example:

Expand All @@ -30,13 +33,13 @@ Cloudex requires the API credentials of your Cloudinary account.
You can define either as ENV settings using the keys :
```CLOUDEX_API_KEY``` ```CLOUDEX_SECRET``` and ```CLOUDEX_CLOUD_NAME```

or in your config.exs using :
or in your config.exs using:

```elixir
config :cloudex,
api_key: "my-api-key",
secret: "my-secret",
cloud_name: "my-cloud-name"
config :cloudex,
api_key: "my-api-key",
secret: "my-secret",
cloud_name: "my-cloud-name"
```

[Jason](http://github.com/michalmuskala/jason) is the default json library in Cloudex. You can configure Cloudex to use another library. For example:
Expand All @@ -45,23 +48,25 @@ or in your config.exs using :
config :cloudex, :json_library, YourLibraryOfChoice
```


## Uploading
You can upload image files or urls pointing to an image as follows :

### example

For uploading a url :
```elixir
iex> Cloudex.upload("http://example.org/test.jpg")
{:ok, %Cloudex.UploadedImage{...}}
```

For uploading a file :

```elixir
iex> Cloudex.upload("test/assets/test.jpg")
{:ok, %Cloudex.UploadedImage{...}}
```
You can also upload a list of files, urls, or mix by giving upload a list like :

```elixir
iex> Cloudex.upload(["/non/existing/file.jpg", "http://example.org/test.jpg"])
[{:error, "File /non/existing/file.jpg does not exist."}, {:ok, %Cloudex.UploadedImage{...}}]
Expand Down Expand Up @@ -241,6 +246,8 @@ cl_image_tag(public_id, class: "thumbnail", transforms: %{opacity: "50", quality

Documentation can be found at docs/index.html or [online](http://smeevil.github.io/cloudex)

## License
## Copyright and License

Copyright (C) 2004 Sam Hocevar <[email protected]>

The Cloudex Elixir library is released under the DWTFYW license. See the LICENSE file.
The Cloudex Elixir library is released under the DWTFYW license. See the [LICENSE](./LICENSE.md) file.
25 changes: 14 additions & 11 deletions doc/.build
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
dist/search_items-23c2256b54.js
dist/html-d9f58a6320b5bfa6dd77.css
dist/html-d9f58a6320b5bfa6dd77.js
dist/html/fonts/icomoon.eot
dist/html/fonts/icomoon.svg
dist/html/fonts/icomoon.ttf
dist/html/fonts/icomoon.woff
dist/sidebar_items-e72aa6586e.js
api-reference.html
search.html
404.html
Cloudex.html
Cloudex.CloudinaryApi.html
Cloudex.DeletedImage.html
Cloudex.EnvOptions.html
Cloudex.Settings.html
Cloudex.UploadedImage.html
Cloudex.Url.html
Cloudex.html
api-reference.html
changelog.html
dist/app-f27ff079945e43879c46.js
dist/elixir-a172fe91e725dcb259e2.css
dist/html/fonts/icomoon.eot
dist/html/fonts/icomoon.svg
dist/html/fonts/icomoon.ttf
dist/html/fonts/icomoon.woff
dist/search_items-61899aea40.js
dist/sidebar_items-f23759e08f.js
index.html
license.html
readme.html
search.html
81 changes: 54 additions & 27 deletions doc/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,30 @@
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="ExDoc v0.20.2">
<meta name="project" content="cloudex v1.3.0">
<title>404 — cloudex v1.3.0</title>
<link rel="stylesheet" href="dist/html-d9f58a6320b5bfa6dd77.css" />
<script src="dist/sidebar_items-e72aa6586e.js"></script>
<meta name="generator" content="ExDoc v0.25.1">
<meta name="project" content="cloudex v1.4.1">

<title>404 — cloudex v1.4.1</title>
<link rel="stylesheet" href="dist/elixir-a172fe91e725dcb259e2.css" />

<script src="dist/sidebar_items-f23759e08f.js"></script>

<script src="docs_config.js"></script>
<script async src="dist/html-d9f58a6320b5bfa6dd77.js"></script>


<script async src="dist/app-f27ff079945e43879c46.js"></script>


</head>
<body data-type="extras">
<script>try { if(localStorage.getItem('night-mode')) document.body.className += ' night-mode'; } catch (e) { }</script>
<script>

try {
if (localStorage.getItem('night-mode') === 'true') {
document.body.classList.add('night-mode');
}
} catch (error) { }
</script>

<div class="main">

<button class="sidebar-button sidebar-toggle">
Expand All @@ -23,14 +36,14 @@

<section class="sidebar">
<form class="sidebar-search" action="search.html">
<button type="submit" class="search-button">
<span class="icon-search" aria-hidden="true"></span>
<button type="submit" class="search-button" aria-label="Submit Search">
<span class="icon-search" aria-hidden="true" title="Submit search"></span>
</button>
<button type="button" tabindex="-1" class="search-close-button">
<span class="icon-cross" title="Cancel search"></span>
<button type="button" tabindex="-1" class="search-close-button" aria-label="Cancel Search">
<span class="icon-cross" aria-hidden="true" title="Cancel search"></span>
</button>
<label class="search-label">
<input name="q" type="text" id="search-list" class="search-input" placeholder="Search..." aria-label="Search" autocomplete="off" />
<input name="q" type="text" class="search-input" placeholder="Search..." aria-label="Input your search terms" autocomplete="off" />
</label>
</form>

Expand All @@ -41,18 +54,20 @@

<div class="sidebar-header">
<div class="sidebar-projectDetails">
<a href="api-reference.html" class="sidebar-projectName">
cloudex </a>
<h2 class="sidebar-projectVersion">
v1.3.0
</h2>
<a href="readme.html" class="sidebar-projectName">
cloudex
</a>
<strong class="sidebar-projectVersion">
v1.4.1
</strong>
</div>

</div>

<ul class="sidebar-listNav">
<li><a id="extras-list" href="#full-list">Pages</a></li>
<li><a id="extras-list-link" href="#full-list">Pages</a></li>

<li><a id="modules-list" href="#full-list">Modules</a></li>
<li><a id="modules-list-link" href="#full-list">Modules</a></li>


</ul>
Expand All @@ -64,38 +79,50 @@ <h2 class="sidebar-projectVersion">
<div class="content-outer">
<div id="content" class="content-inner">


<h2>Page not found</h2>

<p>Sorry, but the page you were trying to get to, does not exist. You
may want to try searching this site using the sidebar

or using our <a href="api-reference.html">API Reference</a> page
to find what you were looking for.</p>

to find what you were looking for.</p>
<footer class="footer">
<p>
<span class="line">
Built using
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.20.2),
<a href="https://github.com/elixir-lang/ex_doc" title="ExDoc" target="_blank" rel="help noopener">ExDoc</a> (v0.25.1) for the
<a href="https://elixir-lang.org" title="Elixir" target="_blank">Elixir programming language</a>.
</span>
<span class="line">
designed by
Designed by
<a href="https://twitter.com/dignifiedquire" target="_blank" rel="noopener" title="@dignifiedquire">Friedel Ziegelmayer</a>.
</span>
</p>
<p>

<a href="api-reference.html" title="API reference" class="line footer-button">API Reference</a>

<button class="line footer-button display-shortcuts-help">
Display keyboard shortcuts
</button>
<button class="line footer-button night-mode-toggle">
Toggle night mode
</button>
<button class="line footer-button display-shortcuts-help">
Display keyboard shortcuts
<button class="line footer-button display-quick-switch">
Go to a HexDocs package
</button>
<button class="line footer-button tooltips-toggle">
<span class="tooltips-option-disable">Disable tooltips</span>
<span class="tooltips-option-enable">Enable tooltips</span>
</button>
</p>
</footer>
</div>
</div>
</section>
</div>



</body>
</html>
Loading