spooked 0.0.1 → 0.0.2
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/CHANGELOG.md +5 -0
- data/README.md +12 -4
- data/lib/spooked/api/posts.rb +2 -2
- data/lib/spooked/client.rb +10 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f530923456f96e814e89faa14a02a2a94bf1e0af
|
4
|
+
data.tar.gz: 5a3dcacb2622ef44bbb873828abce73f6fc0f66f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ed16d0a4993bfbb7f232b764559ca9bb83909641e555cf35180d8e638ed99f4b71e0474edccbe0d9661450c33d087b5b4cfa95e9bdf24c70ce52e65e591592c
|
7
|
+
data.tar.gz: a9d42bc9cd565dea0f7643a3ca2a9fbfcaa4eeccad328b5f0f622e83ea44b87860f01ac98b01783e2ccc22d9e89f5c9b74d96309fc7386af353ed0ad83dddcbf
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,11 @@ An experimental (and very limited!) unofficial Ruby client for the
|
|
5
5
|
|
6
6
|
## v0
|
7
7
|
|
8
|
+
### v0.0.2 (2016-12-02)
|
9
|
+
|
10
|
+
- BREAKING: Change from User to Client authentication (for longer lived access)
|
11
|
+
- Fix Post.list query parameter passing
|
12
|
+
|
8
13
|
### v0.0.1 (2016-12-02)
|
9
14
|
|
10
15
|
- Initial Client version
|
data/README.md
CHANGED
@@ -13,13 +13,21 @@ If not explicitly passed a client, all methods will fall back to
|
|
13
13
|
`Client.default_client`. You can set that default client directly or
|
14
14
|
have it auto-constructed from a set of default options:
|
15
15
|
|
16
|
-
####
|
16
|
+
#### client_id
|
17
17
|
|
18
18
|
**Has no default, must be provided.**
|
19
19
|
|
20
|
-
|
21
|
-
http://api.ghost.org/docs/
|
22
|
-
|
20
|
+
The Client ID used for Client Authentication. See
|
21
|
+
http://api.ghost.org/docs/client-authentication#client-restrictions for details
|
22
|
+
on how to obtain that information.
|
23
|
+
|
24
|
+
#### client_secret
|
25
|
+
|
26
|
+
**Has no default, must be provided.**
|
27
|
+
|
28
|
+
The Client Secret used for Client Authentication. See
|
29
|
+
http://api.ghost.org/docs/client-authentication#client-restrictions for details
|
30
|
+
on how to obtain that information.
|
23
31
|
|
24
32
|
#### connection_builder
|
25
33
|
|
data/lib/spooked/api/posts.rb
CHANGED
@@ -12,14 +12,14 @@ module Spooked
|
|
12
12
|
order: "published_at desc",
|
13
13
|
page: 1
|
14
14
|
)
|
15
|
-
client.get("posts/", {
|
15
|
+
client.get("posts/", {
|
16
16
|
fields: fields,
|
17
17
|
filter: filter,
|
18
18
|
include: include_,
|
19
19
|
limit: limit,
|
20
20
|
order: order,
|
21
21
|
page: page,
|
22
|
-
}.reject { |k, v| v.nil? }
|
22
|
+
}.reject { |k, v| v.nil? })
|
23
23
|
end
|
24
24
|
end
|
25
25
|
end
|
data/lib/spooked/client.rb
CHANGED
@@ -3,7 +3,8 @@
|
|
3
3
|
module Spooked
|
4
4
|
class Client
|
5
5
|
OPTIONS_WITH_CLASS_DEFAULT = [
|
6
|
-
:
|
6
|
+
:client_id,
|
7
|
+
:client_secret,
|
7
8
|
:connection_builder,
|
8
9
|
:connection_options,
|
9
10
|
:subdomain,
|
@@ -66,7 +67,14 @@ module Spooked
|
|
66
67
|
protected
|
67
68
|
|
68
69
|
def connection
|
69
|
-
@connection ||= Faraday::Connection.new(
|
70
|
+
@connection ||= Faraday::Connection.new(
|
71
|
+
evaluate_option(url_base),
|
72
|
+
params: {
|
73
|
+
client_id: client_id,
|
74
|
+
client_secret: client_secret,
|
75
|
+
},
|
76
|
+
&connection_builder
|
77
|
+
)
|
70
78
|
end
|
71
79
|
|
72
80
|
def evaluate_option(option)
|