bookify 2.5.0 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bookify/node/image.rb +10 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4255cf2b6bf6760ab6e48f513e5b72d39c76a524052a900801445462743cfd20
|
4
|
+
data.tar.gz: d8ddad7073160d14d02bcfcc366f7067af49f0bd73edbaba0739ee3db0e2f57b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bfa67e29bf649746630e7352d5892d46616a9cd463ff937fd06dd6b5d4c69f870af036e33d993af1fd9a8ea49c2e80eb116da3c3191bdd5552a0e82f413375a2
|
7
|
+
data.tar.gz: c37247ac47f1df3703933e78b546f6ccea7c6e10964abbad50b0a23e4460e335c167376aa5d03ca34832ef7ab93f27cc0f6c1077c67cc156618ecc29a9774fcd
|
data/lib/bookify/node/image.rb
CHANGED
@@ -1,15 +1,23 @@
|
|
1
1
|
require_relative "base"
|
2
|
+
require "open-uri"
|
2
3
|
|
3
4
|
module Bookify::Node
|
4
5
|
class Image < Base
|
5
6
|
def render
|
6
7
|
options = {
|
7
8
|
position: html_classes.include?("center") ? :center : :left,
|
8
|
-
fit: [bounds.width, -1]
|
9
|
+
fit: [bounds.width, -1]
|
9
10
|
}
|
10
11
|
|
11
|
-
image node
|
12
|
+
image image_from_node(node), options
|
12
13
|
move_down 15
|
13
14
|
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def image_from_node(node)
|
19
|
+
src = node.attr(:src)
|
20
|
+
/^https?\:\/\//.match?(src) ? URI.open(src) : src
|
21
|
+
end
|
14
22
|
end
|
15
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joey Schoblaska
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|