aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/manifest.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/manifest.rb')
-rw-r--r--lib/sisu/v0/manifest.rb26
1 files changed, 18 insertions, 8 deletions
diff --git a/lib/sisu/v0/manifest.rb b/lib/sisu/v0/manifest.rb
index e0617fec..891d6f41 100644
--- a/lib/sisu/v0/manifest.rb
+++ b/lib/sisu/v0/manifest.rb
@@ -91,11 +91,8 @@ module SiSU_Manifest
@md,@fns=md
@env=SiSU_Env::Info_env.new(@md.fns)
@fnb=@md.fnb
- out=@env.path.output
- @base_url="#{@env.url.root}/#@fnb"
- @base_url_src="#{@env.url.root}/src"
- @base_path="#{out}/#@fnb"
- @base_path_src="#{out}/src"
+ @base_url,@base_url_src,@base_url_pod="#{@env.url.root}/#@fnb","#{@env.url.src_txt}","#{@env.url.src_pod}"
+ @base_path,@base_path_src,@base_path_pod="#{@env.path.output}/#@fnb","#{@env.path.output_src}","#{@env.path.output_pod}"
@@dg ||=SiSU_Env::Info_env.new.digest.type
@dg=@@dg
l=SiSU_Env::Standardise_language.new.file_to_language(@md.fns)
@@ -129,6 +126,19 @@ module SiSU_Manifest
@manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="../src/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="../src/#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}<br />#{@url_brace.xml_open}<a href="#@base_url_src/#{file}">#@base_url_src/#{file}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">#{kb}</p>
</td></tr>\n} if kb and kb =~/\d+/
end
+ def summarize_pod(id,file)
+ sys=SiSU_Env::System_call.new
+ dgst =if @dg =~/^sha(?:2|256)$/; sys.sha256("#{@base_path_pod}/#{file}")
+ else sys.md5("#{@base_path_pod}/#{file}")
+ end
+ tell=SiSU_Screen::Ansi.new(@md.cmd,"#{dgst[1]} #{file}")
+ tell.warn if @md.cmd =~/[vVM]/
+ size=(File.size("#{@base_path_pod}/#{file}")/1024.00).to_s
+ kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1]
+ @manifest[:txt] << "#{file} #{id} #{kb}\n"
+ @manifest[:html] << %{<tr><th class="left"><p class="norm"><a href="../pod/#{file}">#{id}</a></p></th><td class="right"><p class="tiny"><a href="../pod/#{file}">#{file}</a> &nbsp;&nbsp;#{dgst[1]}<br />#{@url_brace.xml_open}<a href="#@base_url_pod/#{file}">#@base_url_pod/#{file}</a>#{@url_brace.xml_close}</p></td><td class="right"><p class="right">#{kb}</p>
+ </td></tr>\n} if kb and kb =~/\d+/
+ end
def languages(id,file)
flv=@env.published_manifests?(@base_path)
@manifest[:html] << %{<tr><th class="left"><div id="horizontal_links"><ul id="horizontal">\n}
@@ -246,14 +256,14 @@ module SiSU_Manifest
summarize_source(id,file)
end
end
- if FileTest.file?("#@base_path_src/#{@md.fn[:sisupod]}")==true
+ if FileTest.file?("#@base_path_pod/#{@md.fn[:sisupod]}")==true
id,file='SiSU doc (zip)',@md.fn[:sisupod]
- summarize_source(id,file)
+ summarize_pod(id,file)
end
if FileTest.file?("#@base_path/#{@md.fnb}")==true \
and @md.fnb =~/\.kdi$/
id,file='Kdissert (.kdi source)',@md.fnb
- summarize_source(id,file)
+ summarize_pod(id,file)
end
end
def metadata_tests