rubyhexagon 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubyhexagon.rb +2 -2
- data/lib/rubyhexagon/image.rb +4 -0
- data/lib/rubyhexagon/post.rb +2 -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: d31432089ab4b468c94966f76cd32f4db815d34a84640115f6fc07e27cf81095
|
4
|
+
data.tar.gz: fc239bb33f258b73419a6c110c84480fcb59732e99109431d8591e392fadc486
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 118cc4709487a0d4a180fa9b9e50a4158bdaf2fe6950e4480d8e6b17de1090f4e89a3732d6a66da03ed87a733933b60673c276e1ddf26d95cb8f24a4ed3b16f0
|
7
|
+
data.tar.gz: 4ecfe79a22af4fc728045a2218140ed3aa92f925142ae95be52f9de3cf722229f0e60a4a2a6d513f0b7a5ec76a4b82f9cc972c3d03a692ef5f6574320a561a01
|
data/lib/rubyhexagon.rb
CHANGED
data/lib/rubyhexagon/image.rb
CHANGED
@@ -37,6 +37,9 @@ module E621
|
|
37
37
|
# @return [String] MD5 hash sum
|
38
38
|
attr_reader :md5
|
39
39
|
|
40
|
+
# @return [Integer] file size in bytes
|
41
|
+
attr_reader :size
|
42
|
+
|
40
43
|
# @author Maxine Michalski
|
41
44
|
#
|
42
45
|
# Initializer for a File. This is not a Ruby file class, but an abstraction
|
@@ -51,6 +54,7 @@ module E621
|
|
51
54
|
@ext = file[:ext]
|
52
55
|
@width = file[:width].to_i
|
53
56
|
@height = file[:height].to_i
|
57
|
+
@size = file[:size].to_i
|
54
58
|
@user_agent = { 'User-Agent' =>
|
55
59
|
"#{E621::NAME}/#{E621::VERSION} (by maxine_red on e621" }
|
56
60
|
end
|
data/lib/rubyhexagon/post.rb
CHANGED
@@ -170,7 +170,8 @@ module E621
|
|
170
170
|
@tag_names = post[:tags].split(/\s+/)
|
171
171
|
@md5 = post[:md5]
|
172
172
|
@image = E621::Image.new(url: post[:file_url], ext: post[:file_ext],
|
173
|
-
width: post[:width], height: post[:height]
|
173
|
+
width: post[:width], height: post[:height],
|
174
|
+
size: post[:file_size])
|
174
175
|
setup_sample(post)
|
175
176
|
setup_preview(post)
|
176
177
|
end
|