reddit-base 0.2.2 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 264ad54f63ddc99d0fba54fc3b13e3739357846c
4
- data.tar.gz: 02a53d1639d64497bf6ca4eec5a152d3222fb02c
3
+ metadata.gz: f3fb4e405bfd23bc1f041840b615db26dadf957c
4
+ data.tar.gz: 7185a75f8c788884d0fecb1307f8a6fa5e3e1c90
5
5
  SHA512:
6
- metadata.gz: 243387c7510e4b6974f31131822edc2a239911fc2adcb1364eb8d5e3451391f2f31dbba1d9be6fdd91ec7d9a1ccc2085daa2c3b8fec0c15d60d5d75d7cbf0adf
7
- data.tar.gz: e07eb437bef94de7acdd3f915d5f77bd70b0094e7114991a22deb93240d6caddb0fe82c6c9ef205852a18c133588da2812ff03062bd2f4ab52514324e1d63d78
6
+ metadata.gz: 53c19842b951b856aa5b4ed7b7f5354c715deca5b97dc60a2628ac503e436d28f77a562b34bbb88453d6debdc0ba13a03e45ee1ce21fc1450f613ed805da4de5
7
+ data.tar.gz: ed6a28235b15a55a88ec24ca935eab60d9a43acbc6493b6e4d4a00b1a08f90a1f5d43696875f41503620200315b0aac7e30539c90518d6c1b5d37f2923bf0e3f
data/.gitignore CHANGED
@@ -2,7 +2,6 @@
2
2
  *.rbc
3
3
  .bundle
4
4
  .config
5
- .pryrc
6
5
  .yardoc
7
6
  Gemfile.lock
8
7
  InstalledFiles
data/README.md CHANGED
@@ -18,39 +18,62 @@ Installation
18
18
 
19
19
  Via Rubygems:
20
20
 
21
- gem install reddit-base
21
+ ```
22
+ gem install reddit-base
23
+ ```
22
24
 
23
25
  Or in your Gemfile with Bundler:
24
26
 
25
- gem reddit-base
27
+ ```
28
+ gem reddit-base
29
+ ```
26
30
 
27
31
  Basic Usage
28
32
  -------------
29
33
 
30
34
  Retrieve the JSON for a particular endpoint:
31
35
 
32
- require 'reddit/base'
36
+ ```ruby
37
+ require 'reddit/base'
33
38
 
34
- client = Reddit::Base::Client.new(user: USERNAME, password: PASSWORD)
35
- client.get('/r/AskReddit')
39
+ client = Reddit::Base::Client.new(user: USERNAME, password: PASSWORD)
40
+ client.get('/r/AskReddit')
41
+ ```
36
42
 
37
43
  Making a new self post:
38
44
 
39
- require 'reddit/base'
45
+ ```ruby
46
+ require 'reddit/base'
40
47
 
41
- client = Reddit::Base::Client.new(user: USERNAME, password: PASSWORD)
42
- client.get('/r/AskReddit') # Need to make at least one GET request to retrieve a modhash.
43
- client.post('/api/submit', kind: 'self', sr: SUBREDDIT, title: 'Hello,', text: 'World!')
48
+ client = Reddit::Base::Client.new(user: USERNAME, password: PASSWORD)
49
+ client.get('/r/AskReddit') # Need to make at least one GET request to retrieve a modhash.
50
+ client.post('/api/submit', kind: 'self', sr: SUBREDDIT, title: 'Hello,', text: 'World!')
51
+ ```
44
52
 
45
53
  `Client#get` and `Client#post` accept a `simplify` option to flatten data and kind attributes
46
54
  for easier traversal:
47
55
 
48
- client.get('/r/AskReddit', simplify: true)
56
+ ```ruby
57
+ client.get('/r/AskReddit', simplify: true)
58
+ ```
59
+
60
+ Several forms of authentication are supported:
61
+
62
+ ```ruby
63
+ # Username and password.
64
+ client = Reddit::Base::Client.new(user: USERNAME, password: PASSWORD)
65
+
66
+ # Cookie.
67
+ client = Reddit::Base::Client.new(cookie: COOKIE)
68
+
69
+ # OAuth2 access token.
70
+ client = Reddit::Base::Client.new(access_token: ACCESS_TOKEN)
71
+ ```
49
72
 
50
73
  What it Does
51
74
  ------------
52
75
 
53
- * Authentication.
76
+ * Authentication (user/password, cookie, OAuth2 access token).
54
77
  * Rate limiting.
55
78
  * Modhash handling (reddit's CSRF protection).
56
79
  * JSON coersion.
@@ -61,6 +84,7 @@ What it Does
61
84
  What it Doesn't
62
85
  ---------------
63
86
 
87
+ * OAuth2 token negotiation.
64
88
  * Parsing of Reddit "Things" and "Kinds."
65
89
  * Parsing of common attributes like dates and times.
66
90
  * HTML entity decoding (beware of "body" and "selftext").
@@ -1,5 +1,5 @@
1
1
  module Reddit
2
2
  module Base
3
- VERSION = '0.2.2'
3
+ VERSION = '0.3.0'
4
4
  end
5
5
  end
data/reddit-base.gemspec CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
  spec.add_development_dependency "bundler", "~> 1.5"
25
25
  spec.add_development_dependency "rake"
26
26
 
27
- spec.add_dependency 'faraday_middleware-reddit', '0.2.1'
27
+ spec.add_dependency 'faraday_middleware-reddit', '0.3.0'
28
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reddit-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel O'Brien
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.2.1
47
+ version: 0.3.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.1
54
+ version: 0.3.0
55
55
  description: |-
56
56
  A minimal reddit API client for Ruby that
57
57
  simplifies concerns such authentication, rate limiting and extracting
@@ -93,8 +93,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.0.3
96
+ rubygems_version: 2.2.2
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: A minimal reddit API client for Ruby.
100
100
  test_files: []
101
+ has_rdoc: