dyndoc-ruby-core 1.4.3 → 1.4.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dyndoc-core.rb +2 -0
- data/lib/dyndoc/base/filter/server.rb +3 -1
- data/lib/dyndoc/base/tmpl/parse_do.rb +44 -27
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0f4236705f48cc9db8e234489a77303b4213389b1dbf4f4d5681851cb1f8a7c
|
4
|
+
data.tar.gz: 04423ca31ef550ea3e30d5fddc86cb5027064b8ac68aefe733da9a13f6444130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be41ec047d2d52b9d3963e23f664989b2bb6eed24c4ee1e0df7737b9f4a0814026f04fac7cf8341c7af79e27a63e2f244cfbed87cedf2dfa24232de8970cd0fe
|
7
|
+
data.tar.gz: 9f482b734d270328b608ee7ec6bfcbde417df4ee65f0f48a42384c78c62c15ed7736479992c5a9f2313c223e19003f523512e9837d8ef6867ada8a3f339df5a5
|
data/lib/dyndoc-core.rb
CHANGED
@@ -30,6 +30,8 @@ Settings.define 'cfg_dyn.cmd_pandoc_options', :type => Array, :default => []
|
|
30
30
|
Settings.define 'cfg_dyn.options.pdflatex_nb_pass', :type => Integer, :default => 1
|
31
31
|
Settings.define 'cfg_dyn.options.pdflatex_echo', :type => :boolean, :default => false
|
32
32
|
Settings.define 'cfg_dyn.debug', :type => :boolean, :default => false
|
33
|
+
Settings.define 'cfg_dyn.parse_rescue', :type => :boolean, :default => true
|
34
|
+
Settings.define 'cfg_dyn.parse_rescue_mode', :type => Symbol, :default => :simple
|
33
35
|
Settings.define 'cfg_dyn.ruby_only', :type => :boolean, :default => false
|
34
36
|
|
35
37
|
Settings.define 'cfg_dyn.dyndoc_session', :type => Symbol, :default => :normal #or :interactive
|
@@ -93,7 +93,9 @@ module Dyndoc
|
|
93
93
|
end
|
94
94
|
|
95
95
|
rescue SyntaxError
|
96
|
-
|
96
|
+
|
97
|
+
$outRbError="RbServer syntax error in: "+code
|
98
|
+
puts $outRbError
|
97
99
|
raise SystemError if Dyndoc.cfg_dyn[:dyndoc_mode]==:normal and Dyndoc.cfg_dyn[:ruby_debug]!=:none
|
98
100
|
if Dyndoc.cfg_dyn[:dyndoc_mode]!=:normal
|
99
101
|
$dyn_logger.write("\nERROR Ruby Syntax:\n"+code+"\n")
|
@@ -28,6 +28,7 @@ module Dyndoc
|
|
28
28
|
class TemplateManager
|
29
29
|
|
30
30
|
@@depth=0
|
31
|
+
@@outError=""
|
31
32
|
|
32
33
|
@@cmd=["newBlck","input","require","def","func","meth","new","super","blck","do","if","for","case", "loop","r","renv","rverb","rbverb","jlverb","rout","rb","var","set","hide","format","txt","code","<","<<",">","eval","ifndef","tags","keys","opt","document","yield","get","part","style"]
|
33
34
|
## Alias
|
@@ -89,7 +90,7 @@ module Dyndoc
|
|
89
90
|
@vars,varsOld=filterLoc.envir,@vars
|
90
91
|
Dyndoc.vars=@vars
|
91
92
|
@filter=filterLoc unless @filter ##root filter
|
92
|
-
out=""
|
93
|
+
out,$outError ="",""
|
93
94
|
#p texblock
|
94
95
|
texblock.map{|b|
|
95
96
|
#p b
|
@@ -98,33 +99,49 @@ module Dyndoc
|
|
98
99
|
cmd=@@cmdAlias[cmd] if @@cmdAlias.keys.include? cmd
|
99
100
|
#Dyndoc.warn "parse:cmd,b",[cmd,b]
|
100
101
|
@@depth+=1
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
102
|
+
## To deactivate, put it inside ~/.dyndoc.yml
|
103
|
+
if Dyndoc.cfg_dyn[:parse_rescue]
|
104
|
+
begin
|
105
|
+
## Dyndoc.warn "cmd",[cmd,b]
|
106
|
+
method("do_"+cmd).call(out,b,filterLoc)
|
107
|
+
## Dyndoc.warn [:out,out] if cmd=="eval"
|
108
|
+
rescue
|
109
|
+
$outError << "=> Leaving block depth #{@@depth}: " << "\n"
|
110
|
+
codeText = b.inspect
|
111
|
+
##Dyndoc.warn "codeText",codeText
|
112
|
+
nbChar=(Dyndoc.cfg_dyn[:nbChar_error]) ? Dyndoc.cfg_dyn[:nbChar_error] : 80
|
113
|
+
if codeText.length > nbChar
|
114
|
+
codeText=codeText[0..((nbChar*2/3).to_int)]+" ...... "+codeText[(-(nbChar/3).to_int)..-1]
|
115
|
+
end
|
116
|
+
$outError << codeText << "\n"
|
117
|
+
if $outRbError && !$outRbError.empty?
|
118
|
+
$outError << $outRbError << "\n"
|
119
|
+
$outRbError = ""
|
120
|
+
end
|
121
|
+
if @@depth==1
|
122
|
+
$outError << "=> Exiting abnormally!</code>" << "\n"
|
123
|
+
@@outError << "<pre style='background-color: #EBECE4;'><code>"+$outError+"</code></pre>" << "\n"
|
124
|
+
puts "@@outError: \n"+@@outError
|
125
|
+
#raise SystemExit
|
126
|
+
out << @@outError
|
127
|
+
@@outError=""
|
128
|
+
else
|
129
|
+
@@outError << "<pre style='background-color: #EBECE4;'><code>Dyn Runtime Error\n"+$outError+"</code></pre>"
|
130
|
+
$outError=""
|
131
|
+
if Dyndoc.cfg_dyn[:parse_rescue_mode]==:simple
|
132
|
+
out << @@outError
|
133
|
+
@@outError=""
|
134
|
+
else
|
135
|
+
raise RuntimeError, "Dyn Runtime Error"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
Dyndoc.warn "out #{@@depth} :",$outError
|
139
|
+
|
140
|
+
ensure
|
141
|
+
@@depth -= 1
|
122
142
|
end
|
123
|
-
|
124
|
-
|
125
|
-
end
|
126
|
-
###TO temporarily AVOID RESCUE MODE:
|
127
|
-
###
|
143
|
+
else
|
144
|
+
method("do_"+cmd).call(out,b,filterLoc)
|
128
145
|
end
|
129
146
|
}
|
130
147
|
##restore old partTag and vars
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyndoc-ruby-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CQLS
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-11-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configliere
|
@@ -198,7 +198,7 @@ licenses:
|
|
198
198
|
- MIT
|
199
199
|
- GPL-2.0
|
200
200
|
metadata: {}
|
201
|
-
post_install_message:
|
201
|
+
post_install_message:
|
202
202
|
rdoc_options: []
|
203
203
|
require_paths:
|
204
204
|
- lib
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
requirements:
|
216
216
|
- none
|
217
217
|
rubygems_version: 3.0.6
|
218
|
-
signing_key:
|
218
|
+
signing_key:
|
219
219
|
specification_version: 4
|
220
220
|
summary: R and Ruby in text document
|
221
221
|
test_files: []
|