spooked 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04598c9e0c15534480b494465ef37e4e15308af7
4
- data.tar.gz: 21ef933d6a027dca2c02d092a66cfd934831a6cf
3
+ metadata.gz: f530923456f96e814e89faa14a02a2a94bf1e0af
4
+ data.tar.gz: 5a3dcacb2622ef44bbb873828abce73f6fc0f66f
5
5
  SHA512:
6
- metadata.gz: 2da226760388f6592d4fb9a323308d46e7724824da0ae40e45151c42f40c0df99ec0fc038afada49cfb60647c5d3f25d10364816a81dab100e7a266eff53ea67
7
- data.tar.gz: 9deacc3b55431e4b536f139f9ae9e7e7c4260c93bb8fde635ab7f7ae1d4a8cd43a15575b1c66ec5b89ee37557a8f20813797c8c9bec02df452f48e528ca4f222
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
- #### access_token
16
+ #### client_id
17
17
 
18
18
  **Has no default, must be provided.**
19
19
 
20
- Your User Authentication Bearer Token. See
21
- http://api.ghost.org/docs/user-authentication for details on how to obtain that
22
- token.
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
 
@@ -12,14 +12,14 @@ module Spooked
12
12
  order: "published_at desc",
13
13
  page: 1
14
14
  )
15
- client.get("posts/", { params: {
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
@@ -3,7 +3,8 @@
3
3
  module Spooked
4
4
  class Client
5
5
  OPTIONS_WITH_CLASS_DEFAULT = [
6
- :access_token,
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(evaluate_option(url_base), params: { access_token: access_token }, &connection_builder)
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)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spooked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Niels Ganser