brutalismbot 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/brutalismbot/reddit/post.rb +4 -5
- data/lib/brutalismbot/reddit/stub.rb +1 -2
- data/lib/brutalismbot/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c823de7d2cb19bf4f6d8742111bf4a995b565a40fde6eb89ab66e0fa49f32dcf
|
4
|
+
data.tar.gz: 2f7053d644bf1c64e9221aec56d6b4bc28ab3ea393972d97fd7e70304b39ed64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 967b8a00fedb99a4bc186f14c2c5122366ccd3c5ba012e6e5851a2868d88f0fa5ac944c00e05b174e9a2bf99dcbf51594790c24240cb4468a4999ae7f2f77f47
|
7
|
+
data.tar.gz: aee379c78663682c29bdccfe56215e9694d997807e3629768b31c208954cba643c681579dfd48ac1788daa6987feef41ecd06a238b5d939c772c65dfb646e4bd
|
@@ -7,11 +7,6 @@ require "brutalismbot/base"
|
|
7
7
|
module Brutalismbot
|
8
8
|
module Reddit
|
9
9
|
class Post < Base
|
10
|
-
def initialize(**item)
|
11
|
-
@mime_type = item.delete(:mime_type)
|
12
|
-
super
|
13
|
-
end
|
14
|
-
|
15
10
|
def created_after?(time = nil)
|
16
11
|
time.nil? || created_utc.to_i > time.to_i
|
17
12
|
end
|
@@ -83,6 +78,10 @@ module Brutalismbot
|
|
83
78
|
end
|
84
79
|
end
|
85
80
|
|
81
|
+
def mime_type=(value)
|
82
|
+
@mime_type = value
|
83
|
+
end
|
84
|
+
|
86
85
|
def path
|
87
86
|
created_utc.strftime("year=%Y/month=%Y-%m/day=%Y-%m-%d/%s.json")
|
88
87
|
end
|
@@ -4,13 +4,12 @@ module Brutalismbot
|
|
4
4
|
module Reddit
|
5
5
|
class Post
|
6
6
|
class << self
|
7
|
-
def stub(created_utc:nil, post_id:nil, permalink_id:nil, image_id:nil
|
7
|
+
def stub(created_utc:nil, post_id:nil, permalink_id:nil, image_id:nil)
|
8
8
|
created_utc ||= Time.now.utc - rand(86400) - 86400
|
9
9
|
post_id ||= SecureRandom.alphanumeric(6).downcase
|
10
10
|
permalink_id ||= SecureRandom.alphanumeric.downcase
|
11
11
|
image_id ||= SecureRandom.alphanumeric
|
12
12
|
new(
|
13
|
-
mime_type: mime_type,
|
14
13
|
kind: "t3",
|
15
14
|
data: {
|
16
15
|
id: post_id,
|
data/lib/brutalismbot/version.rb
CHANGED