Class: SiSU_QRcode::Source::OutputInfo
- Inherits:
-
SiSU_QRcode::Source
- Object
- SiSU_QRcode::Source
- SiSU_QRcode::Source::OutputInfo
- Includes:
- SiSU_Parts_Generic
- Defined in:
- lib/sisu/qrcode.rb
Instance Method Summary collapse
- #check_output(data) ⇒ Object
-
#initialize(md) ⇒ OutputInfo
constructor
A new instance of OutputInfo.
- #language_versions ⇒ Object
- #languages(id, file) ⇒ Object
- #links(url, lnk, target) ⇒ Object
- #md_title_info(id, info) ⇒ Object
- #metadata(id, info) ⇒ Object
- #metadata_tests ⇒ Object
- #output_metadata ⇒ Object
- #output_metadata_short ⇒ Object
- #output_tests ⇒ Object
- #published_languages(id, file) ⇒ Object
- #published_manifests? ⇒ Boolean
- #published_versions ⇒ Object
- #source_tests ⇒ Object
- #spaces ⇒ Object
- #summarize(id, file, pth = '', rel = '', url = '', img = '● ') ⇒ Object
- #summarize_html_seg(id, file, pth = '', rel = '', url = '', img = '● ') ⇒ Object
- #summarize_sources(id, file, pth, rel, url) ⇒ Object
Methods included from SiSU_Parts_Generic
#footer_signature, #home, #home_txt, #i_choice, #i_home_button, #i_ico, #i_new, #rl_root, #root_http, #sisu, #sisu_txt, #sisudoc, #site, #the_icon, #the_text, #the_url, #txt_home, #txt_hp, #txt_hp_alias, #txt_signature, #urify, #url_close, #url_open
Methods inherited from SiSU_QRcode::Source
Constructor Details
#initialize(md) ⇒ OutputInfo
Returns a new instance of OutputInfo.
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/sisu/qrcode.rb', line 117 def initialize(md) @manifest={ txt: [], txt_title: [] } @md,@fns=md,md.fns @env=SiSU_Env::InfoEnv.new(@md.fns,@md.opt) @fnb=@md.fnb @base_url="#{@env.url.root}/#{@fnb}" @f=SiSU_Env::FileOp.new(@md) @base_path=@f.output_path.manifest.dir @@dg ||=SiSU_Env::InfoEnv.new.digest(@md.opt).type @dg=@@dg l=SiSU_Env::StandardiseLanguage.new(@md.opt.lng).language @language=l[:n] @translate=SiSU_Translate::Source.new(@md,@language) @f.make_path(@f.output_path.qrcode.dir) end |
Instance Method Details
#check_output(data) ⇒ Object
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 |
# File 'lib/sisu/qrcode.rb', line 718 def check_output(data) begin @f=SiSU_Env::FileOp.new(@md) #.base_filename url=@f.output_path.base.url @en_manifest=if @env.output_dir_structure.by_language_code? "#{url}/en/manifest/#{@md.fnb}.html" elsif @env.output_dir_structure.by_filetype? "#{url}/manifest/#{@md.fnb}.#{@md.opt.lng}.html" else "#{url}/sisu_manifest.#{@md.opt.lng}.html" end @manifest[:txt] <<<<WOK #{@translate.} #{the_text.url_open}#{@en_manifest}#{the_text.url_close} WOK @manifest[:txt_title] <<<<WOK #{the_text.url_open}#{@en_manifest}#{the_text.url_close} WOK source_tests @manifest[:txt] <<<<WOK #{@translate.language_version_list} WOK language_versions rescue SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure end end |
#language_versions ⇒ Object
451 452 453 454 455 456 |
# File 'lib/sisu/qrcode.rb', line 451 def language_versions if FileTest.file?(@f.place_file.manifest.dir)==true id,file='Markup (SiSU source)',@md.fns published_languages(id,file) end end |
#languages(id, file) ⇒ Object
237 238 239 240 241 242 243 |
# File 'lib/sisu/qrcode.rb', line 237 def languages(id,file) flv=published_manifests? flv.each do |l| SiSU_Translate::Source.new(@md,@language,l[:n]).language_list @manifest[:txt] << "#{l[:mu]} #{l[:l]}\n" end end |
#links(url, lnk, target) ⇒ Object
258 259 260 261 262 263 264 |
# File 'lib/sisu/qrcode.rb', line 258 def links(url,lnk,target) static=if url =~/^\.\// then url.gsub(/^\.(\.)?/,@base_url) elsif url =~/^\.\.\// then url.gsub(/^\.(\.)?/,@env.url.root) else url end @manifest[:txt] << %{#{url} #{lnk} #{the_text.url_open}#{static}#{the_text.url_close}\n} end |
#md_title_info(id, info) ⇒ Object
254 255 256 257 |
# File 'lib/sisu/qrcode.rb', line 254 def md_title_info(id,info) info=info.to_s.gsub(/#{Mx[:br_line]}/,"\n") @manifest[:txt_title] << %{#{info}\n} end |
#metadata(id, info) ⇒ Object
250 251 252 253 |
# File 'lib/sisu/qrcode.rb', line 250 def (id,info) info=info.to_s.gsub(/#{Mx[:br_line]}/,"\n") @manifest[:txt] << %{#{id}: #{info}\n} end |
#metadata_tests ⇒ Object
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
# File 'lib/sisu/qrcode.rb', line 490 def if defined? @md.title.full \ and @md.title.full=~/\S+/ id,info=@translate.full_title,@md.title.full #id,[email protected]_title,%{"#{@md.title.full}"} (id,info) md_title_info(id,info) end if defined? @md.creator. \ and @md.creator.=~/\S+/ id,info=@translate.,@md.creator. (id,info) md_title_info(id,info) end if defined? @md.creator.editor \ and @md.creator.editor=~/\S+/ id,info=@translate.editor,@md.creator.editor (id,info) end if defined? @md.creator.contributor \ and @md.creator.contributor=~/\S+/ id,info=@translate.contributor,@md.creator.contributor (id,info) end if defined? @md.creator.translator \ and @md.creator.translator=~/\S+/ id,info=@translate.translator,%{(#{@md.creator.translator})} (id,info) md_title_info(id,info) end if defined? @md.creator.illustrator \ and @md.creator.illustrator=~/\S+/ id,info=@translate.illustrator,@md.creator.illustrator (id,info) end if defined? @md.publisher \ and @md.publisher=~/\S+/ #dc id,info=@translate.publisher,@md.publisher (id,info) end if defined? @md.creator.prepared_by \ and @md.creator.prepared_by=~/\S+/ id,info=@translate.prepared_by,@md.creator.prepared_by (id,info) end if defined? @md.creator.digitized_by \ and @md.creator.digitized_by=~/\S+/ id,info=@translate.digitized_by,@md.creator.digitized_by (id,info) end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ #dc id,info=@translate.rights,@md.rights.all (id,info) end if defined? @md.date.published if defined? @md.date.published \ and @md.date.published=~/\S+/ #dc id,info=@translate.date,@md.date.published (id,info) md_title_info(id,info) end if defined? @md.date.created \ and @md.date.created=~/\S+/ #dc id,info=@translate.date_created,@md.date.created (id,info) end if defined? @md.date.issued \ and @md.date.issued=~/\S+/ #dc id,info=@translate.date_issued,@md.date.issued (id,info) end if defined? @md.date.available \ and @md.date.available=~/\S+/ #dc id,info=@translate.date_available,@md.date.available (id,info) end if defined? @md.date.modified \ and @md.date.modified=~/\S+/ #dc id,info=@translate.date_modified,@md.date.modified (id,info) end if defined? @md.date.valid \ and @md.date.valid=~/\S+/ #dc id,info=@translate.date_valid,@md.date.valid (id,info) end end if defined? @md.title.language \ and @md.title.language=~/\S+/ id,info=@translate.language,@md.title.language (id,info) end if defined? @md.original.language \ and @md.original.language=~/\S+/ id,info=@translate.language_original,@md.original.language (id,info) end if defined? @md.classify.subject \ and @md.classify.subject=~/\S+/ id,info=@translate.subject,@md.classify.subject (id,info) end if defined? @md.classify.keywords \ and @md.classify.keywords=~/\S+/ id,info=@translate.keywords,@md.classify.keywords (id,info) end if defined? @md.classify.loc \ and @md.classify.loc=~/\S+/ id,info=@translate.cls_loc,@md.classify.loc (id,info) end if defined? @md.classify.dewey \ and @md.classify.dewey=~/\S+/ id,info=@translate.cls_dewey,@md.classify.dewey (id,info) end if defined? @md.notes.description \ and @md.notes.description=~/\S+/ id,info=@translate.description,@md.notes.description (id,info) end if defined? @md.notes.abstract \ and @md.notes.abstract=~/\S+/ id,info=@translate.abstract,@md.notes.abstract (id,info) end if defined? @md.notes.comment \ and @md.notes.comment=~/\S+/ id,info=@translate.comments,@md.notes.comment (id,info) end if defined? @md.notes.coverage \ and @md.notes.coverage=~/\S+/ id,info=@translate.coverage,@md.notes.coverage (id,info) end if defined? @md.notes.relation \ and @md.notes.relation=~/\S+/ id,info=@translate.relation,@md.notes.relation (id,info) end #if defined? @md.notes.source \ #and @md.notes.source=~/\S+/ # id,[email protected],@md.notes.source # metadata(id,info) #end #if defined? @md.notes.history \ #and @md.notes.history=~/\S+/ # id,[email protected],@md.notes.history # metadata(id,info) #end if defined? @md.notes.type \ and @md.notes.type=~/\S+/ #dc id,info=@translate.type,@md.type (id,info) end if defined? @md.notes.format \ and @md.notes.format=~/\S+/ id,info=@transate.format,@md.notes.format (id,info) end if defined? @md.notes.prefix_a \ and @md.notes.prefix_a=~/\S+/ id,info=@translate.prefix_a,@md.notes.prefix_a (id,info) end if defined? @md.notes.prefix_b \ and @md.notes.prefix_b=~/\S+/ id,info=@translate.prefix_b,@md.notes.prefix_b (id,info) end if defined? @md.original.source \ and @md.original.source=~/\S+/ id,info=@translate.source,@md.original.source (id,info) end if defined? @md.identifier.oclc \ and @md.identifier.oclc=~/\S+/ id,info=@translate.cls_oclc,@md.identifier.oclc @manifest[:txt] << %{#{id}:\n} @manifest[:txt] << %{#{info}\n} end if defined? @md.identifier.isbn \ and @md.identifier.isbn=~/\S+/ id,info=@translate.cls_isbn,@md.identifier.isbn (id,info) end if defined? @md.topic_register_array \ and @md.topic_register_array.length > 0 @manifest[:txt] << %{#{@translate.topic_register}:\n} @md.topic_register_array.each do |t| t.each_with_index do |st,i| if st.is_a?(Array) st.each do |v| @manifest[:txt] << %{#{spaces*i}#{v}\n} end else @manifest[:txt] << %{#{spaces*i}#{st}\n} end end end end if @md.fns id,info=@translate.sourcefile,@md.fns (id,info) end if @md.en[:mismatch] > 0 id,info='WARNING document error in endnote markup, number mismatch',"endnotes: #{@md.en[:note]} != endnote reference marks: #{@md.en[:mark]} (difference = #{@md.en[:mismatch]})" (id,info) end if @md.wc_words id,info=@translate.word_count,@md.wc_words (id,info) end if @md.dgst id,info="#{@translate.sourcefile_digest} (#{@dg})",@md.dgst[1] (id,info) end if @md.sc_number id,info=@translate.sc_number,@md.sc_number (id,info) end if @md.sc_date id,info=@translate.sc_date,"#{@md.sc_date} at #{@md.sc_time}" (id,info) end end |
#output_metadata ⇒ Object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'lib/sisu/qrcode.rb', line 135 def fn=@f.base_filename.manifest_txt mn='' if @md.opt.act[:maintenance][:set]==:on fn=@f.base_filename.manifest_txt manifest=@f.write_file.manifest_txt end @manifest[:txt].each do |x| x=x.gsub(/\\\\/m,"\n") puts x if @md.opt.act[:verbose_plus][:set]==:on manifest << x if @md.opt.act[:maintenance][:set]==:on mn += x end manifest.close if @md.opt.act[:maintenance][:set]==:on cmd=SiSU_Env::SystemCall.new(mn,@f.place_file.qrcode_md.dir,@md.opt.selections.str) cmd.qrencode end |
#output_metadata_short ⇒ Object
152 153 154 155 156 157 158 159 |
# File 'lib/sisu/qrcode.rb', line 152 def mn='' @manifest[:txt_title].each do |x| mn += x end cmd=SiSU_Env::SystemCall.new(mn,@f.place_file.qrcode_title.dir,@md.opt.selections.str) cmd.qrencode end |
#output_tests ⇒ Object
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 |
# File 'lib/sisu/qrcode.rb', line 265 def output_tests if FileTest.file?(@f.place_file.html_segtoc.dir)==true pth=@f.output_path.html_seg.dir rel=@f.output_path.html_seg.rel_sm url=@f.output_path.html_seg.url id,file='HTML, table of contents (for segmented text)',@f.base_filename.html_segtoc summarize_html_seg(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.html_scroll.dir)==true pth=@f.output_path.html_scroll.dir rel=@f.output_path.html_scroll.rel_sm url=@f.output_path.html_scroll.url id,file='HTML, full length document',@f.base_filename.html_scroll summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.html_book_index.dir)==true pth=@f.output_path.html_seg.dir rel=@f.output_path.html_seg.rel_sm url=@f.output_path.html_seg.url id,file='HTML, (book type) index',@f.base_filename.html_book_index summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.html_concordance.dir)==true pth=@f.output_path.html_seg.dir rel=@f.output_path.html_seg.rel_sm url=@f.output_path.html_seg.url id,file='HTML, concordance file',@f.base_filename.html_concordance summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.epub.dir)==true id,file='EPUB (Electronic Publication, e-book standard)',@f.base_filename.epub pth=@f.output_path.epub.dir rel=@f.output_path.epub.rel_sm url=@f.output_path.epub.url summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_letter}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, U.S. letter size, portrait/vertical","#{@f.base_filename.pdf_p_letter}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_letter}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, U.S. letter size, landscape/horizontal","#{@f.base_filename.pdf_l_letter}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_a4}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, A4 size, portrait/vertical","#{@f.base_filename.pdf_p_a4}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_a4}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, A4 size, landscape/horizontal","#{@f.base_filename.pdf_l_a4}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_a5}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, A5 (book) size, portrait/vertical","#{@f.base_filename.pdf_p_a5}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_a5}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, A5 (book) size, landscape/horizontal","#{@f.base_filename.pdf_l_a5}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_b5}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, B5 (book) size, portrait/vertical","#{@f.base_filename.pdf_p_b5}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_b5}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, B5 (book) size, landscape/horizontal","#{@f.base_filename.pdf_l_b5}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_p_legal}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, U.S. legal size, portrait/vertical","#{@f.base_filename.pdf_p_legal}" summarize(id,file,pth,rel,url) end if FileTest.file?("#{@f.output_path.pdf.dir}/#{@f.base_filename.pdf_l_legal}")==true pth=@f.output_path.pdf.dir rel=@f.output_path.pdf.rel_sm url=@f.output_path.pdf.url id,file="PDF, U.S. legal size, landscape/horizontal","#{@f.base_filename.pdf_l_legal}" summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.odt.dir)==true pth=@f.output_path.odt.dir rel=@f.output_path.odt.rel_sm url=@f.output_path.odf.url id,file='ODF:ODT (Open Document Format)',@f.base_filename.odt summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.xhtml.dir)==true pth=@f.output_path.xhtml.dir rel=@f.output_path.xhtml.rel_sm url=@f.output_path.xhtml.url id,file='ODF:ODT (Open Document Format)',@f.base_filename.odt id,file='XHTML',@f.base_filename.xhtml summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.xml_sax.dir)==true pth=@f.output_path.xml_sax.dir rel=@f.output_path.xml_sax.rel_sm url=@f.output_path.xml_sax.url id,file='XML SAX',@f.base_filename.xml_sax summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.xml_dom.dir)==true pth=@f.output_path.xml_dom.dir rel=@f.output_path.xml_dom.rel_sm url=@f.output_path.xml_dom.url id,file='XML DOM',@f.base_filename.xml_dom summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.txt.dir)==true id='Plaintext (UTF-8)' #id=if @md.opt.selections.str =~/a/ then 'Plaintext (Unix (UTF-8) with footnotes)' #elsif @md.opt.selections.str =~/e/ then 'Plaintext (Unix (UTF-8) with endnotes)' #elsif @md.opt.selections.str =~/A/ then 'Plaintext (dos (UTF-8) with footnotes)' #elsif @md.opt.selections.str =~/E/ then 'Plaintext (dos (UTF-8) with endnotes)' #else 'Plaintext (UTF-8)' #end pth=@f.output_path.txt.dir rel=@f.output_path.txt.rel_sm url=@f.output_path.txt.url file=@f.base_filename.txt summarize(id,file,pth,rel,url) end if FileTest.file?("#{@base_path}/#{@md.fns}.tex")==true id,file='LaTeX (portrait)',"#{@md.fns}.tex" pth,rel,url='','','' summarize(id,file,pth,rel,url) end if FileTest.file?("#{@base_path}/#{@md.fns}.tex")==true id,file='LaTeX (landscape)',"#{@md.fns}.landscape.tex" pth,rel,url='','','' summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.manpage.dir)==true pth=@f.output_path.manpage.dir rel=@f.output_path.manpage.rel_sm url=@f.output_path.manpage.url id,file='Manpage',@f.base_filename.manpage summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.texinfo.dir)==true pth=@f.output_path.texinfo.dir rel=@f.output_path.texinfo.rel_sm url=@f.output_path.texinfo.url id,file='Texinfo',@f.base_filename.texinfo summarize(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.hash_digest.dir)==true pth=@f.output_path.hash_digest.dir rel=@f.output_path.hash_digest.rel_sm url=@f.output_path.hash_digest.url id,file="Digest/DCC - Document Content Certificate (#{@dg})",@f.base_filename.hash_digest summarize(id,file,pth,rel,url) end end |
#published_languages(id, file) ⇒ Object
244 245 246 247 248 249 |
# File 'lib/sisu/qrcode.rb', line 244 def published_languages(id,file) flv=published_manifests? flv.each do |l| @manifest[:txt] << "#{l[:l]} #{the_text.url_open}#{l[:mu]}#{the_text.url_close}\n" end end |
#published_manifests? ⇒ Boolean
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/sisu/qrcode.rb', line 202 def published_manifests? @f=SiSU_Env::FileOp.new(@md) #.base_filename @m=[] url=@f.output_path.base.url manifests={} mp,mn,mt=nil,nil,nil ln=SiSU_i18n::Languages.new.language.list Px[:lng_lst].each do |lc| if @env.output_dir_structure.by_language_code? mp="#{@f.output_path.base.dir}/#{lc}/manifest" mn="#{@md.fnb}.html" mt="#{mp}/#{mn}" mu="#{url}/#{lc}/manifest/#{mn}" elsif @env.output_dir_structure.by_filetype? mp="#{@f.output_path.base.dir}/manifest" mn="#{@md.fnb}.#{lc}.html" mt="#{mp}/#{mn}" mu="#{url}/manifest/#{mn}" else mp="#{@f.output_path.base.dir}/#{@md.fnb}" mn="sisu_manifest.#{lc}.html" mt="#{mp}/#{mn}" mu="#{url}/#{mn}" end if FileTest.directory?(mp) \ && FileTest.file?(mt) lng=ln[lc][:t] manifests[lc]={ ln: lng, fn: mn } @m << { mu: mu, l: lng } end end #manifests @m=@m.uniq @m end |
#published_versions ⇒ Object
446 447 448 449 450 |
# File 'lib/sisu/qrcode.rb', line 446 def published_versions id,file='Markup (SiSU source)',@md.fns #languages(id,file) published_languages(id,file) end |
#source_tests ⇒ Object
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
# File 'lib/sisu/qrcode.rb', line 457 def source_tests if @md.fns =~/\.ssm\.sst$/ #% decide whether to extract and include requested/required documents if FileTest.file?(@f.place_file.src.dir)==true pth=@f.output_path.src.dir rel=@f.output_path.src.rel url=@f.output_path.src.url id,file='Markup Composite File (SiSU source)',@f.base_filename.src summarize_sources(id,file,pth,rel,url) end else if FileTest.file?(@f.place_file.src.dir)==true pth=@f.output_path.src.dir rel=@f.output_path.src.rel url=@f.output_path.src.url id,file='Markup (SiSU source)',@f.base_filename.src summarize_sources(id,file,pth,rel,url) end end if FileTest.file?(@f.place_file.sisupod.dir)==true pth=@f.output_path.sisupod.dir rel=@f.output_path.sisupod.rel url=@f.output_path.sisupod.url id,file='SiSU doc (zip)',@f.base_filename.sisupod summarize_sources(id,file,pth,rel,url) end if FileTest.file?(@f.place_file.pot.dir)==true pth=@f.output_path.pot.dir rel=@f.output_path.pot.rel_sm url=@f.output_path.pot.url id,file='SiSU pot',@f.base_filename.pot summarize_sources(id,file,pth,rel,url) end end |
#spaces ⇒ Object
132 133 134 |
# File 'lib/sisu/qrcode.rb', line 132 def spaces Ax[:spaces] end |
#summarize(id, file, pth = '', rel = '', url = '', img = '● ') ⇒ Object
160 161 162 163 164 165 166 167 |
# File 'lib/sisu/qrcode.rb', line 160 def summarize(id,file,pth='',rel='',url='',img='● ') size=(File.size("#{pth}/#{file}")/1024.00).to_s kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1] @manifest[:txt] <<<<WOK #{id} #{kb} #{the_text.url_open}#{url}/#{file}#{the_text.url_close} WOK end |
#summarize_html_seg(id, file, pth = '', rel = '', url = '', img = '● ') ⇒ Object
168 169 170 171 172 173 174 175 |
# File 'lib/sisu/qrcode.rb', line 168 def summarize_html_seg(id,file,pth='',rel='',url='',img='● ') size=(File.size("#{pth}/#{file}")/1024.00).to_s kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1] @manifest[:txt] <<<<WOK #{id} #{kb} #{the_text.url_open}#{url}/#{file}#{the_text.url_close} WOK end |
#summarize_sources(id, file, pth, rel, url) ⇒ Object
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 |
# File 'lib/sisu/qrcode.rb', line 176 def summarize_sources(id,file,pth,rel,url) sys=SiSU_Env::SystemCall.new dgst=case @dg when :sha512 (sys.sha512("#{pth}/#{file}")) #check when :md5 (sys.md5("#{pth}/#{file}")) else (sys.sha256("#{pth}/#{file}")) end dgst=dgst ? dgst : [ '', 'n/a' ] if (@md.opt.act[:verbose][:set]==:on \ || @md.opt.act[:verbose_plus][:set]==:on \ || @md.opt.act[:maintenance][:set]==:on) SiSU_Screen::Ansi.new( @md.opt.selections.str, "#{dgst[1]} #{file}" ).warn end size=(File.size("#{pth}/#{file}")/1024.00).to_s kb=/([0-9]+\.[0-9]{0,1})/m.match(size)[1] @manifest[:txt] <<<<WOK #{id} #{dgst[1]} #{kb} #{the_text.url_open}#{url}/#{file}#{the_text.url_close} WOK end |