base-api-io 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +15 -0
- data/lib/base/endpoints/files.rb +10 -0
- data/lib/base/endpoints/images.rb +10 -0
- data/lib/base/endpoints/users.rb +10 -0
- data/lib/base/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d7d60f3e18c1ce77a3bbae93148f618ce96c108b
|
4
|
+
data.tar.gz: 8500d9a7d88a287734e378d4046842891dddcefb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eda59767a1eb34e70c8edeff55160dca1cb611d68608421be333d894801dc4c9f5adff75a7e399f2a67e4bb129f1193d7f7fd4a41c091ad074d27744986f8c83
|
7
|
+
data.tar.gz: 4ffa1ba4e925c830a302dbcbe6eda94dcea836e3c88927a0142182dcc573d8164927b462d016a423d12d6fe62da34cae00111865f009f878f010c8bcd68587ff
|
data/README.md
CHANGED
@@ -59,6 +59,11 @@ email =
|
|
59
59
|
Using the `users` endpoint on the client you can create / get or delete users:
|
60
60
|
|
61
61
|
```ruby
|
62
|
+
# List users
|
63
|
+
users = client.users.list(page: 1, per_page: 10)
|
64
|
+
users.items # The array of users
|
65
|
+
users.metadata # The metadata object containing the total count
|
66
|
+
|
62
67
|
# Create a user with email / password
|
63
68
|
user =
|
64
69
|
client.users.create(
|
@@ -110,6 +115,11 @@ Using the `files` endpoint on the client you can create / get / delete or
|
|
110
115
|
download files:
|
111
116
|
|
112
117
|
```ruby
|
118
|
+
# List files
|
119
|
+
files = client.files.list(page: 1, per_page: 10)
|
120
|
+
files.items # The array of files
|
121
|
+
files.metadata # The metadata object containing the total count
|
122
|
+
|
113
123
|
# Create a file
|
114
124
|
file =
|
115
125
|
client.files.create(
|
@@ -140,6 +150,11 @@ Using the `images` endpoint on the client you can create / get / delete or
|
|
140
150
|
process images:
|
141
151
|
|
142
152
|
```ruby
|
153
|
+
# List images
|
154
|
+
images = client.images.list(page: 1, per_page: 10)
|
155
|
+
images.items # The array of images
|
156
|
+
images.metadata # The metadata object containing the total count
|
157
|
+
|
143
158
|
# Create an image
|
144
159
|
image =
|
145
160
|
client.images.create(
|
data/lib/base/endpoints/files.rb
CHANGED
@@ -10,6 +10,16 @@ module Base
|
|
10
10
|
super
|
11
11
|
end
|
12
12
|
|
13
|
+
# Lists the files of a project
|
14
|
+
def list(page: 1, per_page: 10)
|
15
|
+
request do
|
16
|
+
response =
|
17
|
+
connection.get('', per_page: per_page, page: page)
|
18
|
+
|
19
|
+
parse(response.body)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
# Uploads the given file and returns its metadata.
|
14
24
|
def create(path:, type:, filename:)
|
15
25
|
request do
|
@@ -10,6 +10,16 @@ module Base
|
|
10
10
|
super
|
11
11
|
end
|
12
12
|
|
13
|
+
# Lists the files of a project
|
14
|
+
def list(page: 1, per_page: 10)
|
15
|
+
request do
|
16
|
+
response =
|
17
|
+
connection.get('', per_page: per_page, page: page)
|
18
|
+
|
19
|
+
parse(response.body)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
# Uploads the given image and returns its metadata.
|
14
24
|
#
|
15
25
|
# Only images with ImageMagick understands can be uploaded otherwise it
|
data/lib/base/endpoints/users.rb
CHANGED
@@ -10,6 +10,16 @@ module Base
|
|
10
10
|
super
|
11
11
|
end
|
12
12
|
|
13
|
+
# Lists the files of a project
|
14
|
+
def list(page: 1, per_page: 10)
|
15
|
+
request do
|
16
|
+
response =
|
17
|
+
connection.get('', per_page: per_page, page: page)
|
18
|
+
|
19
|
+
parse(response.body)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
13
23
|
# Creates a user with the given credentials.
|
14
24
|
def create(email:, password:, confirmation:)
|
15
25
|
request do
|
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: 1.
|
4
|
+
version: 1.1.0
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -145,7 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
- !ruby/object:Gem::Version
|
146
146
|
version: '0'
|
147
147
|
requirements: []
|
148
|
-
|
148
|
+
rubyforge_project:
|
149
|
+
rubygems_version: 2.4.8
|
149
150
|
signing_key:
|
150
151
|
specification_version: 4
|
151
152
|
summary: Ruby client library for the Base API
|