redd 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +34 -34
  3. data/.rspec +3 -3
  4. data/.rubocop.yml +5 -5
  5. data/.travis.yml +9 -9
  6. data/LICENSE.md +22 -22
  7. data/README.md +143 -143
  8. data/Rakefile +5 -5
  9. data/RedditKit.LICENSE.md +8 -8
  10. data/lib/redd.rb +50 -50
  11. data/lib/redd/access.rb +76 -76
  12. data/lib/redd/clients/base.rb +181 -181
  13. data/lib/redd/clients/base/account.rb +20 -20
  14. data/lib/redd/clients/base/identity.rb +22 -22
  15. data/lib/redd/clients/base/none.rb +27 -27
  16. data/lib/redd/clients/base/privatemessages.rb +33 -33
  17. data/lib/redd/clients/base/read.rb +113 -113
  18. data/lib/redd/clients/base/stream.rb +81 -81
  19. data/lib/redd/clients/base/submit.rb +19 -19
  20. data/lib/redd/clients/base/utilities.rb +104 -104
  21. data/lib/redd/clients/base/wikiread.rb +33 -33
  22. data/lib/redd/clients/installed.rb +56 -56
  23. data/lib/redd/clients/script.rb +41 -41
  24. data/lib/redd/clients/userless.rb +32 -32
  25. data/lib/redd/clients/web.rb +58 -58
  26. data/lib/redd/error.rb +151 -151
  27. data/lib/redd/objects/base.rb +39 -39
  28. data/lib/redd/objects/comment.rb +22 -22
  29. data/lib/redd/objects/labeled_multi.rb +13 -13
  30. data/lib/redd/objects/listing.rb +29 -29
  31. data/lib/redd/objects/more_comments.rb +11 -10
  32. data/lib/redd/objects/private_message.rb +28 -28
  33. data/lib/redd/objects/submission.rb +139 -139
  34. data/lib/redd/objects/subreddit.rb +330 -319
  35. data/lib/redd/objects/thing.rb +26 -26
  36. data/lib/redd/objects/thing/editable.rb +22 -22
  37. data/lib/redd/objects/thing/hideable.rb +18 -18
  38. data/lib/redd/objects/thing/inboxable.rb +25 -25
  39. data/lib/redd/objects/thing/messageable.rb +34 -34
  40. data/lib/redd/objects/thing/moderatable.rb +43 -43
  41. data/lib/redd/objects/thing/refreshable.rb +14 -14
  42. data/lib/redd/objects/thing/saveable.rb +21 -21
  43. data/lib/redd/objects/thing/votable.rb +33 -33
  44. data/lib/redd/objects/user.rb +52 -52
  45. data/lib/redd/objects/wiki_page.rb +15 -15
  46. data/lib/redd/rate_limit.rb +88 -88
  47. data/lib/redd/response/parse_json.rb +18 -18
  48. data/lib/redd/response/raise_error.rb +16 -16
  49. data/lib/redd/version.rb +4 -4
  50. data/redd.gemspec +31 -31
  51. data/spec/redd/objects/base_spec.rb +1 -1
  52. data/spec/redd/response/raise_error_spec.rb +11 -11
  53. data/spec/redd_spec.rb +5 -5
  54. data/spec/spec_helper.rb +71 -71
  55. 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.8
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: 2015-09-04 00:00:00.000000000 Z
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.10.6
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.10.6
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: 10.4.2
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: 10.4.2
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.2.0
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.2.0
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: 2.9.3
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: 2.9.3
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.20.4
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.20.4
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.0
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.0
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.1
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.1
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.10.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.10.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: 1.6.6
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: 1.6.6
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.4.7
220
+ rubygems_version: 2.6.6
221
221
  signing_key:
222
222
  specification_version: 4
223
223
  summary: A Reddit API Wrapper for Ruby.