File tree 3 files changed +14
-8
lines changed
3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 5
5
_site
6
6
cache
7
7
diamonds.csv
8
+ temp.Rmd
Original file line number Diff line number Diff line change 1
1
# !/usr/bin/Rscript
2
2
source(" _plugins/rmd2html.r" )
3
+ library(methods )
3
4
4
5
args <- commandArgs(trailingOnly = TRUE )
5
6
path <- args [1 ]
Original file line number Diff line number Diff line change @@ -14,16 +14,20 @@ def output_ext(ext)
14
14
end
15
15
16
16
def convert ( content )
17
- Tempfile . open ( [ 'knitr' , ' .Rmd' ] ) do | f |
18
- f . write ( content )
19
- f . write ( "\n " )
20
- f . flush
17
+ f = File . new ( "temp .Rmd" , "w" )
18
+ f . write ( content )
19
+ f . write ( "\n " )
20
+ f . flush
21
21
22
- # http://rubyquicktips.com/post/5862861056/execute-shell-commands
23
- content = `_plugins/knit.r #{ f . path } `
24
- raise "Knitting failed" if $?. exitstatus != 0
25
- content
22
+ # http://rubyquicktips.com/post/5862861056/execute-shell-commands
23
+ content = `_plugins/knit.r temp.Rmd`
24
+
25
+ if $?. exitstatus != 0
26
+ raise "Knitting failed"
26
27
end
28
+
29
+ content
30
+ # File.unlink f.path
27
31
end
28
32
end
29
33
end
You can’t perform that action at this time.
0 commit comments