html_to 1.1.1 → 1.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cc490495133d2799e907b246a839a9645e81d0097a10006a851cbb8af8343a61
4
- data.tar.gz: 46f2beb5850fe8975354763abdce67ea53b0f06bc65a6ed19d9c179cb329f547
3
+ metadata.gz: c9080c727397bbccad429a3664f96041b84d0d175ceacee85d9724d414b67eb6
4
+ data.tar.gz: 14040b78505b0bb0dbf26830eff84c0529af19b8590e0b212095a762e03f03eb
5
5
  SHA512:
6
- metadata.gz: daeaa75cc74b90d4ff4883c5475559d7b886fb81dcbdea084ae96d1b5fd159e962e1dcf442ad95dabdc3d0298f4f82b2f2bc2d2ac8e10bb70094f2cd0f40abbc
7
- data.tar.gz: 9ab97a704bcc78d2274948916e8b382e7cb97a64775a37747ce7abe866564b5126e06cd09f1e56db53c9996c471ddfb1d1b82fead1a8ecf8d3583596b01fe3ba
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
 
@@ -9,7 +9,7 @@ module HtmlTo
9
9
  end
10
10
 
11
11
  path = if /darwin/.match?(RbConfig::CONFIG['host_os'])
12
- "/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"
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} \
@@ -1,4 +1,4 @@
1
1
  module HtmlTo
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.1.2'.freeze
3
3
  public_constant :VERSION
4
4
  end
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.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-16 00:00:00.000000000 Z
11
+ date: 2023-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob