dyndoc-ruby 0.8.0 → 0.8.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dyndoc-convert.rb +28 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6dfa98b7f4b1e4e0f2e24a0e1a14f0c606652c70
4
- data.tar.gz: db99310de0352bed9ede3996f38507afae4e9b06
3
+ metadata.gz: 435bd097c09c1f84c3563c140c1d2ddc0c1cefbe
4
+ data.tar.gz: dab182d72493fd9e57becbcf893d02d4946b0499
5
5
  SHA512:
6
- metadata.gz: 61d509f0b744936f553afafcd46c57d6c6f61fdabdae4859d81c3ecf1af8328e4dd4ee77abf182a67aa349c722f3293b68180a857ad966d057e40d0b2c43a1dc
7
- data.tar.gz: 2959605938ad254875a139fb6d4d697e4e5b5040efa73ca55902d2d495b01d6a2f4c48f677951e5cf20a3fbb91494402d852ad8f99b83f4211a41eaab7c761c5
6
+ metadata.gz: 67718adc452e2b60a4125e2ce4c4181f378f30e72e6eb9fa95e7ff29f9acb4ede9008fac4a1ea999b7c5c0b39b913fe22fbe4d150870d7ab5a855a040226452e
7
+ data.tar.gz: 73ec96e20978162b86e0e2738261f63ef0948e3aee0c70fbf3c7d5aac28af4ad94dc12986809073fa28c9c39a6741513d0dcbe2c8491c3f6f534c1d6fa50b44a
@@ -51,8 +51,26 @@ module Dyndoc
51
51
 
52
52
  dyn_path=dyn_file.split(File::Separator)
53
53
 
54
+ ## Complete info related to the related dyn file
55
+ html_files=opts[:html_files]
56
+ if opts[:user]
57
+ html_urls={}
58
+ html_files.each{|tag,html_file| html_urls[tag]=(html_file =~ /^\/users\/#{opts[:user]}(.*)/ ? $1 : html_file)}
59
+ html_files=html_urls
60
+ end
61
+
62
+ cfg_files={
63
+ fullname: dyn_file,
64
+ basename: File.basename(dyn_file,".*"),
65
+ long_url: html_file,
66
+ url: File.basename(html_file,".*"),
67
+ tag: opts[:doc_tag],
68
+ urls: html_files
69
+ }
70
+
54
71
  dyn_file=File.join(opts[:dyn_root],dyn_file) unless dyn_file[0]=="/"
55
72
 
73
+
56
74
  if i=(dyn_file =~ /\_?(?:html)?\.dyn$/)
57
75
 
58
76
  cfg={}
@@ -62,6 +80,9 @@ module Dyndoc
62
80
  cfg_yml_file=cfg_yml_files.select{|c| File.exists? c}[0]
63
81
  cfg=YAML::load_file(cfg_yml_file) if cfg_yml_file
64
82
 
83
+ ## add info related to dyn file
84
+ cfg.merge!(cfg_files)
85
+
65
86
  ## Dyn layout
66
87
  dyn_layout=dyn_file[0...i]+"_layout.dyn" if File.exist? dyn_file[0...i]+"_layout.dyn"
67
88
 
@@ -80,7 +101,7 @@ module Dyndoc
80
101
  ## code to evaluate
81
102
  code=File.read(dyn_file)
82
103
 
83
- page=nil
104
+ page={}
84
105
 
85
106
  if code =~ /^\-{3}/
86
107
  b=code.split(/^(\-{3,})/,-1)
@@ -102,6 +123,7 @@ module Dyndoc
102
123
  else
103
124
  cfg_tmp=File.join(dyn_root,cfg["layout"][0] == "/" ? cfg["layout"][1..-1] : ["layout",cfg["layout"]])
104
125
  end
126
+ Dyndoc.warn :layout,cfg_tmp
105
127
  dyn_layout=cfg_tmp if !dyn_layout and File.exist? cfg_tmp
106
128
  end
107
129
  if cfg["pre"]
@@ -141,7 +163,7 @@ module Dyndoc
141
163
  docs_tags += (cfg["tags"]||"").split(",").map{|e| e.strip}
142
164
  dyn_tags="[#<]{#opt]"+docs_tags.join(",")+"[#opt}[#>]" unless docs_tags.empty?
143
165
 
144
- Dyndoc.warn :dyn_tags,[docs_tags,dyn_tags]
166
+ ### Dyndoc.warn :dyn_tags,[docs_tags,dyn_tags]
145
167
 
146
168
  if dyn_libs or dyn_pre_code
147
169
  code_pre = ""
@@ -151,8 +173,9 @@ module Dyndoc
151
173
  end
152
174
  code += "\n" + dyn_post_code if dyn_post_code
153
175
  ## TO TEST!!!
154
- code = "[#rb<]require 'ostruct';cfg = OpenStruct.new(" + cfg.inspect + ")[#>]" +code
155
- code = "[#rb<]page = " + page.inspect + "[#>]" +code if page
176
+ Dyndoc.warn :cfg,cfg
177
+ Dyndoc.warn :page,page
178
+ code = "[#rb<]require 'ostruct';cfg = OpenStruct.new(" + cfg.inspect + ");page = OpenStruct.new(" + page.inspect + ")[#>]" +code
156
179
  code = dyn_tags + code if dyn_tags
157
180
 
158
181
  ## add path for user
@@ -162,8 +185,7 @@ module Dyndoc
162
185
  code_path << "[#main][#<]\n"
163
186
  code = code_path + code
164
187
 
165
- ###
166
- Dyndoc.warn :code,code
188
+ ### Dyndoc.warn :code,code
167
189
 
168
190
  dyndoc_start=[:dyndoc_libs,:dyndoc_layout]
169
191
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dyndoc-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS