rock_books 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/RELEASE_NOTES.md +4 -0
- data/lib/rock_books/reports/book_set_reporter.rb +5 -6
- data/lib/rock_books/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: 81be281ee187aa03b43808391235de30c85e05b7983e243a5df887ec6eb12b2b
|
4
|
+
data.tar.gz: 9069620c1ad95d22e35358caa4ed473899c7a897ad741f679047def6b6fee1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e67e7be616f654e5ed67e7f32836b03f56cdfc18821a7d0ee50570aadbb5cb65d0f288d0c4def2999ce2f32b150490e93aa0a6107a1995297b69d178e4ab9de9
|
7
|
+
data.tar.gz: 38819a0cfa909e3171705f11d3151bc2d128d0b946d6a31ff3cb1e6a7278e60670cb820c2fceb8e66be9891891a91dcd317079050675c1b2678b099d26b76676
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@ To simplify its implementation, RockBooks assumes some conventions:
|
|
35
35
|
|
36
36
|
At this time, RockBooks is supported only on Mac OS and Linux. (It's really the external tools that is the issue, not the Ruby code.) It should probably work with Windows Subsystem for Linux (WSL) but it hasn't been tested. If you're unsuccessful trying to use RockBooks with WSL, give me as much information as possible and I'll try to resolve the issue.
|
37
37
|
|
38
|
-
If you get an error message saying that an external command is missing, install that command using your system's package manager (e.g. `sudo apt install txt2html`).
|
38
|
+
If you get an error message saying that an external command is missing, install that command using your system's package manager (e.g. `sudo apt install txt2html`). For `wkhtmltopdf` on Linux, see [https://wkhtmltopdf.org/](https://wkhtmltopdf.org/).
|
39
39
|
|
40
40
|
#### Text Files as Input
|
41
41
|
|
data/RELEASE_NOTES.md
CHANGED
@@ -91,10 +91,10 @@ class BookSetReporter
|
|
91
91
|
|
92
92
|
private def check_prequisite_executables
|
93
93
|
raise "Report generation is not currently supported in Windows." if OS.windows?
|
94
|
-
required_exes = OS.mac? ? %w(textutil cupsfilter) : %w(txt2html
|
94
|
+
required_exes = OS.mac? ? %w(textutil cupsfilter) : %w(txt2html wkhtmltopdf)
|
95
95
|
missing_exes = required_exes.reject { |exe| executable_exists?(exe) }
|
96
96
|
if missing_exes.any?
|
97
|
-
raise "Missing required report generation executable(s): #{missing_exes.join(', ')}"
|
97
|
+
raise "Missing required report generation executable(s): #{missing_exes.join(', ')}. Please install them with your system's package manager."
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -134,16 +134,15 @@ class BookSetReporter
|
|
134
134
|
|
135
135
|
File.write(txt_filespec, report_text)
|
136
136
|
|
137
|
-
# Linux & Mac OS
|
138
|
-
cupsfilter = -> { run_command("cupsfilter #{txt_filespec} > #{pdf_filespec}") }
|
139
|
-
|
140
137
|
# Mac OS
|
141
138
|
textutil = ->(font_size) do
|
142
139
|
run_command("textutil -convert html -font 'Courier New Bold' -fontsize #{font_size} #{txt_filespec} -output #{html_filespec}")
|
143
140
|
end
|
141
|
+
cupsfilter = -> { run_command("cupsfilter #{txt_filespec} > #{pdf_filespec}") }
|
144
142
|
|
145
143
|
# Linux
|
146
144
|
txt2html = -> { run_command("txt2html --preformat_trigger_lines 0 #{txt_filespec} > #{html_filespec}") }
|
145
|
+
html2pdf = -> { run_command("wkhtmltopdf #{html_filespec} #{pdf_filespec}") }
|
147
146
|
|
148
147
|
# Use smaller size for the PDF but larger size for the web pages:
|
149
148
|
if OS.mac?
|
@@ -152,7 +151,7 @@ class BookSetReporter
|
|
152
151
|
textutil.(14)
|
153
152
|
else
|
154
153
|
txt2html.()
|
155
|
-
|
154
|
+
html2pdf.()
|
156
155
|
end
|
157
156
|
|
158
157
|
hyperlinkized_text, replacements_made = HtmlHelper.convert_receipts_to_hyperlinks(File.read(html_filespec))
|
data/lib/rock_books/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rock_books
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Bennett
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: amazing_print
|