supai 0.2.0 → 0.2.1
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/supai/api.rb +7 -1
- data/lib/supai/authorization.rb +1 -1
- data/lib/supai/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: 37f3aa8a7bd54c6b4532627e27a6ac8022dd3f8891b84c5c1a826f460d131249
|
|
4
|
+
data.tar.gz: b90054b34cdf5f0a149e1348ed5ed7d28ad6a21d02b3b6dbc59e817ff7eb9ba2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61caad8bfa33c8cb279911483b77047c4ddd2c6dcb6519d87d03acfc22d30db7eacb5fbc30abdd55b5c490ccb90d8aa971941670bd5a8d5439d98dc7387191ec
|
|
7
|
+
data.tar.gz: facd22ab23431920082c5ca2cf82d11e26c660d807de6ff2f4e35c312978694955998ff9d6111ec54eea19ccceb8195e1acfce8e1677786448bef9152bf315df
|
data/Gemfile.lock
CHANGED
data/lib/supai/api.rb
CHANGED
|
@@ -43,7 +43,13 @@ module Supai
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def initialize(host = DEFAULT_HOST)
|
|
46
|
-
@host = host
|
|
46
|
+
@host = sanitize_host(host)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def sanitize_host(host)
|
|
50
|
+
host = host.split("://", 2).last
|
|
51
|
+
host = host[0..-2] if host.end_with?("/")
|
|
52
|
+
host
|
|
47
53
|
end
|
|
48
54
|
|
|
49
55
|
def request(method, endpoint, body: nil, params: {}, headers: {}, token: nil)
|
data/lib/supai/authorization.rb
CHANGED
|
@@ -4,7 +4,7 @@ module Supai
|
|
|
4
4
|
|
|
5
5
|
attr_accessor :token, :secret, :user_id
|
|
6
6
|
|
|
7
|
-
def self.create(authorization)
|
|
7
|
+
def self.create(authorization, api: API.new)
|
|
8
8
|
api = API.new
|
|
9
9
|
response = api.request(:post, ENDPOINT, body: {}, token: authorization)
|
|
10
10
|
raise response.error unless response.success?
|
data/lib/supai/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: supai
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Scott Yoder
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-03-
|
|
11
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|