cvgen 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cvgen/exec.rb +4 -0
- data/lib/cvgen.rb +25 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a38419b62236f2f4723419381d8ad7e1f7dfda9
|
4
|
+
data.tar.gz: c6e640aa9ed47605215c069a8f7134ec40933727
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f9d5f5a91aa35b871014d5a646ac6f34f4b5c8eaa714662b5779791d4e1d5f3c91b9e07fb46b1ab4ac31a72c7babddd8e80d0283d6070fa405ac56ec32b5d22
|
7
|
+
data.tar.gz: 77cbb9f8bd29ae4d499d92713a9b962c080d1e6191e81da734ba7b729782ac93238dede1379f65dd46edd3b9718bb228ccf4431991d1841f9606feccc72c93fb
|
data/lib/cvgen/exec.rb
CHANGED
@@ -63,6 +63,10 @@ module CVGen
|
|
63
63
|
opts.on("-w", "--watch", "Watch for changes and automatically regenerate pdf") do
|
64
64
|
config['watch'] = true
|
65
65
|
end
|
66
|
+
|
67
|
+
opts.on("-d", "--debug", "Print result of Erb preprocessing and exit") do
|
68
|
+
config['debug_erb'] = true
|
69
|
+
end
|
66
70
|
end.parse!
|
67
71
|
|
68
72
|
config
|
data/lib/cvgen.rb
CHANGED
@@ -9,7 +9,12 @@ module CVGen
|
|
9
9
|
|
10
10
|
def self.generate source, opts={}
|
11
11
|
|
12
|
-
source = Erubis::Eruby.new(source).evaluate(ErbContext.new(opts.fetch(FEATURES_OPTION, [])))
|
12
|
+
source = Erubis::Eruby.new(source, :bufvar => '@output_buffer').evaluate(ErbContext.new(opts.fetch(FEATURES_OPTION, [])))
|
13
|
+
|
14
|
+
if opts['debug_erb']
|
15
|
+
puts source
|
16
|
+
exit
|
17
|
+
end
|
13
18
|
|
14
19
|
root, warnings = Parser.parse(source, opts)
|
15
20
|
$stderr.puts warnings if warnings
|
@@ -22,11 +27,30 @@ module CVGen
|
|
22
27
|
|
23
28
|
def initialize(features)
|
24
29
|
@features = features
|
30
|
+
@sections = {}
|
25
31
|
end
|
26
32
|
|
27
33
|
def method_missing(method, *args)
|
28
34
|
@features.include?(method.to_s)
|
29
35
|
end
|
30
36
|
|
37
|
+
def create_section(name)
|
38
|
+
$stderr.puts "Warning: Overwriting section \"#{name}\"" if @sections.has_key?(name)
|
39
|
+
|
40
|
+
buf = ''
|
41
|
+
@output_buffer, temp = buf, @output_buffer
|
42
|
+
|
43
|
+
yield
|
44
|
+
|
45
|
+
@sections[name] = buf
|
46
|
+
ensure
|
47
|
+
@output_buffer = temp
|
48
|
+
end
|
49
|
+
|
50
|
+
def section(name)
|
51
|
+
$stderr.puts "Warning: No section \"#{name}\"" unless @sections.has_key?(name)
|
52
|
+
@sections[name]
|
53
|
+
end
|
54
|
+
|
31
55
|
end
|
32
56
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cvgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Wildig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kramdown
|
@@ -116,3 +116,4 @@ signing_key:
|
|
116
116
|
specification_version: 4
|
117
117
|
summary: Generate CVs in PDF format from Markdown-like source
|
118
118
|
test_files: []
|
119
|
+
has_rdoc:
|