dyndoc-ruby 0.6.6 → 0.6.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c1bc9ee21c0b73f6ec34b2d9557d231d4f5c6a7
4
- data.tar.gz: 34f971a6891594b7947d6bea3244b00c3cae9c7b
3
+ metadata.gz: 8f6d31d5bb2241eb1437d0d3d9523adb7e63cbc1
4
+ data.tar.gz: a5d2ce8ffbbfd05fc29b55e7c6a153aefd609a73
5
5
  SHA512:
6
- metadata.gz: 7f744eb4bf0c12dd54f721ece3a10484c58c4cd331fe95be72cd7b405035a670ce5f94298c302b18cb879484faa76207947604c969ec605d6fedc28e8b8c3328
7
- data.tar.gz: 765d193d39d43b2df85ccd3f9920f8d5602d9defc32b4edfbecc80bb39e00c672a7a887d2bc2c15bde10cdd13e8a6f9dcd353ad1430473ef0222d68cd4ca3cf5
6
+ metadata.gz: aae3e56ae474beab1e1c3f64c8be5b59720eaa61b9c0c17f3196583d998e8669480378c469abc466c767b3bc3e5a49629a1ab9bb2e32a1ffb4f31809418d9b5a
7
+ data.tar.gz: 1050cab499a6d104c170a84a9b7021a7abf0a07d3e2f16c5ac29ed528d10fe99c0be999e33b56d43875f72684a856c2ac386b7cc4116251733c8f6ed54fd6d02
@@ -38,4 +38,59 @@ module Dyndoc
38
38
  return cli.content
39
39
  end
40
40
 
41
+ def Dyndoc.cli_convert_from_file(dyn_file,dyn_out_file)
42
+ addr="127.0.0.1"
43
+
44
+ dyn_libs=nil
45
+
46
+ if i=(dyn_file =~ /\_?(?:html)?\.dyn$/)
47
+
48
+ ## Dyn layout
49
+ dyn_layout=dyn_file[0...i]+"_layout.dyn" if File.exist? dyn_file[0...i]+"_layout.dyn"
50
+
51
+ ## Dyn pre
52
+ dyn_pre_code=File.read(dyn_file[0...i]+"_pre.dyn") if File.exist? dyn_file[0...i]+"_pre.dyn"
53
+
54
+ ## Dyn post
55
+ dyn_post_code=File.read(dyn_file[0...i]+"_post.dyn") if File.exist? dyn_file[0...i]+"_post.dyn"
56
+
57
+ if File.exist? dyn_file[0...i]+"_.dyn_cfg"
58
+ require 'yaml'
59
+ cfg=YAML::load_file(dyn_file[0...i]+"_.dyn_cfg")
60
+ dyn_layout=File.read(cfg["layout"]) if !dyn_layout and File.exist? cfg["layout"]
61
+ dyn_pre_code=File.read(cfg["pre"]) unless dyn_pre_code and File.exist? cfg["pre"]
62
+ dyn_post_code=File.read(cfg["post"]) unless dyn_post_code and File.exist? cfg["post"]
63
+ dyn_libs=File.read(cfg["libs"]).strip if File.exist? cfg["libs"]
64
+ end
65
+
66
+ end
67
+
68
+
69
+ ## code to evaluate
70
+ code=File.read(dyn_file)
71
+ if dyn_libs or dyn_pre_code
72
+ code_pre = ""
73
+ code_pre += dyn_pre_code + "\n" if dyn_pre_code
74
+ code_pre += '[#require]'+"\n"+dyn_libs if dyn_libs
75
+ code = code_pre + '[#main][#>]' + code
76
+ end
77
+ code += "\n" + dyn_post_code if dyn_post_code
78
+ code = dyn_tag_tmpl+code if dyn_tag_tmpl
79
+ dyndoc_start=[:dyndoc_libs,:dyndoc_layout]
80
+
81
+ cli=Dyndoc::InteractiveClient.new(code,dyn_file,addr,dyndoc_start)
82
+
83
+ if dyn_layout
84
+ cli=Dyndoc::InteractiveClient.new(File.read(dyn_layout),"",addr) #File.expand_path(dyn_layout),addr)
85
+ end
86
+
87
+ if dyn_out_file and Dir.exist? File.dirname(dyn_out_file)
88
+ File.open(dyn_out_file,"w") do |f|
89
+ f << cli.content
90
+ end
91
+ else
92
+ puts cli.content
93
+ end
94
+ end
95
+
41
96
  end
@@ -33,17 +33,18 @@ module Dyndoc
33
33
 
34
34
 
35
35
  def process_dyndoc(content)
36
- ##p [:process_dyndoc_content,content]
36
+ ##Dyndoc.warn :process_dyndoc_content,content
37
37
  @content=@tmpl_mngr.parse(content)
38
38
  ##Dyndoc.warn :content, @content
39
- @tmpl_mngr.filterGlobal.envir["body.content"]=@content
39
+ @tmpl_mngr.filterGlobal.envir["body.content"]=Dyndoc::Utils.protect_dyn_block_for_atom(@content)
40
+ ##Dyndoc.warn :body_content,@tmpl_mngr.filterGlobal.envir["body.content"]
40
41
  if @tmpl_filename
41
42
  @tmpl_mngr.filterGlobal.envir["_FILENAME_CURRENT_"]=@tmpl_filename.dup
42
43
  @tmpl_mngr.filterGlobal.envir["_FILENAME_"]=@tmpl_filename.dup #register name of template!!!
43
44
  @tmpl_mngr.filterGlobal.envir["_FILENAME_ORIG_"]=@tmpl_filename.dup #register name of template!!!
44
45
  @tmpl_mngr.filterGlobal.envir["_PWD_"]=File.dirname(@tmpl_filename)
45
46
  end
46
- return @content
47
+ return Dyndoc::Utils.unprotect_dyn_block_for_atom(@content)
47
48
  end
48
49
 
49
50
  def init_server
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndoc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-16 00:00:00.000000000 Z
11
+ date: 2016-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb