NeonRAW 0.1.1 → 0.1.2
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 +4 -4
- data/CHANGELOG.md +11 -1
- data/lib/NeonRAW/clients/base.rb +3 -3
- data/lib/NeonRAW/errors.rb +1 -1
- data/lib/NeonRAW/objects/comment.rb +7 -0
- data/lib/NeonRAW/objects/morecomments.rb +7 -0
- data/lib/NeonRAW/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d78200055028b7696bbcdc7022684b2c70c5d34
|
4
|
+
data.tar.gz: 219153278c366dd7296b2321975474a29f78e650
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa1cd3313d3cab6717300c2c99df96dab443ec2df5f3923fd4a6e3680f2d6b2bb4e45791484cf69a158d5216cc68a2421a4b0d5b276738311692d704a9c277fa
|
7
|
+
data.tar.gz: cc95d39d95e5c119cffd6772a5df5d4aa3a28c2447a58df093dee36ac0d62a935ecac2578153bd24a8dd27bd8ef130e8f9de72c3b0ec1c9e3ef04e26cdfe3256
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
+
## 0.1.2
|
2
|
+
|
3
|
+
### Added
|
4
|
+
|
5
|
+
* Comment and MoreComments objects now have methods to check whether or not they're a MoreComments object. They're often found intermixed in listings and this makes it easier to establish which is which.
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
|
9
|
+
* parse_errors now returns as intended when the data doesn't have an errors key.
|
10
|
+
|
1
11
|
## 0.1.1
|
2
12
|
|
3
|
-
* Forgot to include Ruby version in gemspec file.
|
13
|
+
* Forgot to include Ruby version in gemspec file.
|
4
14
|
|
5
15
|
## 0.1.0
|
6
16
|
|
data/lib/NeonRAW/clients/base.rb
CHANGED
@@ -40,7 +40,7 @@ module NeonRAW
|
|
40
40
|
params: params
|
41
41
|
).run
|
42
42
|
error = assign_errors(response)
|
43
|
-
|
43
|
+
raise error unless error.nil?
|
44
44
|
handle_ratelimit(response.headers)
|
45
45
|
response
|
46
46
|
end
|
@@ -60,7 +60,7 @@ module NeonRAW
|
|
60
60
|
params: params
|
61
61
|
).run
|
62
62
|
error = assign_errors(response)
|
63
|
-
|
63
|
+
raise error unless error.nil?
|
64
64
|
response
|
65
65
|
end
|
66
66
|
|
@@ -89,7 +89,7 @@ module NeonRAW
|
|
89
89
|
response = api_connection(path, meth, params, opts)
|
90
90
|
data = JSON.parse(response.body, symbolize_names: true)
|
91
91
|
error = parse_errors(data)
|
92
|
-
|
92
|
+
raise error unless error.nil?
|
93
93
|
data
|
94
94
|
end
|
95
95
|
|
data/lib/NeonRAW/errors.rb
CHANGED
@@ -60,7 +60,7 @@ module NeonRAW
|
|
60
60
|
assign_data_errors([]) if data.empty?
|
61
61
|
if data.is_a?(Array) # handles returns from some flair methods
|
62
62
|
# handles multireddits
|
63
|
-
assign_data_errors([]) unless data[0].key?(:errors)
|
63
|
+
return assign_data_errors([]) unless data[0].key?(:errors)
|
64
64
|
messages = []
|
65
65
|
errors = data[0][:errors]
|
66
66
|
errors.each { |_key, error| messages << error } unless errors.empty?
|
@@ -95,6 +95,13 @@ module NeonRAW
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
+
# Returns whether or not the comment is a MoreComments object.
|
99
|
+
# @!method morecomments?
|
100
|
+
# @return [Boolean] Returns false.
|
101
|
+
def morecomments?
|
102
|
+
false
|
103
|
+
end
|
104
|
+
|
98
105
|
# Checks whether or not the comment has replies to it.
|
99
106
|
# @!method replies?
|
100
107
|
# @return [Boolean] Returns whether or not the comment has replies to it.
|
@@ -13,6 +13,13 @@ module NeonRAW
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
# Returns whether or not the object is a MoreComments object.
|
17
|
+
# @!method morecomments?
|
18
|
+
# @return [Boolean] Returns true.
|
19
|
+
def morecomments?
|
20
|
+
true
|
21
|
+
end
|
22
|
+
|
16
23
|
# Expands the MoreComments object.
|
17
24
|
# @!method expand(subreddit)
|
18
25
|
# @param subreddit [String] The name of the subreddit where the
|
data/lib/NeonRAW/version.rb
CHANGED