json_resume 0.1.1 → 0.2.0
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/bin/json_resume +32 -5
- data/lib/json_resume/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65eb011e84de52ee1e5c96fb447a999a200dd077
|
4
|
+
data.tar.gz: ee059110bda4d86bfa5b1efaeb9200feeecbf315
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acb9433b5f95a9e833577d246c0175be49305a1df3cd6878f8bb0142395a505aae0973a86b04671c1704ea87f0a55536ed12a5e47a709d88d8cdf079d9234d8e
|
7
|
+
data.tar.gz: c9a29c045e7e384991675fd6f444c233eefe68822b7965b0afce626c6bf304374c6650d94f5611c3f501c9a0655a65958d2b1237ef36f30d3e1b455326f1a40f
|
data/bin/json_resume
CHANGED
@@ -43,7 +43,7 @@ class JsonResumeCLI < Thor
|
|
43
43
|
tgz = Zlib::GzipReader.new(File.open("#{@@orig_locn}/../extras/resume_html.tar.gz", 'rb'))
|
44
44
|
Minitar.unpack(tgz, "#{dest}/#{dir_name}")
|
45
45
|
msg = generate_file(json_input, template, "html", "#{dest}/#{dir_name}/page.html")
|
46
|
-
msg += " Place
|
46
|
+
msg += " Place #{dest}/#{dir_name}/ in /var/www/ to host."
|
47
47
|
end
|
48
48
|
|
49
49
|
def convert_to_html_pdf(json_input, template, dest=Dir.pwd)
|
@@ -77,11 +77,38 @@ class JsonResumeCLI < Thor
|
|
77
77
|
end
|
78
78
|
|
79
79
|
def convert_to_tex_pdf(json_input, template, dest=Dir.pwd)
|
80
|
-
|
81
|
-
convert_to_tex(json_input, template, dest,
|
82
|
-
|
80
|
+
file1 = "resume"; filename = "#{file1}.tex"
|
81
|
+
convert_to_tex(json_input, template, dest, filename)
|
82
|
+
if `which pdflatex` == ""
|
83
|
+
puts "It looks like pdflatex is not installed..."
|
84
|
+
puts "Either install it with instructions at..."
|
85
|
+
puts "http://dods.ipsl.jussieu.fr/fast/pdflatex_install.html"
|
86
|
+
return use_write_latex(dest, filename)
|
87
|
+
end
|
88
|
+
if `kpsewhich moderncv.cls` == ""
|
89
|
+
puts "It looks liks moderncv package for tex is not installed"
|
90
|
+
puts "Read about it here: http://ctan.org/pkg/moderncv"
|
91
|
+
return use_write_latex(dest, filename)
|
92
|
+
end
|
93
|
+
system("pdflatex -shell-escape -interaction=nonstopmode #{dest}/#{filename}")
|
94
|
+
[".tex",".out",".aux",".log"].each do |ext|
|
95
|
+
FileUtils.rm "#{dest}/#{file1}#{ext}"
|
96
|
+
end
|
97
|
+
msg = "\nPDF is ready at #{dest}/#{file1}.pdf"
|
98
|
+
end
|
99
|
+
|
100
|
+
def use_write_latex(dest, filename)
|
101
|
+
reply = ask "Create PDF online using writeLatex ([y]n)?"
|
102
|
+
if reply == "" || reply == "y"
|
103
|
+
return convert_using_writeLatex(dest, filename)
|
104
|
+
end
|
105
|
+
msg = "Latex file created at #{dest}/#{filename}"
|
106
|
+
end
|
107
|
+
|
108
|
+
def convert_using_writeLatex(dest, filename)
|
109
|
+
tex_file = File.read("#{dest}/#{filename}")
|
83
110
|
RestClient.post(WL_URL, :snip => tex_file, :splash => "none") do |response, req, res, &bb|
|
84
|
-
FileUtils.rm "#{dest}
|
111
|
+
FileUtils.rm "#{dest}/#{filename}"
|
85
112
|
msg = "\nPDF is ready at #{response.headers[:location]}"
|
86
113
|
end
|
87
114
|
end
|
data/lib/json_resume/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_resume
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prateek Agarwal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|