h2p 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/LICENSE +20 -17
- data/README.md +7 -5
- data/lib/h2p.rb +0 -1
- data/lib/h2p/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: 80a70f92f3f85ab558982ec080940d6538a85dba746d88e252cf4b92dc9a497f
|
4
|
+
data.tar.gz: b071393d6bfd888da5dbc77a63e1837c794dc7aada9cd5570e7c8cb517274cd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69c6845b83a6520933c8c94ce43a724fe9c88d92b2b687f5084f3205e85f5453b4441381546e49fb35b8f258dfa3d6f6a3cf0ac3116c25fd2f11f85eea776430
|
7
|
+
data.tar.gz: 8665abf299ac2f275662fe688ca698e5e500745af33eeaa0d98d5b6053a1a5d95cb88b56eb3fe3d222dc16942af4d82e7772a69331fa189f5b7a8e1c3e844db2
|
data/CHANGELOG.md
CHANGED
data/LICENSE
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
|
1
|
+
This is free and unencumbered software released into the public domain.
|
2
2
|
|
3
|
-
|
3
|
+
Anyone is free to copy, modify, publish, use, compile, sell, or
|
4
|
+
distribute this software, either in source code form or as a compiled
|
5
|
+
binary, for any purpose, commercial or non-commercial, and by any
|
6
|
+
means.
|
4
7
|
|
5
|
-
|
6
|
-
of this software
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
8
|
+
In jurisdictions that recognize copyright laws, the author or authors
|
9
|
+
of this software dedicate any and all copyright interest in the
|
10
|
+
software to the public domain. We make this dedication for the benefit
|
11
|
+
of the public at large and to the detriment of our heirs and
|
12
|
+
successors. We intend this dedication to be an overt act of
|
13
|
+
relinquishment in perpetuity of all present and future rights to this
|
14
|
+
software under copyright law.
|
11
15
|
|
12
|
-
|
13
|
-
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
20
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
21
|
+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
14
23
|
|
15
|
-
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
-
SOFTWARE.
|
24
|
+
For more information, please refer to <http://unlicense.org/>
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ gem install 'h2p'
|
|
12
12
|
gem install 'wkhtmltopdf-binary'
|
13
13
|
```
|
14
14
|
|
15
|
-
Or just [use the source
|
15
|
+
Or just [use the source™️](#use-the-source).
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
@@ -25,11 +25,14 @@ my_pdf = H2P.convert(my_html)
|
|
25
25
|
|
26
26
|
## Use the source
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
If you don't want to add another dependency to your project, here's the source
|
29
|
+
of the present gem (with the [modulation](https://github.com/digital-fabric/modulation)
|
30
|
+
dependency removed.) Feel free to use and manipulate however you please:
|
31
31
|
|
32
32
|
```ruby
|
33
|
+
# This is free and unencumbered software released into the public domain
|
34
|
+
# Full license here: https://unlicense.org/
|
35
|
+
|
33
36
|
require 'tmpdir'
|
34
37
|
require 'fileutils'
|
35
38
|
|
@@ -43,7 +46,6 @@ module H2P
|
|
43
46
|
def self.convert(html)
|
44
47
|
html_path = tmp_path(:html)
|
45
48
|
pdf_path = tmp_path(:pdf)
|
46
|
-
p [html_path, pdf_path]
|
47
49
|
File.open(html_path, 'w+') { |f| f << html }
|
48
50
|
system('wkhtmltopdf', '-q', html_path, pdf_path)
|
49
51
|
IO.read(pdf_path)
|
data/lib/h2p.rb
CHANGED
data/lib/h2p/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: h2p
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: modulation
|