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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f7b4c8f88256743d68afb7997797a3feaa0705e90fb5c23cce6c1bee6fb7d81
4
- data.tar.gz: f74620e5831b0f6c4d32e5537e14001783b2e4bc45325d27de2f3a9216325261
3
+ metadata.gz: 9a5819e6778a8ae5227fcc22048592b939e2d4fc649043cca1dd8659d97bc2c4
4
+ data.tar.gz: e7e3abd0742011659a1269c33c5997cc58115e3929cf524dfcf4bf42d3ca33a8
5
5
  SHA512:
6
- metadata.gz: ff2c500bcdc94644659c38e36ab7fa2ee560bb06f1d619e8efdc61786a4d4167de0fb7def3eb803080ce280fd11bebe0969ef20770fa85d8ba60c314a907773f
7
- data.tar.gz: e681ca163d188c1866c93337744e0a9ed3d012bd89ffc6e89d2103ad24d753a3302386307de3425198b66c2d670c4808e624cf89c229b4be7ece465eaf0c6056
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
@@ -0,0 +1,9 @@
1
+ module PetitFelix
2
+ class Error
3
+
4
+ def print_err(error)
5
+ print "\n\nError: " + error + "\n"
6
+ end
7
+
8
+ end
9
+ end
@@ -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["output_dir"] = output_path
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
- PetitFelix::Task::BasicPDFTask.new.render_files options
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
@@ -58,7 +58,6 @@ module PetitFelix
58
58
 
59
59
  dir = options["output_dir"]
60
60
 
61
-
62
61
  page = File.read(options["filename"])
63
62
 
64
63
  # splits the page into parts for metadata and content
data/lib/version.rb CHANGED
@@ -2,6 +2,6 @@
2
2
 
3
3
  module PetitFelix
4
4
  module Felix
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
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.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