dyndoc-ruby-core 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dyndoc/init/config.rb +20 -20
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ce7f1ca86ecf2cf834874844354082c144f6329
|
4
|
+
data.tar.gz: 495502ca7acd3d3211f26714b50c4fbeb3a53b77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbf7267719144310e24a22c9561d69d9d78ea71f0e8feac0f3dd20520c1afc8be82c2a4998e69c66108273b6d377d81180b6e6c5b8032d5e04b0914e9db7fae4
|
7
|
+
data.tar.gz: e7fa3a657c4f708982dfc726adeb4cda92c275b9b65499eae8dc689e270760024df9c2a7bc379215297b0a1ce2d291e2079d6667980004954185a3c205a12c2d
|
data/lib/dyndoc/init/config.rb
CHANGED
@@ -15,7 +15,7 @@ module Dyndoc
|
|
15
15
|
:tmpl_path=>{:tex=>"Tex",:odt=>"Odt",:ttm=>"Ttm",:html => "Html"},
|
16
16
|
:model_default=>"Model",
|
17
17
|
:file => "", #to complete when dyndoc applied to a file
|
18
|
-
:current_doc_path => "" #completed each time a file is parsed in parse_do
|
18
|
+
:current_doc_path => "" #completed each time a file is parsed in parse_do
|
19
19
|
}
|
20
20
|
|
21
21
|
require 'logger'
|
@@ -79,7 +79,7 @@ module Dyndoc
|
|
79
79
|
path=File.read(dyndoc_library_path).strip
|
80
80
|
path=path.split(Dyndoc::PATH_SEP).map{|pa| File.expand_path(pa)}.join(Dyndoc::PATH_SEP)
|
81
81
|
if !ENV["DYNDOC_LIBRARY_PATH"] or ENV["DYNDOC_LIBRARY_PATH"].empty?
|
82
|
-
ENV["DYNDOC_LIBRARY_PATH"]= path
|
82
|
+
ENV["DYNDOC_LIBRARY_PATH"]= path
|
83
83
|
else
|
84
84
|
ENV["DYNDOC_LIBRARY_PATH"] += Dyndoc::PATH_SEP + path
|
85
85
|
end
|
@@ -89,7 +89,7 @@ module Dyndoc
|
|
89
89
|
|
90
90
|
end
|
91
91
|
|
92
|
-
def Dyndoc.setRootDoc(rootDoc,root,before=true)
|
92
|
+
def Dyndoc.setRootDoc(rootDoc,root,before=true)
|
93
93
|
if rootDoc
|
94
94
|
if before
|
95
95
|
rootDoc2 = "#{root}:"+rootDoc
|
@@ -97,7 +97,7 @@ module Dyndoc
|
|
97
97
|
rootDoc2 = rootDoc+":#{root}"
|
98
98
|
end
|
99
99
|
else
|
100
|
-
rootDoc2=root
|
100
|
+
rootDoc2=root
|
101
101
|
end
|
102
102
|
#insure unique path and adress of rootDoc is unchanged!
|
103
103
|
rootDoc.replace(rootDoc2.split(":").uniq.join(":")) if rootDoc2
|
@@ -114,7 +114,7 @@ module Dyndoc
|
|
114
114
|
rootDoc=""
|
115
115
|
if File.directory?(path=File.join(@@cfg_dir[:etc],Dyndoc.cfg_dyn['etc_path_subdir']))
|
116
116
|
Dir[File.join(path,"*")].sort.each do |pa|
|
117
|
-
rootDoc += (rootDoc.empty? ? "" : ":") + File.read(pa).chomp
|
117
|
+
rootDoc += (rootDoc.empty? ? "" : ":") + File.read(pa).chomp
|
118
118
|
end
|
119
119
|
end
|
120
120
|
Dyndoc.cfg_dyn['root_doc']=rootDoc
|
@@ -132,30 +132,30 @@ module Dyndoc
|
|
132
132
|
@@append={}
|
133
133
|
tmp=[]
|
134
134
|
sys_append=File.join( @@cfg_dir[:etc],"alias")
|
135
|
-
tmp += File.readlines(sys_append) if File.exists? sys_append
|
135
|
+
tmp += File.readlines(sys_append) if File.exists? sys_append
|
136
136
|
home_append=File.join(@@cfg_dir[:etc],'alias')
|
137
137
|
tmp += File.readlines(home_append) if File.exists? home_append
|
138
138
|
file_append=File.join(@@cfg_dir[:file],'.dyn_alias')
|
139
139
|
tmp += File.readlines(file_append) if File.exists? file_append
|
140
|
-
tmp.map{|l|
|
140
|
+
tmp.map{|l|
|
141
141
|
if l.include? ">"
|
142
142
|
l2=l.strip
|
143
143
|
unless l2.empty?
|
144
|
-
l2=l2.split(/[=>,]/).map{|e| e.strip}
|
144
|
+
l2=l2.split(/[=>,]/).map{|e| e.strip}
|
145
145
|
@@append[l2[0]]=l2[-1]
|
146
146
|
end
|
147
147
|
end
|
148
148
|
}
|
149
149
|
end
|
150
150
|
|
151
|
-
## more useable than this !!!
|
151
|
+
## more useable than this !!!
|
152
152
|
def Dyndoc.absolute_path(filename,pathenv)
|
153
153
|
#puts "ici";p filename
|
154
154
|
return filename if File.exists? filename
|
155
155
|
paths=pathenv##.split(":")
|
156
156
|
#puts "absolute_path:filname";p filename
|
157
157
|
name=nil
|
158
|
-
paths.each{|e|
|
158
|
+
paths.each{|e|
|
159
159
|
f=File.expand_path(File.join([e,filename]))
|
160
160
|
#p f
|
161
161
|
if (File.exists? f)
|
@@ -198,10 +198,10 @@ module Dyndoc
|
|
198
198
|
|
199
199
|
def Dyndoc.ordered_pathenv(pathenv)
|
200
200
|
path_ary=[]
|
201
|
-
pathenv.split(PATH_SEP).each{|e|
|
202
|
-
if e=~/(?:\((\-?\d*)\))(.*)/
|
201
|
+
pathenv.split(PATH_SEP).each{|e|
|
202
|
+
if e=~/(?:\((\-?\d*)\))(.*)/
|
203
203
|
path_ary.insert($1.to_i-1,$2.strip)
|
204
|
-
else
|
204
|
+
else
|
205
205
|
path_ary << e.strip
|
206
206
|
end
|
207
207
|
}
|
@@ -220,20 +220,20 @@ module Dyndoc
|
|
220
220
|
pathenv += PATH_SEP + rootDoc if rootDoc and !rootDoc.empty?
|
221
221
|
pathenv += PATH_SEP + Dyndoc.cfg_dyn[:root_doc] unless Dyndoc.cfg_dyn[:root_doc].empty?
|
222
222
|
pathenv += PATH_SEP + ENV["TEXINPUTS"].split(RUBY_PLATFORM =~ /mingw/ ? ";" : ":" ).join(";") if ENV["TEXINPUTS"] and @@mode==:tex
|
223
|
-
|
223
|
+
|
224
224
|
##Dyndoc.warn "pathenv",pathenv
|
225
225
|
return Dyndoc.ordered_pathenv(pathenv)
|
226
226
|
end
|
227
|
-
|
227
|
+
|
228
228
|
# if exts is a Symbol then it is the new @@mode!
|
229
229
|
def Dyndoc.doc_filename(filename,exts=@@tmplExt[@@mode],warn=true,pathenv=".",rootDoc=nil)
|
230
230
|
rootDoc=Dyndoc.cfg_dyn[:root_doc] unless Dyndoc.cfg_dyn[:root_doc].empty?
|
231
231
|
filename=filename.strip
|
232
232
|
if exts.is_a? Symbol
|
233
|
-
@@mode=exts
|
233
|
+
@@mode=exts
|
234
234
|
exts=@@tmplExt[@@mode]
|
235
235
|
end
|
236
|
-
|
236
|
+
|
237
237
|
pathenv = Dyndoc.get_pathenv(rootDoc)
|
238
238
|
exts = exts + @@tmplExt.values.flatten #if @cfg[:output]
|
239
239
|
exts << "" #with extension
|
@@ -242,7 +242,7 @@ module Dyndoc
|
|
242
242
|
names=exts.map{|ext| Dyndoc.absolute_path(filename+ext,pathenv)}.compact
|
243
243
|
name=(names.length>0 ? names[0] : nil)
|
244
244
|
if warn
|
245
|
-
print "WARNING: #{filename} with extension #{exts.join(',')} not reachable in:\n #{pathenv.join(
|
245
|
+
print "WARNING: #{filename} with extension #{exts.join(',')} not reachable in:\n #{pathenv.join(Dyndoc::PATH_SEP)}\n" unless name
|
246
246
|
#puts "tmpl:";p name
|
247
247
|
end
|
248
248
|
return name
|
@@ -259,7 +259,7 @@ module Dyndoc
|
|
259
259
|
case File.extname(filename)
|
260
260
|
when ".odt"
|
261
261
|
odt=Dyndoc::Odt.new(filename)
|
262
|
-
aux[:doc].inputs={} unless aux[:doc].inputs
|
262
|
+
aux[:doc].inputs={} unless aux[:doc].inputs
|
263
263
|
aux[:doc].inputs[filename]= odt unless aux[:doc].inputs[filename]
|
264
264
|
odt.body_from_content
|
265
265
|
else
|
@@ -280,7 +280,7 @@ module Dyndoc
|
|
280
280
|
if File.exists? name
|
281
281
|
return name
|
282
282
|
elsif name.scan(/([^\.]*)(#{@@tmplExt.map{|e| e[1]}.flatten.uniq.map{|e| Regexp.escape(e)}.join("|")})+$/)[0]
|
283
|
-
pathenv=Dyndoc.get_pathenv(Dyndoc.cfg_dyn[:root_doc],false) #RMK: do not know if false really matters here (introduced just in case in get_pathenv!!!)
|
283
|
+
pathenv=Dyndoc.get_pathenv(Dyndoc.cfg_dyn[:root_doc],false) #RMK: do not know if false really matters here (introduced just in case in get_pathenv!!!)
|
284
284
|
#puts "pathenv";p pathenv; p Dyndoc.absolute_path(name,pathenv)
|
285
285
|
return Dyndoc.absolute_path(name,pathenv)
|
286
286
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dyndoc-ruby-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.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-02-
|
11
|
+
date: 2016-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configliere
|
@@ -30,6 +30,26 @@ dependencies:
|
|
30
30
|
- - '>='
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 0.4.18
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: ultraviolet
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ~>
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.0'
|
40
|
+
- - '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.0.0
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.0'
|
50
|
+
- - '>='
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.0.0
|
33
53
|
description: |2
|
34
54
|
Provide templating in text document.
|
35
55
|
email: rdrouilh@gmail.com
|