dyndoc-ruby 0.8.4 → 0.8.5

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 +15 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b31af8e1e3758668e3a2a5cd0613b33570acc7fd
4
- data.tar.gz: 52ca02ac196eeb546d425eb63cd414611e9157d1
3
+ metadata.gz: 81c02d76c3d7a0628adc49871638d2e419622b99
4
+ data.tar.gz: 1c1051d0f2b54122c406a1daeaffc8f8a6146827
5
5
  SHA512:
6
- metadata.gz: af35cf8473a006d5655e0eb738c51faf6cff2eccc4f94857689939af4d9e2732a3d6e3dc8bcfd5a3b51cced440372e040cd5d6039a9099c4b6e160aa77d35043
7
- data.tar.gz: 6fed11d065bf5df59474d4a62dc8b98a8c319eaa68584759d91f57bdd7d03cf1c4d5cdebac44f60167d650196d0c717baf8ca7cc641269697e8a4c97085f6f82
6
+ metadata.gz: 4743f46660df426d553d58fa46b62dceef26958212a95102846bf3b7ffd4c2f9cac571b0400d1dd334dcfb7317bd892fee1c987dbbe849fe4a350d0fd0dd6c1b
7
+ data.tar.gz: 40bdd38f506c189d7c3aad236b9476cc1165fef0c2edfa45f01fb878def08afd3ae987b0bd587b58aec84bed2fa9dc556f892a8d57850c2bc88c3ac654dfd90a
@@ -23,7 +23,7 @@ module Dyndoc
23
23
  end
24
24
  end
25
25
 
26
- ## does notwork when called twice!!!! (ex: jekyll-dyndoc in mode dyndoc)
26
+ ## does not work when called twice!!!! (ex: jekyll-dyndoc in mode dyndoc)
27
27
  def Dyndoc.convert(input,config={})
28
28
  unless @@dyndoc_tmpl_mngr
29
29
  Dyndoc.cfg_dyn['dyndoc_session']=:interactive
@@ -61,7 +61,7 @@ module Dyndoc
61
61
 
62
62
  return unless opts[:dyn_root]
63
63
 
64
- dyn_libs,dyn_tags=nil,nil
64
+ dyn_libs,dyn_tags,dyn_layout,dyn_pre_code,dyn_post_code=nil,nil,nil,nil,nil
65
65
 
66
66
  ## requirement: dyn_file is provided relatively to the opts[:dyn_root] (for security reason too)
67
67
 
@@ -90,8 +90,15 @@ module Dyndoc
90
90
  if i=(dyn_file =~ /\_?(?:html)?\.dyn$/)
91
91
 
92
92
  cfg={}
93
+
93
94
  ## find the previous config.yml in the tree folder
94
95
  ## TODO: read all previous config.yml and merge them from root to current
96
+ ## The merge could be also to join the content when the key is the same.
97
+ ## Ex: semantic-ui (1st config.yml): css_message
98
+ ## semantic-ui (2nd config.yml): css_icon
99
+ ## becomes: semantic-ui: css_message, css_icon
100
+ ## NEEDS TO DECLARE the fields that behave like this in some other config file (keys.yml)
101
+
95
102
  cfg_yml_files=dyn_path.inject([""]) {|res,e| res + [(res[-1,1]+[e]).flatten]}.map{|pa| File.join(opts[:dyn_root],pa,"config.yml")}.reverse
96
103
  cfg_yml_file=cfg_yml_files.select{|c| File.exists? c}[0]
97
104
  cfg=YAML::load_file(cfg_yml_file) if cfg_yml_file
@@ -141,7 +148,8 @@ module Dyndoc
141
148
  else
142
149
  cfg_tmp=File.join(dyn_root,cfg["layout"][0] == "/" ? cfg["layout"][1..-1] : ["layout",cfg["layout"]])
143
150
  end
144
- Dyndoc.warn :layout,cfg_tmp
151
+ cfg_tmp+= ".dyn" if File.extname(cfg_tmp).empty?
152
+ ##Dyndoc.warn :layout,cfg_tmp
145
153
  dyn_layout=cfg_tmp if !dyn_layout and File.exist? cfg_tmp
146
154
  end
147
155
  if cfg["pre"]
@@ -151,7 +159,8 @@ module Dyndoc
151
159
  #cfg_tmp=File.join(dyn_root,cfg["pre"])
152
160
  cfg_tmp=File.join(dyn_root,cfg["pre"][0] == "/" ? cfg["pre"][1..-1] : ["preload",cfg["pre"]])
153
161
  end
154
- dyn_pre_code=File.read(cfg_tmp) unless dyn_pre_code and File.exist? cfg_tmp
162
+ cfg_tmp+= ".dyn" if File.extname(cfg_tmp).empty?
163
+ dyn_pre_code=File.read(cfg_tmp) if !dyn_pre_code and File.exist? cfg_tmp
155
164
  end
156
165
 
157
166
  if cfg["post"]
@@ -161,7 +170,8 @@ module Dyndoc
161
170
  #cfg_tmp=File.join(dyn_root,cfg["post"])
162
171
  cfg_tmp=File.join(dyn_root,cfg["post"][0] == "/" ? cfg["post"][1..-1] : ["postload",cfg["post"]])
163
172
  end
164
- dyn_post_code=File.read(cfg_tmp) unless dyn_post_code and File.exist? cfg_tmp
173
+ cfg_tmp+= ".dyn" if File.extname(cfg_tmp).empty?
174
+ dyn_post_code=File.read(cfg_tmp) if !dyn_post_code and File.exist? cfg_tmp
165
175
  end
166
176
 
167
177
  ## deal with html_file
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.4
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - CQLS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-02 00:00:00.000000000 Z
11
+ date: 2016-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb