dyndoc-ruby 0.9.16 → 0.9.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dyndoc-convert.rb +15 -4
- data/lib/dyndoc-html-servers.rb +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cc121c259fd5163b90033b2435068a99ddaf71f
|
4
|
+
data.tar.gz: 5aa20262aa934934b5bb3859a99d11e3cbbc88a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6337908a9e9ffba759dfcb407501237e53e9ff9b7fe62fc5e95a18e436add7ba71304885c9348bd14da492eaa5deb2620a2254bcd98a1182ca76afa51f64f066
|
7
|
+
data.tar.gz: 39035a910109d0742fe2d5c4526ac80f0a200694ab2c1277dbb1adedd23620cf0b03352158382e15c33c8b34f625aa75da5303dd5f20c1ff28c93e931a48428e
|
data/lib/dyndoc-convert.rb
CHANGED
@@ -14,6 +14,11 @@ module Dyndoc
|
|
14
14
|
cli=Dyndoc::InteractiveClient.new(File.read(dyn_layout),"",addr) #File.expand_path(dyn_layout),addr)
|
15
15
|
end
|
16
16
|
|
17
|
+
## fix html_file for _rmd, _adoc and _ttm
|
18
|
+
if html_file =~ /^(.*)_(rmd|adoc|ttm)\.html$/
|
19
|
+
html_file = $1+".html"
|
20
|
+
end
|
21
|
+
|
17
22
|
if html_file and Dir.exist? File.dirname(html_file)
|
18
23
|
File.open(html_file,"w") do |f|
|
19
24
|
f << cli.content
|
@@ -128,7 +133,8 @@ module Dyndoc
|
|
128
133
|
if b[0].empty? and b.length>4
|
129
134
|
require 'yaml'
|
130
135
|
page=YAML.load(b[2])
|
131
|
-
|
136
|
+
##p [:page,page]
|
137
|
+
cfg.merge!(page) if page
|
132
138
|
code=b[4..-1].join("")
|
133
139
|
end
|
134
140
|
end
|
@@ -137,6 +143,9 @@ module Dyndoc
|
|
137
143
|
dyn_root= cfg["dyn_root"] || opts[:dyn_root] || File.expand_path("..",dyn_file)
|
138
144
|
html_root= cfg["html_root"] || opts[:html_root] || File.expand_path("..",dyn_file)
|
139
145
|
sys_root = cfg["sys_root"] || opts[:sys_root] || File.expand_path('..',dyn_root)
|
146
|
+
cfg["dyn_root"] = dyn_root
|
147
|
+
cfg["html_root"] = html_root
|
148
|
+
cfg["sys_root"] = sys_root
|
140
149
|
##p [:sys_root,dyn_root,sys_root]
|
141
150
|
|
142
151
|
## Dyn Model: generally helps to define a style (layout, preload, postload)
|
@@ -243,8 +252,7 @@ module Dyndoc
|
|
243
252
|
end
|
244
253
|
code += "\n" + dyn_post_code if dyn_post_code
|
245
254
|
## TO TEST!!!
|
246
|
-
##
|
247
|
-
Dyndoc.warn :cfg,cfg
|
255
|
+
##Dyndoc.warn :cfg,cfg
|
248
256
|
##Dyndoc.warn :page,page
|
249
257
|
code = "[#rb<]require 'ostruct';cfg = OpenStruct.new(" + cfg.inspect + ");page = OpenStruct.new(" + page.inspect + ")[#>]" +code
|
250
258
|
code = dyn_tags + code if dyn_tags
|
@@ -259,6 +267,7 @@ module Dyndoc
|
|
259
267
|
code_path << "\n" << File.join(sys_root,'system','dynlib')
|
260
268
|
code_path << "\n" << File.join(opts[:dyn_root],'dynlib')
|
261
269
|
code_path << "\n" << opts[:dyn_root] << "\n"
|
270
|
+
code_path << "\n" << "[#require]RodaSrvCore" << "\n"
|
262
271
|
code_path << "[#main][#<]\n"
|
263
272
|
code = code_path + code
|
264
273
|
|
@@ -380,6 +389,7 @@ module Dyndoc
|
|
380
389
|
# dyn_root can be overwritten by cfg
|
381
390
|
# defines the root of relative predefined dyn (pre, post, ...) files
|
382
391
|
dyn_root= cfg["dyn_root"] || opts[:dyn_root] || File.expand_path("..",dyn_file)
|
392
|
+
cfg["dyn_root"] = dyn_root
|
383
393
|
|
384
394
|
cfg["layout"] = cfg["pre"] = cfg["post"] = cfg["model"] if cfg["model"]
|
385
395
|
|
@@ -456,7 +466,8 @@ module Dyndoc
|
|
456
466
|
code_path << "[#main][#<]\n"
|
457
467
|
code = code_path + code
|
458
468
|
|
459
|
-
###
|
469
|
+
###
|
470
|
+
Dyndoc.warn :code,code
|
460
471
|
|
461
472
|
dyndoc_start=[:dyndoc_libs,:dyndoc_layout]
|
462
473
|
|
data/lib/dyndoc-html-servers.rb
CHANGED
@@ -78,7 +78,11 @@ module Dyndoc
|
|
78
78
|
html_file=opts[:html_files][opts[:current_doc_tag]] # No more default # || html_files[""]
|
79
79
|
##p [:opts,opts,:current_doc_tag,opts[:current_doc_tag]]
|
80
80
|
Dyndoc.cli_convert_from_file(dyn_file[1..-1],html_file, opts)
|
81
|
-
|
81
|
+
## fix html_file for _rmd, _adoc and _ttm
|
82
|
+
if html_file =~ /^(.*)_(rmd|adoc|ttm)\.html$/
|
83
|
+
html_file = $1+".html"
|
84
|
+
end
|
85
|
+
puts dyn_file[1..-1]+" processed => "+html_file+" created!"
|
82
86
|
if RUBY_PLATFORM =~ /darwin/
|
83
87
|
options[:first] = html_file != old_html_file
|
84
88
|
if html_file != old_html_file
|