redd 0.8.1 → 0.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,6 +15,7 @@ module Redd
15
15
  'more' => Models::MoreComments,
16
16
  'wikipage' => Models::WikiPage,
17
17
  'Listing' => Models::Listing,
18
+ 'modaction' => Models::Subreddit::ModAction,
18
19
  'LabeledMulti' => Models::Multireddit,
19
20
  'LiveUpdate' => Models::LiveThread::LiveUpdate
20
21
  }.freeze
@@ -26,12 +27,12 @@ module Redd
26
27
  def unmarshal(response)
27
28
  if response[:json] && response[:json][:data]
28
29
  if response[:json][:data][:things]
29
- Models::Listing.from_response(@client, children: response[:json][:data][:things])
30
+ Models::Listing.new(@client, children: response[:json][:data][:things])
30
31
  else
31
32
  Models::BasicModel.new(@client, response[:json][:data])
32
33
  end
33
34
  elsif MAPPING.key?(response[:kind])
34
- MAPPING[response[:kind]].from_response(@client, response[:data])
35
+ MAPPING[response[:kind]].new(@client, response[:data])
35
36
  else
36
37
  raise "unknown type to unmarshal: #{response[:kind].inspect}"
37
38
  end
data/lib/redd/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Redd
4
- VERSION = '0.8.1'
4
+ VERSION = '0.8.2'
5
5
  end
data/redd.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.authors = ['Avinash Dwarapu']
12
12
  spec.email = ['avinash@dwarapu.me']
13
13
 
14
- spec.summary = 'An intuitive and fun API wrapper for reddit.'
14
+ spec.summary = 'A batteries-included API wrapper for reddit.'
15
15
  spec.homepage = 'https://github.com/avinashbot/redd'
16
16
  spec.license = 'MIT'
17
17
 
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.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avinash Dwarapu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-27 00:00:00.000000000 Z
11
+ date: 2017-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -137,13 +137,11 @@ files:
137
137
  - LICENSE.txt
138
138
  - README.md
139
139
  - Rakefile
140
- - TODO.md
141
140
  - bin/console
142
141
  - bin/setup
143
142
  - lib/redd.rb
144
143
  - lib/redd/api_client.rb
145
144
  - lib/redd/auth_strategies/auth_strategy.rb
146
- - lib/redd/auth_strategies/installed.rb
147
145
  - lib/redd/auth_strategies/script.rb
148
146
  - lib/redd/auth_strategies/userless.rb
149
147
  - lib/redd/auth_strategies/web.rb
@@ -153,6 +151,7 @@ files:
153
151
  - lib/redd/models/basic_model.rb
154
152
  - lib/redd/models/comment.rb
155
153
  - lib/redd/models/front_page.rb
154
+ - lib/redd/models/gildable.rb
156
155
  - lib/redd/models/inboxable.rb
157
156
  - lib/redd/models/lazy_model.rb
158
157
  - lib/redd/models/listing.rb
@@ -201,5 +200,5 @@ rubyforge_project:
201
200
  rubygems_version: 2.6.8
202
201
  signing_key:
203
202
  specification_version: 4
204
- summary: An intuitive and fun API wrapper for reddit.
203
+ summary: A batteries-included API wrapper for reddit.
205
204
  test_files: []
data/TODO.md DELETED
@@ -1,8 +0,0 @@
1
- # v0.8.0 checklist
2
-
3
- - [ ] make rubocop fail on error
4
- - [ ] unduplicate duplicated code
5
- - [ ] Write tests (oh boy)
6
- - [ ] change after_initialize to include force_load
7
- - [ ] abstract out listing methods?
8
- - [ ] Add `#==` and `#to_s` methods to models
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'auth_strategy'
4
-
5
- module Redd
6
- module AuthStrategies
7
- # For non-confidential apps. Different from the implicit grant.
8
- class Installed < AuthStrategy
9
- def initialize(client_id:, redirect_uri:, **kwargs)
10
- super(client_id: client_id, secret: '', **kwargs)
11
- @redirect_uri = redirect_uri
12
- end
13
-
14
- # Authenticate with a code using the "web" flow.
15
- # @param code [String] the code returned by reddit
16
- # @return [Access]
17
- def authenticate(code)
18
- request_access('authorization_code', code: code, redirect_uri: @redirect_uri)
19
- end
20
- end
21
- end
22
- end