html_to 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/html_to/chromium.rb +1 -1
- data/lib/html_to/image_generate.rb +2 -2
- data/lib/html_to/version.rb +1 -1
- 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: c9080c727397bbccad429a3664f96041b84d0d175ceacee85d9724d414b67eb6
|
4
|
+
data.tar.gz: 14040b78505b0bb0dbf26830eff84c0529af19b8590e0b212095a762e03f03eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c4ace1e86a047b8cfe223ef507acae37f6e5a6a65107c253178d15fcb42bb3d7d50b194accb7fc91abee5f10b227346a4913282a193a023ffb03980acf657da
|
7
|
+
data.tar.gz: 750b479a0825302c6a8a6955d20b5ed15a1aa956e9fb19dc21f235bbc18b2b941355cdeb6058cee10787d1a62642357524f4a9ebc5f405f79545dd0e0af48d92
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ HtmlTo is a gem for Rails that allows you to generate images from an HTML file.
|
|
15
15
|
|
16
16
|
## Installation
|
17
17
|
|
18
|
-
You need to have Chrome or Chromium installed 🛠️
|
18
|
+
You need to have Chrome or Chromium installed 🛠️ And active-storage is required
|
19
19
|
|
20
20
|
|
21
21
|
Ubuntu:
|
@@ -44,6 +44,8 @@ HtmlTo::Configuration.config do |config|
|
|
44
44
|
end
|
45
45
|
```
|
46
46
|
|
47
|
+
to optimize attached images add `gem 'image_processing'`
|
48
|
+
|
47
49
|
## Basic usage
|
48
50
|
Add to your model 📖
|
49
51
|
|
data/lib/html_to/chromium.rb
CHANGED
@@ -9,7 +9,7 @@ module HtmlTo
|
|
9
9
|
end
|
10
10
|
|
11
11
|
path = if /darwin/.match?(RbConfig::CONFIG['host_os'])
|
12
|
-
|
12
|
+
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
|
13
13
|
elsif /linux/.match?(RbConfig::CONFIG['host_os'])
|
14
14
|
release = %x(lsb_release -i -s)
|
15
15
|
%x(which chromium-browser)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require_relative 'chromium'
|
3
3
|
require 'erb'
|
4
|
-
|
4
|
+
require 'shellwords'
|
5
5
|
class HtmlTo::ImageGenerate
|
6
6
|
include HtmlTo::Chromium
|
7
7
|
def call(record, serializer, options)
|
@@ -26,7 +26,7 @@ class HtmlTo::ImageGenerate
|
|
26
26
|
|
27
27
|
def take_screenshot(width, height)
|
28
28
|
cmd = <<~BASH.chomp
|
29
|
-
#{HtmlTo::Chromium.execute_path} \
|
29
|
+
#{HtmlTo::Chromium.execute_path.shellescape} \
|
30
30
|
--headless \
|
31
31
|
--screenshot=#{screenshot_file_path} \
|
32
32
|
--window-size=#{width},#{height} \
|
data/lib/html_to/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: html_to
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chekryzhov Viktor
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activejob
|