NeonRAW 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5c5f5813286d06a4197398453a3757b04d93a50
4
- data.tar.gz: da23914a7e7031fda375d6c952102bb8c6417cb3
3
+ metadata.gz: 4d78200055028b7696bbcdc7022684b2c70c5d34
4
+ data.tar.gz: 219153278c366dd7296b2321975474a29f78e650
5
5
  SHA512:
6
- metadata.gz: 229bdb349d106acc59f9edf57f0181b59fc70ebe792f45ad8c53895ae25d67746e6c203bdb08703492a732854357f2ffe8bab34a14f6742f0999a4e2c8167fe8
7
- data.tar.gz: 3dced2c3e45fa74a8c0f4d08ae9acae11d35bdf341ca8bcd27b27d15d41afd9be58b111cefaafba3b1ca01b126671280dd7f49e173313b37e0d8e7caa7f13fd3
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
 
@@ -40,7 +40,7 @@ module NeonRAW
40
40
  params: params
41
41
  ).run
42
42
  error = assign_errors(response)
43
- fail error unless error.nil?
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
- fail error unless error.nil?
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
- fail error unless error.nil?
92
+ raise error unless error.nil?
93
93
  data
94
94
  end
95
95
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module NeonRAW
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: NeonRAW
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SirNeon