dyndoc-ruby 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dyndoc-convert.rb +27 -15
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcf80bf26d92a223aeee631d4e87e0cf0bad017c
4
- data.tar.gz: f330edf27a8d24f8c25dd07880150ffd787f0d4a
3
+ metadata.gz: 4dfedad69700126ccd77aeef4244d560737ddcb2
4
+ data.tar.gz: 1f31a9a7794cad05d5b49a778f78bb7361d619b9
5
5
  SHA512:
6
- metadata.gz: e774331cccf4435b40e985d464fd64aa69e152a69efcddff603964c6dfed3f8ab04b765342b8f29066117ae61b230a900df0b30877ea44fcf81aaffa2e493509
7
- data.tar.gz: eb164d962341f0b21d7e75e99086a77f9dfebff67cb6ededa6054dc3fa3dd8d3fe073f1e6366db1e657edf6fb294bf29ca1d2055a938186d4ef0457889357445
6
+ metadata.gz: 2bb129b3141ba9667741b1905a97ac1162a07d065251974c93870920df6903492a4029b3b7103fd3f61cc2b7f9f890ea1461ce3b98436c5401f753bd1483a816
7
+ data.tar.gz: 544150c1a03c353c6196e369c8c87bfabf757cf2a05e2a223135832915f47f77c25e229287a03098653f6485052a886d73b4fd704099faef5fa6d70c0a63956f
@@ -7,6 +7,22 @@ module Dyndoc
7
7
 
8
8
  @@dyndoc_tmpl_mngr=nil
9
9
 
10
+ def Dyndoc.process_html_file_from_dyn_file(code,html_file,dyn_file,dyn_layout,addr,dyndoc_start)
11
+ cli=Dyndoc::InteractiveClient.new(code,dyn_file,addr,dyndoc_start)
12
+
13
+ if dyn_layout
14
+ cli=Dyndoc::InteractiveClient.new(File.read(dyn_layout),"",addr) #File.expand_path(dyn_layout),addr)
15
+ end
16
+
17
+ if html_file and Dir.exist? File.dirname(html_file)
18
+ File.open(html_file,"w") do |f|
19
+ f << cli.content
20
+ end
21
+ else
22
+ puts cli.content
23
+ end
24
+ end
25
+
10
26
  ## does notwork when called twice!!!! (ex: jekyll-dyndoc in mode dyndoc)
11
27
  def Dyndoc.convert(input,config={})
12
28
  unless @@dyndoc_tmpl_mngr
@@ -173,8 +189,8 @@ module Dyndoc
173
189
  end
174
190
  code += "\n" + dyn_post_code if dyn_post_code
175
191
  ## TO TEST!!!
176
- Dyndoc.warn :cfg,cfg
177
- Dyndoc.warn :page,page
192
+ ##Dyndoc.warn :cfg,cfg
193
+ ##Dyndoc.warn :page,page
178
194
  code = "[#rb<]require 'ostruct';cfg = OpenStruct.new(" + cfg.inspect + ");page = OpenStruct.new(" + page.inspect + ")[#>]" +code
179
195
  code = dyn_tags + code if dyn_tags
180
196
 
@@ -189,19 +205,15 @@ module Dyndoc
189
205
 
190
206
  dyndoc_start=[:dyndoc_libs,:dyndoc_layout]
191
207
 
192
- cli=Dyndoc::InteractiveClient.new(code,dyn_file,addr,dyndoc_start)
193
-
194
- if dyn_layout
195
- cli=Dyndoc::InteractiveClient.new(File.read(dyn_layout),"",addr) #File.expand_path(dyn_layout),addr)
196
- end
197
-
198
- if html_file and Dir.exist? File.dirname(html_file)
199
- File.open(html_file,"w") do |f|
200
- f << cli.content
201
- end
202
- else
203
- puts cli.content
204
- end
208
+ unless opts[:doc_tag] == "__ALL_DOC_TAG__"
209
+ Dyndoc.process_html_file_from_dyn_file(code,html_file,dyn_file,dyn_layout,addr,dyndoc_start)
210
+ else
211
+ html_files.keys[1..-1].each do |doc_tag|
212
+ html_file=File.join(html_root,["users",opts[:user]] || [],cfg_files[:urls][doc_tag])
213
+ p [:html_multi,doc_tag,html_file]
214
+ Dyndoc.process_html_file_from_dyn_file(code.gsub(/__ALL_DOC_TAG__/,doc_tag),html_file,dyn_file,dyn_layout,addr,dyndoc_start)
215
+ end
216
+ end
205
217
  end
206
218
  end
207
219
 
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.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-30 00:00:00.000000000 Z
11
+ date: 2016-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb