redd 0.7.8 → 0.7.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +34 -34
- data/.rspec +3 -3
- data/.rubocop.yml +5 -5
- data/.travis.yml +9 -9
- data/LICENSE.md +22 -22
- data/README.md +143 -143
- data/Rakefile +5 -5
- data/RedditKit.LICENSE.md +8 -8
- data/lib/redd.rb +50 -50
- data/lib/redd/access.rb +76 -76
- data/lib/redd/clients/base.rb +181 -181
- data/lib/redd/clients/base/account.rb +20 -20
- data/lib/redd/clients/base/identity.rb +22 -22
- data/lib/redd/clients/base/none.rb +27 -27
- data/lib/redd/clients/base/privatemessages.rb +33 -33
- data/lib/redd/clients/base/read.rb +113 -113
- data/lib/redd/clients/base/stream.rb +81 -81
- data/lib/redd/clients/base/submit.rb +19 -19
- data/lib/redd/clients/base/utilities.rb +104 -104
- data/lib/redd/clients/base/wikiread.rb +33 -33
- data/lib/redd/clients/installed.rb +56 -56
- data/lib/redd/clients/script.rb +41 -41
- data/lib/redd/clients/userless.rb +32 -32
- data/lib/redd/clients/web.rb +58 -58
- data/lib/redd/error.rb +151 -151
- data/lib/redd/objects/base.rb +39 -39
- data/lib/redd/objects/comment.rb +22 -22
- data/lib/redd/objects/labeled_multi.rb +13 -13
- data/lib/redd/objects/listing.rb +29 -29
- data/lib/redd/objects/more_comments.rb +11 -10
- data/lib/redd/objects/private_message.rb +28 -28
- data/lib/redd/objects/submission.rb +139 -139
- data/lib/redd/objects/subreddit.rb +330 -319
- data/lib/redd/objects/thing.rb +26 -26
- data/lib/redd/objects/thing/editable.rb +22 -22
- data/lib/redd/objects/thing/hideable.rb +18 -18
- data/lib/redd/objects/thing/inboxable.rb +25 -25
- data/lib/redd/objects/thing/messageable.rb +34 -34
- data/lib/redd/objects/thing/moderatable.rb +43 -43
- data/lib/redd/objects/thing/refreshable.rb +14 -14
- data/lib/redd/objects/thing/saveable.rb +21 -21
- data/lib/redd/objects/thing/votable.rb +33 -33
- data/lib/redd/objects/user.rb +52 -52
- data/lib/redd/objects/wiki_page.rb +15 -15
- data/lib/redd/rate_limit.rb +88 -88
- data/lib/redd/response/parse_json.rb +18 -18
- data/lib/redd/response/raise_error.rb +16 -16
- data/lib/redd/version.rb +4 -4
- data/redd.gemspec +31 -31
- data/spec/redd/objects/base_spec.rb +1 -1
- data/spec/redd/response/raise_error_spec.rb +11 -11
- data/spec/redd_spec.rb +5 -5
- data/spec/spec_helper.rb +71 -71
- metadata +21 -21
@@ -1 +1 @@
|
|
1
|
-
# There's no point in testing Base, since we'd basically be testing Hashie.
|
1
|
+
# There's no point in testing Base, since we'd basically be testing Hashie.
|
@@ -1,11 +1,11 @@
|
|
1
|
-
RSpec.describe Redd::Response::RaiseError do
|
2
|
-
it "return nil if there's no error" do
|
3
|
-
error = subject.on_complete(
|
4
|
-
status: 200,
|
5
|
-
body: {success: true},
|
6
|
-
response_headers: {}
|
7
|
-
)
|
8
|
-
|
9
|
-
expect(error).to be(nil)
|
10
|
-
end
|
11
|
-
end
|
1
|
+
RSpec.describe Redd::Response::RaiseError do
|
2
|
+
it "return nil if there's no error" do
|
3
|
+
error = subject.on_complete(
|
4
|
+
status: 200,
|
5
|
+
body: {success: true},
|
6
|
+
response_headers: {}
|
7
|
+
)
|
8
|
+
|
9
|
+
expect(error).to be(nil)
|
10
|
+
end
|
11
|
+
end
|
data/spec/redd_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
RSpec.describe Redd do
|
2
|
-
it "has a version number" do
|
3
|
-
expect(Redd::VERSION).to be_a(String)
|
4
|
-
end
|
5
|
-
end
|
1
|
+
RSpec.describe Redd do
|
2
|
+
it "has a version number" do
|
3
|
+
expect(Redd::VERSION).to be_a(String)
|
4
|
+
end
|
5
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,71 +1,71 @@
|
|
1
|
-
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
-
require "vcr"
|
3
|
-
require "redd"
|
4
|
-
|
5
|
-
VCR.configure do |config|
|
6
|
-
config.cassette_library_dir = "spec/cassettes"
|
7
|
-
config.hook_into :webmock
|
8
|
-
config.default_cassette_options = {record: :new_episodes}
|
9
|
-
config.configure_rspec_metadata!
|
10
|
-
end
|
11
|
-
|
12
|
-
RSpec.configure do |config|
|
13
|
-
# rspec-expectations config goes here. You can use an alternate
|
14
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
15
|
-
# assertions if you prefer.
|
16
|
-
config.expect_with :rspec do |expectations|
|
17
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
18
|
-
# and `failure_message` of custom matchers include text for helper methods
|
19
|
-
# defined using `chain`, e.g.:
|
20
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
21
|
-
# # => "be bigger than 2 and smaller than 4"
|
22
|
-
# ...rather than:
|
23
|
-
# # => "be bigger than 2"
|
24
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
25
|
-
end
|
26
|
-
|
27
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
28
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
29
|
-
config.mock_with :rspec do |mocks|
|
30
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
31
|
-
# a real object. This is generally recommended, and will default to
|
32
|
-
# `true` in RSpec 4.
|
33
|
-
mocks.verify_partial_doubles = true
|
34
|
-
end
|
35
|
-
|
36
|
-
# These two settings work together to allow you to limit a spec run
|
37
|
-
# to individual examples or groups you care about by tagging them with
|
38
|
-
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
39
|
-
# get run.
|
40
|
-
config.filter_run_including :focus
|
41
|
-
config.run_all_when_everything_filtered = true
|
42
|
-
|
43
|
-
# If we don't have the details to perform authentication, we can't do those
|
44
|
-
# tests.
|
45
|
-
if ENV["TRAVIS_SECURE_ENV_VARS"] == "false"
|
46
|
-
config.filter_run_excluding :secure
|
47
|
-
end
|
48
|
-
|
49
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
50
|
-
# recommended. For more details, see:
|
51
|
-
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
52
|
-
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
53
|
-
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
54
|
-
config.disable_monkey_patching!
|
55
|
-
|
56
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
57
|
-
# be too noisy due to issues in dependencies.
|
58
|
-
config.warnings = true
|
59
|
-
|
60
|
-
# Run specs in random order to surface order dependencies. If you find an
|
61
|
-
# order dependency and want to debug it, you can fix the order by providing
|
62
|
-
# the seed, which is printed after each run.
|
63
|
-
# --seed 1234
|
64
|
-
config.order = :random
|
65
|
-
|
66
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
67
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
68
|
-
# test failures related to randomization by passing the same `--seed` value
|
69
|
-
# as the one that triggered the failure.
|
70
|
-
Kernel.srand config.seed
|
71
|
-
end
|
1
|
+
$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
|
2
|
+
require "vcr"
|
3
|
+
require "redd"
|
4
|
+
|
5
|
+
VCR.configure do |config|
|
6
|
+
config.cassette_library_dir = "spec/cassettes"
|
7
|
+
config.hook_into :webmock
|
8
|
+
config.default_cassette_options = {record: :new_episodes}
|
9
|
+
config.configure_rspec_metadata!
|
10
|
+
end
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
# rspec-expectations config goes here. You can use an alternate
|
14
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
15
|
+
# assertions if you prefer.
|
16
|
+
config.expect_with :rspec do |expectations|
|
17
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
18
|
+
# and `failure_message` of custom matchers include text for helper methods
|
19
|
+
# defined using `chain`, e.g.:
|
20
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
21
|
+
# # => "be bigger than 2 and smaller than 4"
|
22
|
+
# ...rather than:
|
23
|
+
# # => "be bigger than 2"
|
24
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
25
|
+
end
|
26
|
+
|
27
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
28
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
29
|
+
config.mock_with :rspec do |mocks|
|
30
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
31
|
+
# a real object. This is generally recommended, and will default to
|
32
|
+
# `true` in RSpec 4.
|
33
|
+
mocks.verify_partial_doubles = true
|
34
|
+
end
|
35
|
+
|
36
|
+
# These two settings work together to allow you to limit a spec run
|
37
|
+
# to individual examples or groups you care about by tagging them with
|
38
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
39
|
+
# get run.
|
40
|
+
config.filter_run_including :focus
|
41
|
+
config.run_all_when_everything_filtered = true
|
42
|
+
|
43
|
+
# If we don't have the details to perform authentication, we can't do those
|
44
|
+
# tests.
|
45
|
+
if ENV["TRAVIS_SECURE_ENV_VARS"] == "false"
|
46
|
+
config.filter_run_excluding :secure
|
47
|
+
end
|
48
|
+
|
49
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
50
|
+
# recommended. For more details, see:
|
51
|
+
# - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
|
52
|
+
# - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
53
|
+
# - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
|
54
|
+
config.disable_monkey_patching!
|
55
|
+
|
56
|
+
# This setting enables warnings. It's recommended, but in some cases may
|
57
|
+
# be too noisy due to issues in dependencies.
|
58
|
+
config.warnings = true
|
59
|
+
|
60
|
+
# Run specs in random order to surface order dependencies. If you find an
|
61
|
+
# order dependency and want to debug it, you can fix the order by providing
|
62
|
+
# the seed, which is printed after each run.
|
63
|
+
# --seed 1234
|
64
|
+
config.order = :random
|
65
|
+
|
66
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
67
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
68
|
+
# test failures related to randomization by passing the same `--seed` value
|
69
|
+
# as the one that triggered the failure.
|
70
|
+
Kernel.srand config.seed
|
71
|
+
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.
|
4
|
+
version: 0.7.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Avinash Dwarapu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,126 +16,126 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: '1.12'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: '1.12'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '11.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '11.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 3.
|
47
|
+
version: '3.5'
|
48
48
|
type: :development
|
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: 3.
|
54
|
+
version: '3.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: vcr
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '3.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '3.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: webmock
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 1
|
75
|
+
version: '2.1'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 1
|
82
|
+
version: '2.1'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: hashie
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.4
|
89
|
+
version: '3.4'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.4
|
96
|
+
version: '3.4'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: faraday
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.9
|
103
|
+
version: '0.9'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.9
|
110
|
+
version: '0.9'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: multi_json
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
117
|
+
version: '1.12'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 1.
|
124
|
+
version: '1.12'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: fastimage
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
131
|
+
version: '2.0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: '2.0'
|
139
139
|
description:
|
140
140
|
email:
|
141
141
|
- avinash@dwarapu.me
|
@@ -217,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
217
|
version: '0'
|
218
218
|
requirements: []
|
219
219
|
rubyforge_project:
|
220
|
-
rubygems_version: 2.
|
220
|
+
rubygems_version: 2.6.6
|
221
221
|
signing_key:
|
222
222
|
specification_version: 4
|
223
223
|
summary: A Reddit API Wrapper for Ruby.
|