redd 0.7.9 → 0.7.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2617c83dedaf3dcd90f02e3b065c879f05898b64
4
- data.tar.gz: f7634f90934515422bd205efc37e2d393d562f6b
3
+ metadata.gz: e1121cb3dc661cdca2b70098ec2a384c9138b7fd
4
+ data.tar.gz: bea834439ebe8bb0d24d41eadeaddfdc390090b9
5
5
  SHA512:
6
- metadata.gz: 5fab04e72faab63714db2dd149416465d5fbd01c2a6e10179bba746bbeddcea9d0c6ff73e70db8bd2d0e7fca971fa69d84ef252c7f94b00ecea52908b97939f3
7
- data.tar.gz: 911f0b8f8639efc1439dcd1756b9a0e7acaf9f261b28983755295184bf6e59e4afd558b4bd09d22aa22a9b4e15424f9732947573e2246e1b8644b6cb7df7976c
6
+ metadata.gz: bba0bd482a22ad71a63170be6d8eddf3b655d7438cb44912cc0d692ee0c3c73d485989ab72f1d17aa1ef836c0c05c680430b46be9f4fd45e1f1462cc38ef7169
7
+ data.tar.gz: 9251eff0a74b121c7e6fe257b022edce3866346736cfbb6e6b6616a8021b6828308b534c0b67ff34301ac9057a61e98d3990c43bf578f5f6cece3301a4a3f62b
data/README.md CHANGED
@@ -1,9 +1,8 @@
1
1
  <p align="center">
2
2
  <img src="https://i.imgur.com/2JfE4M1.png" alt="redd"><br>
3
3
  <a href="https://rubygems.org/gems/redd"><img src="http://img.shields.io/gem/v/redd.svg?style=flat-square" alt="Gem Version"></a>
4
- <a href="https://travis-ci.org/avidw/redd"><img src="http://img.shields.io/travis/avidw/redd.svg?style=flat-square" alt="Build Status"></a>
4
+ <a href="https://travis-ci.org/avidw/redd"><img src="http://img.shields.io/travis/avinashbot/redd.svg?style=flat-square" alt="Build Status"></a>
5
5
  <a href="https://rubygems.org/gems/redd"><img src="http://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT License"></a>
6
- <a href="https://gitter.im/avidw/redd?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=body_badge"><img src="https://img.shields.io/badge/GITTER-JOIN%20CHAT%20%E2%86%92-1dce73.svg?style=flat-square" alt="Chat on Gitter"></a>
7
6
  </p>
8
7
 
9
8
  **redd** is an API wrapper for [reddit](http://www.reddit.com/dev/api) written in ruby that focuses on being consistent and extensible. **Check out the latest documentation on [RubyDoc](http://www.rubydoc.info/github/avidw/redd/master/frames/Redd.it).**
@@ -12,7 +11,7 @@
12
11
 
13
12
  #### Gemfile
14
13
  ```ruby
15
- gem "redd", "~> 0.7.0"
14
+ gem "redd", "~> 0.7"
16
15
 
17
16
  # Optional fast JSON parser.
18
17
  gem "oj", platforms: :ruby
@@ -108,6 +108,7 @@ module Redd
108
108
  refresh_token: access.refresh_token
109
109
  )
110
110
  access.refreshed!(response.body)
111
+ reset_connection!
111
112
  end
112
113
 
113
114
  # Dispose of an access or refresh token when you're done with it.
@@ -117,6 +118,7 @@ module Redd
117
118
  token_type = remove_refresh_token ? :refresh_token : :access_token
118
119
  token = access.send(token_type)
119
120
  @access = nil
121
+ reset_connection!
120
122
  auth_connection.post(
121
123
  "/api/v1/revoke_token",
122
124
  token: token,
@@ -151,6 +153,11 @@ module Redd
151
153
  }
152
154
  end
153
155
 
156
+ def reset_connection!
157
+ @connection = nil
158
+ @access
159
+ end
160
+
154
161
  # @return [Faraday::Connection] A new or existing connection.
155
162
  def connection
156
163
  @connection ||= Faraday.new(
@@ -50,6 +50,7 @@ module Redd
50
50
  expires_in: parsed[:expires_in].first,
51
51
  scope: parsed[:scope]
52
52
  )
53
+ reset_connection!
53
54
  end
54
55
  end
55
56
  end
@@ -32,10 +32,10 @@ module Redd
32
32
  )
33
33
 
34
34
  @access = Access.new(response.body)
35
+ reset_connection!
35
36
  end
36
37
 
37
38
  alias_method :refresh_access!, :authorize!
38
-
39
39
  end
40
40
  end
41
41
  end
@@ -24,8 +24,8 @@ module Redd
24
24
  "/api/v1/access_token",
25
25
  grant_type: "client_credentials"
26
26
  )
27
-
28
27
  @access = Access.new(response.body)
28
+ reset_connection!
29
29
  end
30
30
  end
31
31
  end
@@ -50,8 +50,8 @@ module Redd
50
50
  code: code,
51
51
  redirect_uri: @redirect_uri
52
52
  )
53
-
54
53
  @access = Access.new(response.body)
54
+ reset_connection!
55
55
  end
56
56
  end
57
57
  end
data/lib/redd/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Redd # rubocop:disable Style/Documentation
2
2
  # The semantic version number.
3
- VERSION = "0.7.9"
3
+ VERSION = "0.7.10"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.9
4
+ version: 0.7.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avinash Dwarapu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-12 00:00:00.000000000 Z
11
+ date: 2016-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler