dyndoc-ruby-core 1.4.8 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b0f4236705f48cc9db8e234489a77303b4213389b1dbf4f4d5681851cb1f8a7c
4
- data.tar.gz: 04423ca31ef550ea3e30d5fddc86cb5027064b8ac68aefe733da9a13f6444130
3
+ metadata.gz: 0b27ebc4ded9a4c39100237831dbbaddc0fd5b7448902512c65c3d9d6b8e99df
4
+ data.tar.gz: ffd6521535cfdcaad7bbc2c1c6d484e4ead55e10441896d38d3161aa64f1e9b6
5
5
  SHA512:
6
- metadata.gz: be41ec047d2d52b9d3963e23f664989b2bb6eed24c4ee1e0df7737b9f4a0814026f04fac7cf8341c7af79e27a63e2f244cfbed87cedf2dfa24232de8970cd0fe
7
- data.tar.gz: 9f482b734d270328b608ee7ec6bfcbde417df4ee65f0f48a42384c78c62c15ed7736479992c5a9f2313c223e19003f523512e9837d8ef6867ada8a3f339df5a5
6
+ metadata.gz: b25f6cda8f759e8f468deb59d946312d242c3006a44ca32c5e087a0ad5654d5ce1d148224729f0b90365c51dd7d4abd7e3832fdbd5a5b90ee551e3829f04ec3e
7
+ data.tar.gz: '0884f5956472578c84b6736838062d6e3434aaa1612e87d409d256d83f2c2f6de4ba976485a4f1c798a6e070bb586823b2f1352214065b7ba96eb3ca602a1539'
@@ -378,7 +378,8 @@ module Dyndoc
378
378
  $dyn_logger.write("ERROR R: #{txt} was not properly evaluated!\n") unless Dyndoc.cfg_dyn[:dyndoc_mode]==:normal
379
379
  res=txt
380
380
  end
381
- #puts "#{txt} in #{@rEnvir[0]} is #{res}"
381
+ #
382
+ puts "#{txt} in #{@rEnvir[0]} is #{res}"
382
383
  when ":r","#r"
383
384
  return txt if @mode==:pre
384
385
  res=RServer.safe_output(txt2,@rEnvir[0],:pretty=>true)
@@ -387,7 +388,8 @@ module Dyndoc
387
388
  $dyn_logger.write("ERROR R: #{txt} was not properly evaluated!\n") unless Dyndoc.cfg_dyn[:dyndoc_mode]==:normal
388
389
  res=txt
389
390
  end
390
- #puts "#{txt} in #{@rEnvir[0]} is #{res}"
391
+ #
392
+ puts "#{txt} in #{@rEnvir[0]} is #{res}"
391
393
  when ":jl","#jl"
392
394
  return txt if @mode==:pre
393
395
  ## puts "#jl:"+txt2
@@ -395,7 +397,7 @@ module Dyndoc
395
397
  when "@"
396
398
  return txt if @mode==:pre
397
399
  res=CallFilter.output(txt,self)
398
- when "#","##"
400
+ when "#","##","%"
399
401
  #p @envir
400
402
  #p @envir.output(txt,@mode,@escape)
401
403
  #p @envir.output(in_type+"{"+txt2+"}",@mode,@escape)
@@ -538,15 +540,14 @@ module Dyndoc
538
540
  return res unless out_type
539
541
  case out_type
540
542
  when ":=",":rb=",":Rb=","#rb=","#Rb="
541
- #if res.is_a? String
542
- # res.inspect
543
- #else res.is_a? Array
543
+ if res.is_a? String
544
+ res.inspect
544
545
  #puts out_type;p res;p res.inspect
545
- #if res.is_a? Array and res.length==1 and res[0].is_a? String
546
- # res[0].inspect
547
- #else
546
+ elsif res.is_a? Array and res.length==1
547
+ res[0].inspect
548
+ else
548
549
  res.inspect
549
- #end
550
+ end
550
551
  when ":",":rb",":Rb","#rb","#Rb"
551
552
  #puts "convert [rb]:";p res
552
553
  if res.is_a? Array
@@ -555,6 +556,7 @@ module Dyndoc
555
556
  res.to_s
556
557
  end
557
558
  when ":R=","#R=",":r=","#r="
559
+ #puts "convert [R]";p res
558
560
  if res.is_a? Array
559
561
  res2="c("+res.map{|e| "'"+e.to_s+"'"}.join(",")+")"
560
562
  res2.gsub!(/\\/,'\\\\\\\\')
@@ -575,7 +577,7 @@ module Dyndoc
575
577
  else
576
578
  res.to_s
577
579
  end
578
- when "=","@=","#=","##=" ,"none="
580
+ when "=","@=","#=","%=","##=" ,"none="
579
581
  #puts "convert [=]";p res
580
582
  if res.is_a? Array
581
583
  res.join(",")
@@ -587,7 +589,7 @@ module Dyndoc
587
589
  "%Q{"+res2+"}"
588
590
  end
589
591
  end
590
- when "","@","#","##","none","#F"
592
+ when "","@","#","%","##","none","#F"
591
593
  if res.is_a? Array
592
594
  res.join(",")
593
595
  else
@@ -831,8 +831,8 @@ module Dyndoc
831
831
 
832
832
  def JLServer.initVerb
833
833
  Julia << "Base.include(@__MODULE__,\""+File.join(Dyndoc.cfg_dir[:gem_path],"share","julia","dyndoc.jl")+"\")"
834
- Julia << "push!(Libdl.DL_LOAD_PATH,\"/usr/lib\");push!(Libdl.DL_LOAD_PATH,\"/usr/local/lib\")"
835
- @@initVerb=true
834
+ Julia << "push!(Libdl.DL_LOAD_PATH,\"/usr/lib\");push!(Libdl.DL_LOAD_PATH,\"/usr/local/lib\")"
835
+ @@initVerb=true
836
836
  end
837
837
 
838
838
  def JLServer.inputsAndOutputs(code,hash=true)
@@ -904,13 +904,15 @@ module Dyndoc
904
904
 
905
905
  def JLServer.echo_verb(txt,mode)
906
906
  txtout=Dyndoc::JLServer.echo(txt).strip
907
+ ## p [:jl_echo_verb,txtout]
907
908
  mode=:default unless Dyndoc::VERB.keys.include? mode
908
909
  header= (mode!=:default) and txtout.length>0
909
910
  out=""
910
911
  out << Dyndoc::VERB[mode][:begin] << "\n" if header
911
912
  out << txtout
912
913
  out << "\n" << Dyndoc::VERB[mode][:end] << "\n" if header
913
- out
914
+ ## p [:out, out]
915
+ out
914
916
  end
915
917
 
916
918
  end
@@ -232,7 +232,7 @@ module Dyndoc
232
232
  class CallScanner < Scanner
233
233
 
234
234
  @@type[:call]={
235
- :start=>/\\?(?:\#|\#\#|@|#F|#R|#r|\:R|\:r|#Rb|#rb|\:|\:Rb|\:rb|\:jl|#jl)?\{/,
235
+ :start=>/\\?(?:\#|\%|\#\#|@|#F|#R|#r|\:R|\:r|#Rb|#rb|\:|\:Rb|\:rb|\:jl|#jl)?\{/,
236
236
  :stop=> /\\?\}/,
237
237
  :mode=>{:start=>-1,:stop=>0,:length=>1},
238
238
  :escape_start=>['\{'], #doivent être parsable dans start
@@ -257,11 +257,11 @@ module Dyndoc
257
257
  }
258
258
  =end
259
259
  @@type[:dtag] = {
260
- :start=>'\{[\#\@]([\w\:\|-]*[<>]?[=?!><]?(\.\w*)?)\]',
261
- :stop=> '\[[\#\@]([\w\:\|-]*[<>]?[=?!><]?)\}',
262
- :atom=>{:match=>/(\{[\#\@][\w\:\|]*)([\#\@]\})/,:replace=>{2=>"][#}"}},
260
+ :start=>'\{[\#\@\%]([\w\:\|-]*[<>]?[=?!><]?(\.\w*)?)\]',
261
+ :stop=> '\[[\#\@\%]([\w\:\|-]*[<>]?[=?!><]?)\}',
262
+ :atom=>{:match=>/(\{[\#\@\%][\w\:\|]*)([\#\@\%]\})/,:replace=>{2=>"][#}"}},
263
263
  :block=> '\]', #no longer |
264
- :keyword=>['\[[\#\@]','\]'],
264
+ :keyword=>['\[[\#\%\@]','\]'],
265
265
  :mode=>{:start=>0,:stop=>-1,:length=>1}
266
266
  }
267
267
 
@@ -621,11 +621,12 @@ module Dyndoc
621
621
  end
622
622
  ##Dyndoc.warn "to scan", @scan.string[@scan.pos..-1]
623
623
  ##Dyndoc.warn "tag_reg",[blocktag_reg,tag_reg]
624
+ ##p ["tag_reg",[blocktag_reg,tag_reg]]
624
625
  end
625
626
  if (tag_keyword and (@scan.check_until(blocktag_reg))) #or (!@named_tags.empty? and check_until_for_named_tags)
626
627
  check_until_for_named_tags unless @named_tags.empty?
627
628
  key=@scan[2]
628
- ##Dyndoc.warn "keyword",[key,@scan[0],@scan[1],@scan[2]]
629
+ ##Dyndoc.warn p ["keyword",[key.scan(tag_reg),key.scan(tag_reg)[-1],key,@scan[0],@scan[1],@scan[2]]]
629
630
  ##Dyndoc.warn "pre_math,tag_selected",[@scan.pre_match,@tag_selected] if key=="[#tag]"
630
631
  res << find_text(from,key,inside)
631
632
  @is_arg=false if @is_arg
@@ -635,7 +636,7 @@ module Dyndoc
635
636
  res << (key=@tag_selected)
636
637
  else
637
638
  #key=tag_reg.match(key)[0]
638
- key= key.scan(tag_reg)[0]
639
+ key= key.scan(tag_reg)[-1]
639
640
  ##Dyndoc.warn "key(AP)",key if key=="tag"
640
641
  res << (key=key.to_sym) if key and !key.empty?
641
642
  end
@@ -151,6 +151,9 @@ module Dyndoc
151
151
  ## equivalent to :pre_doc for not interactive document
152
152
  def require_first
153
153
  require_dyndoc_libs("Dyn/Base")
154
+ Dyndoc.cfg_dyn[:require_first].each do |libs|
155
+ require_dyndoc_libs(libs)
156
+ end
154
157
  end
155
158
 
156
159
  def require_dyndoc_libs(libs)
@@ -646,7 +646,7 @@ p [vars,b2]
646
646
  end
647
647
  when :"r>>",:"R>>",:rout,:rverb
648
648
  newblck=blck[i]
649
- i,*b2=next_block(blck,i)
649
+ i,*b2=next_block(blck,i)
650
650
  if cond_tag and cond
651
651
  vars,b2=get_named_blck(b2,filter)
652
652
  if b2
@@ -671,7 +671,7 @@ p [vars,b2]
671
671
  end
672
672
  when :"jl>>",:jlverb,:"rb>>",:rbverb
673
673
  newblck=blck[i]
674
- i,*b2=next_block(blck,i)
674
+ i,*b2=next_block(blck,i)
675
675
  if cond_tag and cond
676
676
  vars,b2=get_named_blck(b2,filter)
677
677
  if b2
@@ -690,12 +690,12 @@ p [vars,b2]
690
690
  tex << val
691
691
  end
692
692
  =end
693
- make_named_blck(tex,filter,vars,b2)
694
- filter.outType=nil
695
- end
693
+ make_named_blck(tex,filter,vars,b2)
694
+ filter.outType=nil
695
+ end
696
696
  end
697
- when :>>
698
- i,*b2=next_block(blck,i)
697
+ when :>>
698
+ i,*b2=next_block(blck,i)
699
699
  if cond_tag and cond
700
700
  file,b2=get_named_blck(b2,filter)
701
701
  if b2 and file
@@ -1827,7 +1827,7 @@ p call
1827
1827
  require "dyndoc/common/uv" if @@interactive
1828
1828
 
1829
1829
  warn_level = $VERBOSE;$VERBOSE = nil
1830
- tex << (resUV=(@@interactive ? Uv.parse(res.force_encoding("utf-8"), "xhtml", File.join(Uv.syntax_path,"r.syntax") , false, "solarized",false) : res.force_encoding("utf-8") ))
1830
+ tex << (resUV=(@@interactive ? Uv.parse(res.force_encoding("utf-8"), "xhtml", File.join(Uv.syntax_path,"source.r.syntax") , false, "solarized",false) : res.force_encoding("utf-8") ))
1831
1831
  $VERBOSE = warn_level
1832
1832
  #Dyndoc.warn "rverb:result",resUV
1833
1833
  @rEnvir.shift if inR
@@ -1860,7 +1860,7 @@ p call
1860
1860
  ## Dyndoc.warn "rbverb:res",res
1861
1861
  require "dyndoc/common/uv" if @@interactive
1862
1862
  warn_level = $VERBOSE;$VERBOSE = nil
1863
- tex << (@@interactive ? Uv.parse(res, "xhtml", File.join(Uv.syntax_path,"ruby.syntax") , false, "solarized",false) : res )
1863
+ tex << (@@interactive ? Uv.parse(res.force_encoding("utf-8"), "xhtml", File.join(Uv.syntax_path,"source.ruby.syntax") , false, "solarized",false) : res )
1864
1864
  $VERBOSE = warn_level
1865
1865
  #puts "rverb:result";p res
1866
1866
 
@@ -1892,9 +1892,10 @@ p call
1892
1892
  res=JLServer.echo_verb(code,@@interactive ? :raw : mode)
1893
1893
  require "dyndoc/common/uv" if @@interactive
1894
1894
  warn_level = $VERBOSE;$VERBOSE = nil
1895
- tex << (@@interactive ? Uv.parse(res, "xhtml", File.join(Uv.syntax_path,"julia.syntax") , false, "solarized",false) : res )
1895
+ ## puts "jlverb:result";p res
1896
+ tex << (@@interactive ? Uv.parse(res.force_encoding("utf-8"), "xhtml", File.join(Uv.syntax_path,"source.julia.syntax") , false, "solarized",false) : res )
1896
1897
  $VERBOSE = warn_level
1897
- #puts "rverb:result";p res
1898
+ # puts "jlverb:result";p res
1898
1899
 
1899
1900
  filter.outType=nil
1900
1901
  end
@@ -119,7 +119,7 @@ module Dyndoc
119
119
  end
120
120
 
121
121
  def Utils.protect_extraction(str)
122
- str.gsub(/(?:\#|\#\#|@|#F|#R|#r|\:R|\:r|#Rb|#rb|\:|\:Rb|\:rb)+\{/) {|e| "\\"+e}
122
+ str.gsub(/(?:\#|\:dyn|\#\#|@|#F|#R|#r|\:R|\:r|#Rb|#rb|\:|\:Rb|\:rb)+\{/) {|e| "\\"+e}
123
123
  end
124
124
 
125
125
  ## the scanner converts automatically {#toto#} in {#toto][#} and {@toto@} in {@toto][#}
data/lib/dyndoc-core.rb CHANGED
@@ -42,6 +42,7 @@ Settings.define 'cfg_dyn.working_dir', :type => String, :default => ""
42
42
  Settings.define 'cfg_dyn.root_doc', :type => String, :default => ""
43
43
  Settings.define 'cfg_dyn.nbChar_error', :type => Integer, :default => 300
44
44
  Settings.define 'cfg_dyn.langs', :type => Array, :default => ["R"]
45
+ Settings.define 'cfg_dyn.require_first', :type => Array, :default => [""]
45
46
 
46
47
  Settings.define 'cfg_dyn.devel_mode', :type=> Symbol, :default=> :none
47
48
  Settings.define 'cfg_dyn.ruby_debug', :type=> Symbol, :default=> :none
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.8
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2022-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configliere
@@ -34,22 +34,22 @@ dependencies:
34
34
  name: ultraviolet
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: 1.0.0
40
37
  - - "~>"
41
38
  - !ruby/object:Gem::Version
42
39
  version: '1.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.0.0
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: 1.0.0
50
47
  - - "~>"
51
48
  - !ruby/object:Gem::Version
52
49
  version: '1.0'
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: 1.0.0
53
53
  description: " Provide templating in text document.\n"
54
54
  email: rdrouilh@gmail.com
55
55
  executables: []
@@ -193,7 +193,7 @@ files:
193
193
  - share/julia/dyndocOLD.jl
194
194
  - share/julia/dynreport.jl
195
195
  - share/julia/ruby.jl
196
- homepage: http://cqls.upmf-grenoble.fr
196
+ homepage: http://cqls.dyndoc.fr
197
197
  licenses:
198
198
  - MIT
199
199
  - GPL-2.0
@@ -214,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  requirements:
216
216
  - none
217
- rubygems_version: 3.0.6
217
+ rubygems_version: 3.3.7
218
218
  signing_key:
219
219
  specification_version: 4
220
220
  summary: R and Ruby in text document