reddit_api 0.3.7 → 0.3.8
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/lib/reddit_api/query.rb +0 -1
- data/lib/reddit_api/users.rb +5 -4
- data/lib/reddit_api/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: e8a8ce32e4cd7da32db8b127ad3ad5dc97568204
|
4
|
+
data.tar.gz: f0a74409a59f2540772610bbab2df900be97196a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51e621d39e7cd023c8f1fea8a5a6286880746a7edc6551589688d99af7fb9d601f123bc7d0a8cdc3135b54ab798e393076b17233e98f43fd24e88b5fb3bb8560
|
7
|
+
data.tar.gz: b15d5695afcd6e7d14f8a00fe3f339fafa8f9e83ccde946319418618413837f9d96f1a28e1c04ee2fe855546aa933013d119d49ea81d3fc5929ed7e0d44704f9
|
data/lib/reddit_api/query.rb
CHANGED
data/lib/reddit_api/users.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module RedditApi
|
3
2
|
class Users
|
4
3
|
|
@@ -7,7 +6,7 @@ module RedditApi
|
|
7
6
|
attr_reader :misses
|
8
7
|
|
9
8
|
def initialize(args = {})
|
10
|
-
@post_api = RedditApi::Posts.new
|
9
|
+
@post_api = args.fetch(:posts, RedditApi::Posts.new)
|
11
10
|
@user_factory = RedditApi::User
|
12
11
|
@misses = args.fetch(:misses, 0)
|
13
12
|
@max_misses = args.fetch(:max_miss, DEFAULT_MAX_MISSES)
|
@@ -21,7 +20,7 @@ module RedditApi
|
|
21
20
|
collect_users(posts, count, users)
|
22
21
|
update_misses(users.length)
|
23
22
|
end
|
24
|
-
|
23
|
+
reset_collection_metrics
|
25
24
|
users.values
|
26
25
|
end
|
27
26
|
|
@@ -63,6 +62,7 @@ module RedditApi
|
|
63
62
|
end
|
64
63
|
|
65
64
|
def aggregate_users(new_users, collected_users)
|
65
|
+
self.last_count = collected_users.length
|
66
66
|
new_users.each do |user|
|
67
67
|
collected_users[user.username] = user
|
68
68
|
end
|
@@ -74,8 +74,9 @@ module RedditApi
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
-
def
|
77
|
+
def reset_collection_metrics
|
78
78
|
self.misses = 0
|
79
|
+
self.last_count = 0
|
79
80
|
end
|
80
81
|
|
81
82
|
end
|
data/lib/reddit_api/version.rb
CHANGED