base-api-io 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/base/endpoint.rb +3 -0
- data/lib/base/endpoints/files.rb +5 -2
- data/lib/base/endpoints/images.rb +5 -2
- data/lib/base/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e165c9fc644d01b252aa64ec930a1ed9ee8afd01508e63f4d05cedaf9fc799
|
4
|
+
data.tar.gz: e1584e9cff357d08dc13f6c70de359872e34a1fc31b5106555cd493b438261ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 191576a47dc3ea7f754986c06cbaba796a32d1960b114d4353b11067721b8cc756b9b812d53d76b8fcb0b23b13399b8eec54d6192d389198aabb2d087d8665e0
|
7
|
+
data.tar.gz: 8f38281bf3b0971c75d25a15185455639dfb633e705e5a2fa611bcb23119a59cfa17d7aa008eede4a14008fecc5955b153faecde084b9f95b67bb479d5b2c636
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Base
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/base-api-io.svg)](https://badge.fury.io/rb/base-api-io)
|
4
|
+
|
3
5
|
Ruby client for the [Base API](https://www.base-api.io) service, with it you
|
4
6
|
can manage authentication, email sending, files and images of your application.
|
5
7
|
|
data/lib/base/endpoint.rb
CHANGED
data/lib/base/endpoints/files.rb
CHANGED
@@ -11,10 +11,13 @@ module Base
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# Uploads the given file and returns its metadata.
|
14
|
-
def create(
|
14
|
+
def create(path:, type:, filename:)
|
15
15
|
request do
|
16
|
+
io =
|
17
|
+
Faraday::UploadIO.new(path, type, filename)
|
18
|
+
|
16
19
|
response =
|
17
|
-
connection.post('', 'file' =>
|
20
|
+
connection.post('', 'file' => io)
|
18
21
|
|
19
22
|
parse(response.body)
|
20
23
|
end
|
@@ -14,10 +14,13 @@ module Base
|
|
14
14
|
#
|
15
15
|
# Only images with ImageMagick understands can be uploaded otherwise it
|
16
16
|
# will raise an error.
|
17
|
-
def create(
|
17
|
+
def create(path:, type:, filename:)
|
18
18
|
request do
|
19
|
+
io =
|
20
|
+
Faraday::UploadIO.new(path, type, filename)
|
21
|
+
|
19
22
|
response =
|
20
|
-
connection.post('', 'image' =>
|
23
|
+
connection.post('', 'image' => io)
|
21
24
|
|
22
25
|
parse(response.body)
|
23
26
|
end
|
data/lib/base/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: base-api-io
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gusztáv Szikszai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-08-
|
11
|
+
date: 2019-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|