petit-felix 0.1.1 → 0.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 +4 -4
- data/lib/felix/config.rb +1 -0
- data/lib/felix/error.rb +9 -0
- data/lib/felix/generator.rb +20 -2
- data/lib/felix/task/basic_pdf_task.rb +0 -1
- data/lib/version.rb +1 -1
- metadata +2 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a5819e6778a8ae5227fcc22048592b939e2d4fc649043cca1dd8659d97bc2c4
|
4
|
+
data.tar.gz: e7e3abd0742011659a1269c33c5997cc58115e3929cf524dfcf4bf42d3ca33a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f446b700730a5f70b4c7812624c4cd2637b8d150bf15b052e354c19b45bdb7e5efb6d356ae4c6f1722bf474e7c5bc7e7942010b49dae0241f0ddb87009568b3
|
7
|
+
data.tar.gz: 0d2beb8311d36d55b0bca706aa2ab4c9db9a6e4638025ec51cecbdf1c012bdc052efbacd40541fdbba511f2be04b58ec7e264d8668ab65f2ebed8ee9ff503d03
|
data/lib/felix/config.rb
CHANGED
@@ -26,6 +26,7 @@ module PetitFelix
|
|
26
26
|
"font_bold"=> "./assets/font/Unageo-ExtraBold.ttf",
|
27
27
|
"font_bold_italic" => "./assets/font/Unageo-ExtraBold-Italic.ttf",
|
28
28
|
"image_dir" => "./assets/images",
|
29
|
+
"worker" => "basic_pdf",
|
29
30
|
}
|
30
31
|
|
31
32
|
## Hash for custom command line argument calls
|
data/lib/felix/error.rb
ADDED
data/lib/felix/generator.rb
CHANGED
@@ -1,9 +1,15 @@
|
|
1
1
|
require "felix/task/basic_pdf_task"
|
2
|
+
require "felix/error"
|
2
3
|
|
3
4
|
module PetitFelix
|
4
5
|
|
5
6
|
class Generator
|
6
7
|
|
8
|
+
WORKERS = {
|
9
|
+
# Basic PDF
|
10
|
+
"basic_pdf" => PetitFelix::Task::BasicPDFTask.new,
|
11
|
+
}
|
12
|
+
|
7
13
|
## Renders all the files in the given directory.
|
8
14
|
|
9
15
|
def render_files(options)
|
@@ -16,9 +22,21 @@ module PetitFelix
|
|
16
22
|
options["input_files"] = input_path
|
17
23
|
end
|
18
24
|
|
19
|
-
options
|
25
|
+
if !options.key?("output_dir")
|
26
|
+
options["output_dir"] = output_path
|
27
|
+
end
|
28
|
+
|
29
|
+
if WORKERS.key?(options["worker"].downcase)
|
30
|
+
WORKERS[options["worker"].downcase].render_files options
|
31
|
+
else
|
32
|
+
text = "worker " + options["worker"].downcase + " not found. Make sure the variable \"worker\" is set correctly in your configuration settings. Available workers: "
|
20
33
|
|
21
|
-
|
34
|
+
WORKERS.keys.each do |key|
|
35
|
+
text += "\n " + key
|
36
|
+
end
|
37
|
+
|
38
|
+
PetitFelix::Error.new.print_err text
|
39
|
+
end
|
22
40
|
end
|
23
41
|
|
24
42
|
end
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: petit-felix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PunishedFelix
|
@@ -36,9 +36,6 @@ dependencies:
|
|
36
36
|
- - "~>"
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: 0.1.10
|
39
|
-
- - ">="
|
40
|
-
- !ruby/object:Gem::Version
|
41
|
-
version: 0.1.9
|
42
39
|
type: :runtime
|
43
40
|
prerelease: false
|
44
41
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -46,9 +43,6 @@ dependencies:
|
|
46
43
|
- - "~>"
|
47
44
|
- !ruby/object:Gem::Version
|
48
45
|
version: 0.1.10
|
49
|
-
- - ">="
|
50
|
-
- !ruby/object:Gem::Version
|
51
|
-
version: 0.1.9
|
52
46
|
description: Converts markdown files into PDF documents using options passed in a
|
53
47
|
hash.
|
54
48
|
email:
|
@@ -58,6 +52,7 @@ extensions: []
|
|
58
52
|
extra_rdoc_files: []
|
59
53
|
files:
|
60
54
|
- lib/felix/config.rb
|
55
|
+
- lib/felix/error.rb
|
61
56
|
- lib/felix/generator.rb
|
62
57
|
- lib/felix/metadata.rb
|
63
58
|
- lib/felix/task/basic_pdf_task.rb
|