dyndoc-ruby 1.0.3 → 1.0.4

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 +10 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d23a1d92727de7c3993d15a9e29024df5902388a
4
- data.tar.gz: f06151b02cff15234fe739c7b502f9da1c1c166d
3
+ metadata.gz: df0e60ad08bb4e822e8c4bcd189dcac3d7bf6d3b
4
+ data.tar.gz: 2e0eb8ffa6af5ce335de61051eae4136d12c658d
5
5
  SHA512:
6
- metadata.gz: b43e04840641f3c6f1b270495056fbb937dc9a59922ed7c73a9db9e35ba3934fc1f4ff47022817ff11c00757a32836ee4d1de4c3d70c4cf33123fa9b86570665
7
- data.tar.gz: 66c646c5a6887ac6d48e22c511f3fcc32889eefc9bb3bfbf4c327b9dffe685db6bb83084ed15dc20ebd3594f6bb5425558b0260be9bd5cb78f10a3502f978d0e
6
+ metadata.gz: 10a285cf2276a5db04aab293620a9e56baf7f264c1f13bed06781e3d2ead908b39e483f384c5cffdf96388cd86aa7a29de7610bf88f47cf1b45d9bbcff18f4c6
7
+ data.tar.gz: a39f49286141803572a529b0e053b467d4439ded8889a2792f49fd7438afbbc1ddedea0a2a4807fda64c727af2ef8ac170502a6c2e04a7dded469dac92098ebd
@@ -459,11 +459,20 @@ module Dyndoc
459
459
  code = "[#rb<]require 'ostruct';cfg = OpenStruct.new(" + cfg.inspect + ")[#>]" +code
460
460
  code = dyn_tags + code if dyn_tags
461
461
 
462
+ ## if a previous directory get .dyn_root file
463
+ dyn_paths=nil
464
+ dyn_paths_cfg=cfg[:dyn_dirname].split("/")[1..-1].inject([""]) {|res,e| res + [(res[-1,1]+[e]).flatten]}.map{|pa| File.join("",pa,".dyn_paths")}.reverse[0..-3].select{|f| File.exists? f}[0]
465
+ if dyn_paths_cfg
466
+ dyn_paths=File.read(dyn_paths_cfg).strip.gsub(/\.\//,File.dirname(dyn_paths_cfg)+"/")
467
+ dyn_paths=dyn_paths.split(":").map{|e| File.expand_path(e.strip)}.select{|d| Dir.exists? d}
468
+ dyn_paths=dyn_paths.empty? ? nil : dyn_paths.join("\n")
469
+ end
462
470
  ## add path for user
463
471
  code_path = "[#path]"
464
472
  code_path << "\n" << File.join(dyn_root,'dynlib')
473
+ code_path << "\n" << dyn_paths if dyn_paths
465
474
  code_path << "\n" << opts[:dynlib_root] << "\n" if opts[:dynlib_root]
466
- code_path << "\n" << cfg[:dynlib_root] << "\n" if cfg[:dynlib_root]
475
+ code_path << "\n" << cfg["dyn_root"] << "\n" if cfg["dyn_root"]
467
476
  code_path << "[#main][#<]\n"
468
477
  code = code_path + code
469
478
 
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: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - RCqls
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-12 00:00:00.000000000 Z
11
+ date: 2017-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: R4rb