Class: SiSU_Hub_Actions::HubActions

Inherits:
Object
  • Object
show all
Includes:
SiSU_Composite_Doc_Utils
Defined in:
lib/sisu/hub_actions.rb

Instance Method Summary collapse

Methods included from SiSU_Composite_Doc_Utils

#composite_and_imported_filenames_array, #extract_filenames, #insert_filename?, #inserts_array

Constructor Details

#initialize(opt) ⇒ HubActions

Returns a new instance of HubActions.



61
62
63
# File 'lib/sisu/hub_actions.rb', line 61

def initialize(opt)
  @opt=opt
end

Instance Method Details

#abstract_objects?Boolean

Returns:

  • (Boolean)


188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/sisu/hub_actions.rb', line 188

def abstract_objects?
  if @opt.act[:ao][:set]==:on                    #% --ao --dal, -m
    if @opt.f_pths.length > 0
      unless @opt.act[:po4a_shelf][:set]==:on    # --po4a-shelf
        if @opt.fno =~ /\.ssm$/
          require_relative 'ao_composite'        # ao_composite.rb #pre-processing
          SiSU_Assemble::Composite.new(@opt).read
        end
        require_relative 'ao'                    # ao.rb
        SiSU_AO::Source.new(@opt).read
      end
    else
      msg='document abstraction request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#each_fileObject



187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
446
447
448
449
450
451
452
453
454
455
456
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
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
# File 'lib/sisu/hub_actions.rb', line 187

def each_file
  def abstract_objects?
    if @opt.act[:ao][:set]==:on                    #% --ao --dal, -m
      if @opt.f_pths.length > 0
        unless @opt.act[:po4a_shelf][:set]==:on    # --po4a-shelf
          if @opt.fno =~ /\.ssm$/
            require_relative 'ao_composite'        # ao_composite.rb #pre-processing
            SiSU_Assemble::Composite.new(@opt).read
          end
          require_relative 'ao'                    # ao.rb
          SiSU_AO::Source.new(@opt).read
        end
      else
        msg='document abstraction request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def qrcode?
    if @opt.act[:qrcode][:set]==:on                #% --qrcode, -Q
      if @opt.f_pths.length > 0
        require_relative 'qrcode'                  # qrcode.rb
        SiSU_QRcode::Source.new(@opt).read
      else
        msg='qrcode request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def hash_digests?
    if @opt.act[:hash_digests][:set]==:on          #% --hash-digests, -N digest tree
      if @opt.f_pths.length > 0
        require_relative 'digests'                 # digests.rb
        SiSU_DigestView::Source.new(@opt).read
      else
        msg='hash digest request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def text?
    if @opt.act[:txt][:set]==:on                   #% --txt, -t -a
      if @opt.f_pths.length > 0
        require_relative 'txt_plain'               #  txt_plain.rb
        SiSU_Txt_Plain::Source.new(@opt).read
      else
        msg='text request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:txt_textile][:set]==:on           #% --textile
      if @opt.f_pths.length > 0
        require_relative 'txt_textile'             #txt_textile.rb
        SiSU_Txt_Textile::Source.new(@opt).read
      else
        msg='textile request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:txt_asciidoc][:set]==:on          #% --asciidoc
      if @opt.f_pths.length > 0
        require_relative 'txt_asciidoc'            # txt_asciidoc.rb
        SiSU_Txt_AsciiDoc::Source.new(@opt).read
      else
        msg='asciidoc request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:txt_markdown][:set]==:on          #% --markdown
      if @opt.f_pths.length > 0
        require_relative 'txt_markdown'            # txt_markdown.rb
        SiSU_Txt_Markdown::Source.new(@opt).read
      else
        msg='markdown request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:txt_rst][:set]==:on               #% --rst, --rest
      if @opt.f_pths.length > 0
        require_relative 'txt_rst'                 # txt_rst.rb
        SiSU_Txt_rST::Source.new(@opt).read
      else
        msg='rst request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:txt_orgmode][:set]==:on          #% --orgmode
      if @opt.f_pths.length > 0
        require_relative 'txt_orgmode'            # txt_orgmode.rb
        SiSU_Txt_OrgMode::Source.new(@opt).read
      else
        msg='orgmode request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def html?
    if @opt.act[:html][:set]==:on                  #% --html, -h
      if @opt.f_pths.length > 0
        require_relative 'html'                    # html.rb
        SiSU_HTML::Source.new(@opt).read
      else
        msg='html request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    else
      if @opt.act[:html_seg][:set]==:on            #% --html-seg
        if @opt.f_pths.length > 0
          require_relative 'html'                  # html.rb
          SiSU_HTML::Source.new(@opt).read
        else
          msg='html seg request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:html_scroll][:set]==:on         #% --html-scroll
        if @opt.f_pths.length > 0
          require_relative 'html'                  # html.rb
          SiSU_HTML::Source.new(@opt).read
        else
          msg='html scroll request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    if @opt.act[:concordance][:set]==:on           #% --concordance, -w
      if @opt.f_pths.length > 0
        require_relative 'html_concordance'        # html_concordance.rb
        SiSU_Concordance::Source.new(@opt).read
      else
        msg='concordance request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def xhtml?
    if @opt.act[:xhtml][:set]==:on                 #% --xhtml, -b
      if @opt.f_pths.length > 0
        require_relative 'xhtml'                   # xhtml.rb
        SiSU_XHTML::Source.new(@opt).read
      else
        msg='xhtml request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:epub][:set]==:on                  #% --epub, -e
      if @opt.f_pths.length > 0
        require_relative 'xhtml_epub2'             # xhtml_epub2.rb
        SiSU_XHTML_EPUB2::Source.new(@opt).read
      else
        msg='epub request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def xml?
    if @opt.act[:odt][:set]==:on                   #% --odt, -o
      if @opt.f_pths.length > 0
        require_relative 'xml_odf_odt'             # xml_odf_odt.rb
        SiSU_XML_ODF_ODT::Source.new(@opt).read
      else
        msg='odt request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu
      if @opt.f_pths.length > 0
        require_relative 'xml_scaffold_structure_sisu'   #  xml_scaffold_structure_sisu.rb
        SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read
      else
        msg='xml scaffold request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse
      if @opt.f_pths.length > 0
        require_relative 'xml_scaffold_structure_collapsed'  # xml_scaffold_structure_collapsed.rb
        SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read
      else
        msg='xml scaffold request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:xml_docbook_book][:set]==:on      #% --xml-docbook
      if @opt.f_pths.length > 0
        require_relative 'xml_docbook5'            # xml_docbook5.rb
        SiSU_XML_Docbook_Book::Source.new(@opt).read
      else
        msg='docbook request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:xml_fictionbook][:set]==:on       #% --xml-fictionbook
      if @opt.f_pths.length > 0
        require_relative 'xml_fictionbook2'        # xml_fictionbook2.rb
        SiSU_XML_Fictionbook::Source.new(@opt).read
      else
        msg='fictionbook request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:xml_sax][:set]==:on               #% --xml-sax, -x
      if @opt.f_pths.length > 0
        require_relative 'xml_sax'                 # xml_sax.rb
        SiSU_XML_SAX::Source.new(@opt).read
      else
        msg='xml sax request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:xml_dom][:set]==:on               #% --xml-dom, -X
      if @opt.f_pths.length > 0
        require_relative 'xml_dom'                 # xml_dom.rb
        SiSU_XML_DOM::Source.new(@opt).read
      else
        msg='xml dom request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def pdf?
    if @opt.act[:pdf][:set]==:on \
    or @opt.act[:pdf_p][:set]==:on \
    or @opt.act[:pdf_l][:set]==:on                 #% --pdf-l --pdf, -p
      if @opt.f_pths.length > 0
        require_relative 'texpdf'                  # texpdf.rb
        SiSU_TeX::Source.new(@opt).read
      else
        msg='pdf request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def man_or_info?
    if @opt.act[:manpage][:set]==:on               #% --manpage, -i
      if @opt.f_pths.length > 0
        require_relative 'manpage'                 # manpage.rb
        SiSU_Manpage::Source.new(@opt).read
      else
        msg='manpage request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:texinfo][:set]==:on               #% --texinfo, -I
      if @opt.f_pths.length > 0
        require_relative 'texinfo'                 # texinfo.rb
        SiSU_TexInfo::Source.new(@opt).read
      else
        msg='texinfo request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def sqlite_discrete?
    if @opt.act[:sqlite_discrete][:set]==:on       #% --sqlite, -d
      if @opt.f_pths.length > 0
        require_relative 'dbi_discrete'            # dbi_discrete.rb
        SiSU_DBI_Discrete::SQL.new(@opt).build
      else
        msg='sqlite (discrete) request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def po4a_make?
    if @opt.act[:po4a_sst_ao_sst][:set]==:on               #% --po4a-ao
      if @opt.f_pths.length > 0
        require_relative 'src_po4a_sst_ao_sst'
        SiSU_SStm_AO_SStm::Source.new(@opt).read_process_src_files # src_po4a_sst_ao_sst.rb
      else
        msg='sst request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def elasticsearch?
    if @opt.act[:elasticsearch][:set]==:on         #% --elastic, -x
      if @opt.f_pths.length > 0
        require_relative 'json_elastic'            # json_elastic.rb
        SiSU_Elastic::Source.new(@opt).read
      else
        msg='easticsearch request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def manifest?
    if @opt.act[:manifest][:set]==:on              #% --manifest, -y
      if @opt.f_pths.length > 0
        begin
          require_relative 'html_manifest'           # html_manifest.rb
          ((@opt.act[:sisupod][:set]==:on \
          || @opt.act[:share_source][:set]==:on \
          || @opt.act[:po4a_sstm][:set]==:on) \
          && @opt.f_pths.length < 2 ) \
          ? nil
          : SiSU_Manifest::Source.new(@opt).read
        rescue
        end
      else
        msg='manifest request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def harvest?
    if @opt.act[:harvest][:set]==:on               #% --harvest
      if @opt.f_pths.length > 0
        require_relative 'html_harvest'            # html_harvest.rb
        SiSU_Harvest::Source.new(@opt).read
      else
        msg='harvest request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  self
end

#elasticsearch?Boolean

Returns:

  • (Boolean)


597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
# File 'lib/sisu/hub_actions.rb', line 597

def elasticsearch?
  if @opt.act[:elasticsearch][:set]==:on         #% --elastic, -x
    if @opt.f_pths.length > 0
      require_relative 'json_elastic'            # json_elastic.rb
      SiSU_Elastic::Source.new(@opt).read
    else
      msg='easticsearch request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#harvest?Boolean

Returns:

  • (Boolean)


637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
# File 'lib/sisu/hub_actions.rb', line 637

def harvest?
  if @opt.act[:harvest][:set]==:on               #% --harvest
    if @opt.f_pths.length > 0
      require_relative 'html_harvest'            # html_harvest.rb
      SiSU_Harvest::Source.new(@opt).read
    else
      msg='harvest request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#hash_digests?Boolean

Returns:

  • (Boolean)


226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# File 'lib/sisu/hub_actions.rb', line 226

def hash_digests?
  if @opt.act[:hash_digests][:set]==:on          #% --hash-digests, -N digest tree
    if @opt.f_pths.length > 0
      require_relative 'digests'                 # digests.rb
      SiSU_DigestView::Source.new(@opt).read
    else
      msg='hash digest request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#html?Boolean

Returns:

  • (Boolean)


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
# File 'lib/sisu/hub_actions.rb', line 328

def html?
  if @opt.act[:html][:set]==:on                  #% --html, -h
    if @opt.f_pths.length > 0
      require_relative 'html'                    # html.rb
      SiSU_HTML::Source.new(@opt).read
    else
      msg='html request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  else
    if @opt.act[:html_seg][:set]==:on            #% --html-seg
      if @opt.f_pths.length > 0
        require_relative 'html'                  # html.rb
        SiSU_HTML::Source.new(@opt).read
      else
        msg='html seg request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:html_scroll][:set]==:on         #% --html-scroll
      if @opt.f_pths.length > 0
        require_relative 'html'                  # html.rb
        SiSU_HTML::Source.new(@opt).read
      else
        msg='html scroll request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  if @opt.act[:concordance][:set]==:on           #% --concordance, -w
    if @opt.f_pths.length > 0
      require_relative 'html_concordance'        # html_concordance.rb
      SiSU_Concordance::Source.new(@opt).read
    else
      msg='concordance request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#init?Boolean

Returns:

  • (Boolean)


982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
# File 'lib/sisu/hub_actions.rb', line 982

def init?
  SiSU_Env::InfoProcessingFlag.new
  if @opt.act[:ao][:set]==:on \
  or @opt.act[:maintenance][:set]==:on             #% --maintenance, -M
    env=SiSU_Env::InfoEnv.new(@opt.fns)
    path={}
    path[:css]=env.path.output + '/_sisu/css'
    path[:xml]=env.path.output + '/_sisu/xml'
    path[:xsd]=path[:xml] + '/xsd'
    path[:xsd]=path[:xml] + '/rnc'
    path[:xsd]=path[:xml] + '/rng'
    re_p3=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/
    unless @opt.files.join(',') =~ re_p3 #do not mix pods with source markup files in command line
      if @opt.act[:maintenance][:set] ==:on
        $VERBOSE=false                             #debug $VERBOSE=true
      end
    end
    re_p2=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip)$/
    unless @opt.files.join(',') =~ re_p2 #do not mix pods with source markup files in command line
      if @opt.act[:maintenance][:set] ==:on
        $VERBOSE=false                             #debug $VERBOSE=true
      end
    end
  end
  if @opt.act[:ao][:set]==:on
    @retry_count= -1
    begin
      @get_s,@get_p,@get_pl=[],[],[]
      re_s=/(\S+?\.-sst)$/
      re_p3=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/
      re_pl3=/^(\/\S+?\.ss[mt]\.txz)/
      @opt.files.each do |fns|
        if fns =~re_s
          @get_s << @opt.f_pths[0][:url]
        end
        if fns =~re_p3
          @get_p << re_p3.match(fns)[1] if re_p3
        end
        if fns =~re_pl3
          @get_pl << re_pl3.match(fns)[1] if re_p3
        end
      end
      if @get_s.length > 0                         #% remote markup file .sst
        require_relative 'remote'                  # remote.rb
        SiSU_Remote::Get.new(@opt,@get_s).fns
        SiSU_Hub_Actions::Operations.new.counter
      end
      if @get_p.length > 0                         #% remote sisupod
        require_relative 'remote'                  # remote.rb
        SiSU_Remote::Get.new(@opt,@get_p).sisupod
      end
    rescue
      SiSU_Errors::Rescued.new($!,$@,@opt,@fns).location do
        __LINE__.to_s + ':' + __FILE__
      end
      @retry_count +=1
      retry unless @retry_count > 1
    ensure
    end
  end
end

#loop_filesObject



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
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
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/sisu/hub_actions.rb', line 655

def loop_files
  def share_source?
    if @opt.act[:sisupod][:set]==:on \
    or @opt.act[:share_source][:set]==:on \
    or @opt.act[:po4a_sstm][:set]==:on \
    or @opt.act[:git][:set]==:on
      begin
        if @opt.f_pths.length > 0
          require_relative 'src_shared'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Source::SiSUpodSource.new(@opt).read
          end
        else
          msg='share markup source request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
        if @opt.act[:sisupod][:set]==:on           #% --sisupod, -S
          if @opt.f_pths.length > 0
            require_relative 'src_sisupod_make'    # src_sisupod_make.rb
            begin
              SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
              loop_files_on_given_option_bundle do
                SiSU_Doc::Source.new(@opt).sisupod_tar_xz
              end
            ensure
            end
          else
            msg='sisupod (share markup source) request requires sisu markup files'
            if (@opt.act[:verbose_plus][:set]==:on \
            || @opt.act[:maintenance][:set]==:on)
              SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                mark(msg)
            else puts msg
            end
          end
        end
        if @opt.act[:git][:set]==:on               #% --git, -g
          if @opt.f_pths.length > 0
            require_relative 'git'                 # git.rb
            begin
              SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
              loop_files_on_given_option do
                SiSU_Git::Source.new(@opt).read
              end
            ensure
              SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
              loop_files_on_given_option_bundle do
                SiSU_Git::Source.new(@opt).git_commit
              end
            end
          else
            msg='git request requires sisu markup files'
            if (@opt.act[:verbose_plus][:set]==:on \
            || @opt.act[:maintenance][:set]==:on)
              SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                mark(msg)
            else puts msg
            end
          end
        end
        if (@opt.act[:sisupod][:set]==:on \
        || @opt.act[:share_source][:set]==:on \
        || @opt.act[:po4a_sstm][:set]==:on) \
        and @opt.act[:manifest][:set]==:on         #% --manifest, -y
          if @opt.f_pths.length > 0
            require_relative 'html_manifest'            # html_manifest.rb
            begin
            ensure
              SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
              loop_files_on_given_option_bundle do
                SiSU_Manifest::Source.new(@opt).read
              end
            end
          else
            msg='manifest request requires sisu markup files'
            if (@opt.act[:verbose_plus][:set]==:on \
            || @opt.act[:maintenance][:set]==:on)
              SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                mark(msg)
            else puts msg
            end
          end
        end
      ensure
        if @opt.f_pths.length > 0
          env=SiSU_Env::InfoEnv.new(@opt.fns)
          path_pod=env.processing_path.processing_sisupod(@opt).paths
          unless @opt.act[:maintenance][:set]==:on
            FileUtils::rm_rf("#{path_pod[:sisupod]}/*") \
              if FileTest.directory?(path_pod[:sisupod])
          end
        else
          #SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          #  mark('*** request requires sisu markup files')
        end
      end
    end
    if @opt.act[:share_source][:set]==:on
      if @opt.f_pths.length > 0
        require_relative 'src_sisupod_sstm'           # src_sisupod_sstm.rb
        begin
        ensure
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option_bundle do
            SiSU_Markup::Source_Sisupod.new(@opt).read
          end
        end
      else
        msg='share markup source request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:po4a_sstm][:set]==:on                    #% --po4a-sst
      if @opt.f_pths.length > 0
        require_relative 'src_po4a_sstm'
        begin
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Markup::Source_Po4a.new(@opt).read       # src_po4a_sstm.rb
          end
        ensure
        end
      else
        msg='sst request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:po4a_sst_ao_sst][:set]==:on               #% --po4a-ao
      if @opt.f_pths.length > 0
        require_relative 'src_po4a_sst_ao_sst'
        begin
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_SStm_AO_SStm::Source.new(@opt).read_setup # src_po4a_sst_ao_sst.rb
          end
        ensure
        end
      else
        msg='sst request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:po4a_shelf][:set]==:on            #% --po4a-shelf
      if @opt.f_pths.length > 0
        require_relative 'src_po4a_shelf'
        begin
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Po4a::Source.new(@opt).read       # src_po4a_shelf.rb
          end
        ensure
        end
      else
        msg='src_po4a_shelf request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:images][:set]==:on                #% --images, -j
      if @opt.f_pths.length > 0
        require_relative 'shared_images'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Images::Source.new(@opt).read       # shared_images.rb
        end
      else
        msg='place images request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def run_termsheet? #broken, revisit later
    if @opt.selections.str =~/--termsheet/         #% -T termsheet/standard form #fix later
      if @opt.f_pths.length > 0
        @opt.files.each do |fns|
          if FileTest.file?(fns)
            @opt.fns=fns
            case @opt.fns
            when /\.(termsheet.rb)$/
              SiSU_Hub_Actions::Operations.new(@opt).termsheet
            else                                   #print "not processed --> ", fns, "\n"
            end
          else SiSU_Hub_Actions::Operations.new(@opt).not_found
          end
        end
      else
        msg='process termsheet request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def sql?
    if @opt.act[:psql][:set]==:on                  #% --pg, -D
      if @opt.f_pths.length > 0
        require_relative 'dbi'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_DBI::SQL.new(@opt).connect          # dbi.rb
        end
      else
        msg='pgsql request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
    if @opt.act[:sqlite][:set]==:on                #% --sqlite, -d
      if @opt.f_pths.length > 0
        require_relative 'dbi'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_DBI::SQL.new(@opt).connect          # dbi.rb
        end
      else
        msg='sqlite request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  def manifest?
    if @opt.act[:manifest][:set]==:on              #% --manifest, -y
      if @opt.f_pths.length > 1
        require_relative 'html_manifest'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).manifest_on_files_translated do
          SiSU_Manifest::Source.new(@opt).read     # html_manifest.rb
        end
      end
    end
  end
  def sitemaps?
    if @opt.act[:sitemap][:set]==:on               #% --sitemap, -Y
      if @opt.f_pths.length > 0
        require_relative 'sitemaps'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Sitemaps::Source.new(@opt).read     # sitemaps.rb
        end
      end
    end
  end
  def remote_placement?
    if @opt.act[:harvest][:set] !=:on
      if @opt.act[:scp][:set]==:on                 #% -r copy to remote server
        if @opt.f_pths.length > 0
          require_relative 'remote'                # remote.rb
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Remote::Put.new(@opt).scp
          end
        end
      end
      if @opt.act[:rsync][:set]==:on               #% -R copy to remote server
        if @opt.f_pths.length > 0
          require_relative 'remote'                # remote.rb
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Remote::Put.new(@opt).rsync
          end
        end
      end
    else
    end
  end
  def urls?
    if @opt.act[:urls_selected][:set]==:on         #% --urls
      if @opt.f_pths.length > 0
        require_relative 'urls'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Urls::Source.new(@opt).read         #% urls.rb
        end
      else
        msg='urls request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
    end
  end
  self
end

#man_or_info?Boolean

Returns:

  • (Boolean)


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
# File 'lib/sisu/hub_actions.rb', line 535

def man_or_info?
  if @opt.act[:manpage][:set]==:on               #% --manpage, -i
    if @opt.f_pths.length > 0
      require_relative 'manpage'                 # manpage.rb
      SiSU_Manpage::Source.new(@opt).read
    else
      msg='manpage request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:texinfo][:set]==:on               #% --texinfo, -I
    if @opt.f_pths.length > 0
      require_relative 'texinfo'                 # texinfo.rb
      SiSU_TexInfo::Source.new(@opt).read
    else
      msg='texinfo request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#manifest?Boolean

Returns:

  • (Boolean)


613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
# File 'lib/sisu/hub_actions.rb', line 613

def manifest?
  if @opt.act[:manifest][:set]==:on              #% --manifest, -y
    if @opt.f_pths.length > 0
      begin
        require_relative 'html_manifest'           # html_manifest.rb
        ((@opt.act[:sisupod][:set]==:on \
        || @opt.act[:share_source][:set]==:on \
        || @opt.act[:po4a_sstm][:set]==:on) \
        && @opt.f_pths.length < 2 ) \
        ? nil
        : SiSU_Manifest::Source.new(@opt).read
      rescue
      end
    else
      msg='manifest request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#outputsObject



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
446
447
448
449
450
451
452
453
454
455
456
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
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
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
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
# File 'lib/sisu/hub_actions.rb', line 186

def outputs
  def each_file
    def abstract_objects?
      if @opt.act[:ao][:set]==:on                    #% --ao --dal, -m
        if @opt.f_pths.length > 0
          unless @opt.act[:po4a_shelf][:set]==:on    # --po4a-shelf
            if @opt.fno =~ /\.ssm$/
              require_relative 'ao_composite'        # ao_composite.rb #pre-processing
              SiSU_Assemble::Composite.new(@opt).read
            end
            require_relative 'ao'                    # ao.rb
            SiSU_AO::Source.new(@opt).read
          end
        else
          msg='document abstraction request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def qrcode?
      if @opt.act[:qrcode][:set]==:on                #% --qrcode, -Q
        if @opt.f_pths.length > 0
          require_relative 'qrcode'                  # qrcode.rb
          SiSU_QRcode::Source.new(@opt).read
        else
          msg='qrcode request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def hash_digests?
      if @opt.act[:hash_digests][:set]==:on          #% --hash-digests, -N digest tree
        if @opt.f_pths.length > 0
          require_relative 'digests'                 # digests.rb
          SiSU_DigestView::Source.new(@opt).read
        else
          msg='hash digest request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def text?
      if @opt.act[:txt][:set]==:on                   #% --txt, -t -a
        if @opt.f_pths.length > 0
          require_relative 'txt_plain'               #  txt_plain.rb
          SiSU_Txt_Plain::Source.new(@opt).read
        else
          msg='text request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:txt_textile][:set]==:on           #% --textile
        if @opt.f_pths.length > 0
          require_relative 'txt_textile'             #txt_textile.rb
          SiSU_Txt_Textile::Source.new(@opt).read
        else
          msg='textile request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:txt_asciidoc][:set]==:on          #% --asciidoc
        if @opt.f_pths.length > 0
          require_relative 'txt_asciidoc'            # txt_asciidoc.rb
          SiSU_Txt_AsciiDoc::Source.new(@opt).read
        else
          msg='asciidoc request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:txt_markdown][:set]==:on          #% --markdown
        if @opt.f_pths.length > 0
          require_relative 'txt_markdown'            # txt_markdown.rb
          SiSU_Txt_Markdown::Source.new(@opt).read
        else
          msg='markdown request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:txt_rst][:set]==:on               #% --rst, --rest
        if @opt.f_pths.length > 0
          require_relative 'txt_rst'                 # txt_rst.rb
          SiSU_Txt_rST::Source.new(@opt).read
        else
          msg='rst request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:txt_orgmode][:set]==:on          #% --orgmode
        if @opt.f_pths.length > 0
          require_relative 'txt_orgmode'            # txt_orgmode.rb
          SiSU_Txt_OrgMode::Source.new(@opt).read
        else
          msg='orgmode request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def html?
      if @opt.act[:html][:set]==:on                  #% --html, -h
        if @opt.f_pths.length > 0
          require_relative 'html'                    # html.rb
          SiSU_HTML::Source.new(@opt).read
        else
          msg='html request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      else
        if @opt.act[:html_seg][:set]==:on            #% --html-seg
          if @opt.f_pths.length > 0
            require_relative 'html'                  # html.rb
            SiSU_HTML::Source.new(@opt).read
          else
            msg='html seg request requires sisu markup files'
            if (@opt.act[:verbose_plus][:set]==:on \
            || @opt.act[:maintenance][:set]==:on)
              SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
                mark(msg)
            else puts msg
            end
          end
        end
        if @opt.act[:html_scroll][:set]==:on         #% --html-scroll
          if @opt.f_pths.length > 0
            require_relative 'html'                  # html.rb
            SiSU_HTML::Source.new(@opt).read
          else
            msg='html scroll request requires sisu markup files'
            if (@opt.act[:verbose_plus][:set]==:on \
            || @opt.act[:maintenance][:set]==:on)
              SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
                mark(msg)
            else puts msg
            end
          end
        end
      end
      if @opt.act[:concordance][:set]==:on           #% --concordance, -w
        if @opt.f_pths.length > 0
          require_relative 'html_concordance'        # html_concordance.rb
          SiSU_Concordance::Source.new(@opt).read
        else
          msg='concordance request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def xhtml?
      if @opt.act[:xhtml][:set]==:on                 #% --xhtml, -b
        if @opt.f_pths.length > 0
          require_relative 'xhtml'                   # xhtml.rb
          SiSU_XHTML::Source.new(@opt).read
        else
          msg='xhtml request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:epub][:set]==:on                  #% --epub, -e
        if @opt.f_pths.length > 0
          require_relative 'xhtml_epub2'             # xhtml_epub2.rb
          SiSU_XHTML_EPUB2::Source.new(@opt).read
        else
          msg='epub request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def xml?
      if @opt.act[:odt][:set]==:on                   #% --odt, -o
        if @opt.f_pths.length > 0
          require_relative 'xml_odf_odt'             # xml_odf_odt.rb
          SiSU_XML_ODF_ODT::Source.new(@opt).read
        else
          msg='odt request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu
        if @opt.f_pths.length > 0
          require_relative 'xml_scaffold_structure_sisu'   #  xml_scaffold_structure_sisu.rb
          SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read
        else
          msg='xml scaffold request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse
        if @opt.f_pths.length > 0
          require_relative 'xml_scaffold_structure_collapsed'  # xml_scaffold_structure_collapsed.rb
          SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read
        else
          msg='xml scaffold request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:xml_docbook_book][:set]==:on      #% --xml-docbook
        if @opt.f_pths.length > 0
          require_relative 'xml_docbook5'            # xml_docbook5.rb
          SiSU_XML_Docbook_Book::Source.new(@opt).read
        else
          msg='docbook request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:xml_fictionbook][:set]==:on       #% --xml-fictionbook
        if @opt.f_pths.length > 0
          require_relative 'xml_fictionbook2'        # xml_fictionbook2.rb
          SiSU_XML_Fictionbook::Source.new(@opt).read
        else
          msg='fictionbook request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:xml_sax][:set]==:on               #% --xml-sax, -x
        if @opt.f_pths.length > 0
          require_relative 'xml_sax'                 # xml_sax.rb
          SiSU_XML_SAX::Source.new(@opt).read
        else
          msg='xml sax request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:xml_dom][:set]==:on               #% --xml-dom, -X
        if @opt.f_pths.length > 0
          require_relative 'xml_dom'                 # xml_dom.rb
          SiSU_XML_DOM::Source.new(@opt).read
        else
          msg='xml dom request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def pdf?
      if @opt.act[:pdf][:set]==:on \
      or @opt.act[:pdf_p][:set]==:on \
      or @opt.act[:pdf_l][:set]==:on                 #% --pdf-l --pdf, -p
        if @opt.f_pths.length > 0
          require_relative 'texpdf'                  # texpdf.rb
          SiSU_TeX::Source.new(@opt).read
        else
          msg='pdf request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def man_or_info?
      if @opt.act[:manpage][:set]==:on               #% --manpage, -i
        if @opt.f_pths.length > 0
          require_relative 'manpage'                 # manpage.rb
          SiSU_Manpage::Source.new(@opt).read
        else
          msg='manpage request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:texinfo][:set]==:on               #% --texinfo, -I
        if @opt.f_pths.length > 0
          require_relative 'texinfo'                 # texinfo.rb
          SiSU_TexInfo::Source.new(@opt).read
        else
          msg='texinfo request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def sqlite_discrete?
      if @opt.act[:sqlite_discrete][:set]==:on       #% --sqlite, -d
        if @opt.f_pths.length > 0
          require_relative 'dbi_discrete'            # dbi_discrete.rb
          SiSU_DBI_Discrete::SQL.new(@opt).build
        else
          msg='sqlite (discrete) request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def po4a_make?
      if @opt.act[:po4a_sst_ao_sst][:set]==:on               #% --po4a-ao
        if @opt.f_pths.length > 0
          require_relative 'src_po4a_sst_ao_sst'
          SiSU_SStm_AO_SStm::Source.new(@opt).read_process_src_files # src_po4a_sst_ao_sst.rb
        else
          msg='sst request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def elasticsearch?
      if @opt.act[:elasticsearch][:set]==:on         #% --elastic, -x
        if @opt.f_pths.length > 0
          require_relative 'json_elastic'            # json_elastic.rb
          SiSU_Elastic::Source.new(@opt).read
        else
          msg='easticsearch request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def manifest?
      if @opt.act[:manifest][:set]==:on              #% --manifest, -y
        if @opt.f_pths.length > 0
          begin
            require_relative 'html_manifest'           # html_manifest.rb
            ((@opt.act[:sisupod][:set]==:on \
            || @opt.act[:share_source][:set]==:on \
            || @opt.act[:po4a_sstm][:set]==:on) \
            && @opt.f_pths.length < 2 ) \
            ? nil
            : SiSU_Manifest::Source.new(@opt).read
          rescue
          end
        else
          msg='manifest request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def harvest?
      if @opt.act[:harvest][:set]==:on               #% --harvest
        if @opt.f_pths.length > 0
          require_relative 'html_harvest'            # html_harvest.rb
          SiSU_Harvest::Source.new(@opt).read
        else
          msg='harvest request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    self
  end
  def loop_files
    def share_source?
      if @opt.act[:sisupod][:set]==:on \
      or @opt.act[:share_source][:set]==:on \
      or @opt.act[:po4a_sstm][:set]==:on \
      or @opt.act[:git][:set]==:on
        begin
          if @opt.f_pths.length > 0
            require_relative 'src_shared'
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_Source::SiSUpodSource.new(@opt).read
            end
          else
            msg='share markup source request requires sisu markup files'
            if (@opt.act[:verbose_plus][:set]==:on \
            || @opt.act[:maintenance][:set]==:on)
              SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                mark(msg)
            else puts msg
            end
          end
          if @opt.act[:sisupod][:set]==:on           #% --sisupod, -S
            if @opt.f_pths.length > 0
              require_relative 'src_sisupod_make'    # src_sisupod_make.rb
              begin
                SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
                loop_files_on_given_option_bundle do
                  SiSU_Doc::Source.new(@opt).sisupod_tar_xz
                end
              ensure
              end
            else
              msg='sisupod (share markup source) request requires sisu markup files'
              if (@opt.act[:verbose_plus][:set]==:on \
              || @opt.act[:maintenance][:set]==:on)
                SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                  mark(msg)
              else puts msg
              end
            end
          end
          if @opt.act[:git][:set]==:on               #% --git, -g
            if @opt.f_pths.length > 0
              require_relative 'git'                 # git.rb
              begin
                SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
                loop_files_on_given_option do
                  SiSU_Git::Source.new(@opt).read
                end
              ensure
                SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
                loop_files_on_given_option_bundle do
                  SiSU_Git::Source.new(@opt).git_commit
                end
              end
            else
              msg='git request requires sisu markup files'
              if (@opt.act[:verbose_plus][:set]==:on \
              || @opt.act[:maintenance][:set]==:on)
                SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                  mark(msg)
              else puts msg
              end
            end
          end
          if (@opt.act[:sisupod][:set]==:on \
          || @opt.act[:share_source][:set]==:on \
          || @opt.act[:po4a_sstm][:set]==:on) \
          and @opt.act[:manifest][:set]==:on         #% --manifest, -y
            if @opt.f_pths.length > 0
              require_relative 'html_manifest'            # html_manifest.rb
              begin
              ensure
                SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
                loop_files_on_given_option_bundle do
                  SiSU_Manifest::Source.new(@opt).read
                end
              end
            else
              msg='manifest request requires sisu markup files'
              if (@opt.act[:verbose_plus][:set]==:on \
              || @opt.act[:maintenance][:set]==:on)
                SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
                  mark(msg)
              else puts msg
              end
            end
          end
        ensure
          if @opt.f_pths.length > 0
            env=SiSU_Env::InfoEnv.new(@opt.fns)
            path_pod=env.processing_path.processing_sisupod(@opt).paths
            unless @opt.act[:maintenance][:set]==:on
              FileUtils::rm_rf("#{path_pod[:sisupod]}/*") \
                if FileTest.directory?(path_pod[:sisupod])
            end
          else
            #SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            #  mark('*** request requires sisu markup files')
          end
        end
      end
      if @opt.act[:share_source][:set]==:on
        if @opt.f_pths.length > 0
          require_relative 'src_sisupod_sstm'           # src_sisupod_sstm.rb
          begin
          ensure
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option_bundle do
              SiSU_Markup::Source_Sisupod.new(@opt).read
            end
          end
        else
          msg='share markup source request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:po4a_sstm][:set]==:on                    #% --po4a-sst
        if @opt.f_pths.length > 0
          require_relative 'src_po4a_sstm'
          begin
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_Markup::Source_Po4a.new(@opt).read       # src_po4a_sstm.rb
            end
          ensure
          end
        else
          msg='sst request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:po4a_sst_ao_sst][:set]==:on               #% --po4a-ao
        if @opt.f_pths.length > 0
          require_relative 'src_po4a_sst_ao_sst'
          begin
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_SStm_AO_SStm::Source.new(@opt).read_setup # src_po4a_sst_ao_sst.rb
            end
          ensure
          end
        else
          msg='sst request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:po4a_shelf][:set]==:on            #% --po4a-shelf
        if @opt.f_pths.length > 0
          require_relative 'src_po4a_shelf'
          begin
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_Po4a::Source.new(@opt).read       # src_po4a_shelf.rb
            end
          ensure
          end
        else
          msg='src_po4a_shelf request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:images][:set]==:on                #% --images, -j
        if @opt.f_pths.length > 0
          require_relative 'shared_images'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Images::Source.new(@opt).read       # shared_images.rb
          end
        else
          msg='place images request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def run_termsheet? #broken, revisit later
      if @opt.selections.str =~/--termsheet/         #% -T termsheet/standard form #fix later
        if @opt.f_pths.length > 0
          @opt.files.each do |fns|
            if FileTest.file?(fns)
              @opt.fns=fns
              case @opt.fns
              when /\.(termsheet.rb)$/
                SiSU_Hub_Actions::Operations.new(@opt).termsheet
              else                                   #print "not processed --> ", fns, "\n"
              end
            else SiSU_Hub_Actions::Operations.new(@opt).not_found
            end
          end
        else
          msg='process termsheet request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def sql?
      if @opt.act[:psql][:set]==:on                  #% --pg, -D
        if @opt.f_pths.length > 0
          require_relative 'dbi'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_DBI::SQL.new(@opt).connect          # dbi.rb
          end
        else
          msg='pgsql request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:sqlite][:set]==:on                #% --sqlite, -d
        if @opt.f_pths.length > 0
          require_relative 'dbi'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_DBI::SQL.new(@opt).connect          # dbi.rb
          end
        else
          msg='sqlite request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    def manifest?
      if @opt.act[:manifest][:set]==:on              #% --manifest, -y
        if @opt.f_pths.length > 1
          require_relative 'html_manifest'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).manifest_on_files_translated do
            SiSU_Manifest::Source.new(@opt).read     # html_manifest.rb
          end
        end
      end
    end
    def sitemaps?
      if @opt.act[:sitemap][:set]==:on               #% --sitemap, -Y
        if @opt.f_pths.length > 0
          require_relative 'sitemaps'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Sitemaps::Source.new(@opt).read     # sitemaps.rb
          end
        end
      end
    end
    def remote_placement?
      if @opt.act[:harvest][:set] !=:on
        if @opt.act[:scp][:set]==:on                 #% -r copy to remote server
          if @opt.f_pths.length > 0
            require_relative 'remote'                # remote.rb
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_Remote::Put.new(@opt).scp
            end
          end
        end
        if @opt.act[:rsync][:set]==:on               #% -R copy to remote server
          if @opt.f_pths.length > 0
            require_relative 'remote'                # remote.rb
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_Remote::Put.new(@opt).rsync
            end
          end
        end
      else
      end
    end
    def urls?
      if @opt.act[:urls_selected][:set]==:on         #% --urls
        if @opt.f_pths.length > 0
          require_relative 'urls'
          SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
          loop_files_on_given_option do
            SiSU_Urls::Source.new(@opt).read         #% urls.rb
          end
        else
          msg='urls request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
    end
    self
  end
  def init?
    SiSU_Env::InfoProcessingFlag.new
    if @opt.act[:ao][:set]==:on \
    or @opt.act[:maintenance][:set]==:on             #% --maintenance, -M
      env=SiSU_Env::InfoEnv.new(@opt.fns)
      path={}
      path[:css]=env.path.output + '/_sisu/css'
      path[:xml]=env.path.output + '/_sisu/xml'
      path[:xsd]=path[:xml] + '/xsd'
      path[:xsd]=path[:xml] + '/rnc'
      path[:xsd]=path[:xml] + '/rng'
      re_p3=/(sisupod(?:\.txz)?|\S+?\.ss[mt]\.txz|[^\/]+?\.ssp)$/
      unless @opt.files.join(',') =~ re_p3 #do not mix pods with source markup files in command line
        if @opt.act[:maintenance][:set] ==:on
          $VERBOSE=false                             #debug $VERBOSE=true
        end
      end
      re_p2=/(sisupod(?:\.zip)?|\S+?\.ss[mt]\.zip)$/
      unless @opt.files.join(',') =~ re_p2 #do not mix pods with source markup files in command line
        if @opt.act[:maintenance][:set] ==:on
          $VERBOSE=false                             #debug $VERBOSE=true
        end
      end
    end
    if @opt.act[:ao][:set]==:on
      @retry_count= -1
      begin
        @get_s,@get_p,@get_pl=[],[],[]
        re_s=/(\S+?\.-sst)$/
        re_p3=/((?:https?|file):\/\/\S+?(?:\/\S+?\.ss[mt]\.txz|sisupod(?:\.txz)?|\.ssp))/
        re_pl3=/^(\/\S+?\.ss[mt]\.txz)/
        @opt.files.each do |fns|
          if fns =~re_s
            @get_s << @opt.f_pths[0][:url]
          end
          if fns =~re_p3
            @get_p << re_p3.match(fns)[1] if re_p3
          end
          if fns =~re_pl3
            @get_pl << re_pl3.match(fns)[1] if re_p3
          end
        end
        if @get_s.length > 0                         #% remote markup file .sst
          require_relative 'remote'                  # remote.rb
          SiSU_Remote::Get.new(@opt,@get_s).fns
          SiSU_Hub_Actions::Operations.new.counter
        end
        if @get_p.length > 0                         #% remote sisupod
          require_relative 'remote'                  # remote.rb
          SiSU_Remote::Get.new(@opt,@get_p).sisupod
        end
      rescue
        SiSU_Errors::Rescued.new($!,$@,@opt,@fns).location do
          __LINE__.to_s + ':' + __FILE__
        end
        @retry_count +=1
        retry unless @retry_count > 1
      ensure
      end
    end
  end
  self
end

#pdf?Boolean

Returns:

  • (Boolean)


517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
# File 'lib/sisu/hub_actions.rb', line 517

def pdf?
  if @opt.act[:pdf][:set]==:on \
  or @opt.act[:pdf_p][:set]==:on \
  or @opt.act[:pdf_l][:set]==:on                 #% --pdf-l --pdf, -p
    if @opt.f_pths.length > 0
      require_relative 'texpdf'                  # texpdf.rb
      SiSU_TeX::Source.new(@opt).read
    else
      msg='pdf request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#po4a_make?Boolean

Returns:

  • (Boolean)


581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
# File 'lib/sisu/hub_actions.rb', line 581

def po4a_make?
  if @opt.act[:po4a_sst_ao_sst][:set]==:on               #% --po4a-ao
    if @opt.f_pths.length > 0
      require_relative 'src_po4a_sst_ao_sst'
      SiSU_SStm_AO_SStm::Source.new(@opt).read_process_src_files # src_po4a_sst_ao_sst.rb
    else
      msg='sst request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
end

#prepareObject



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/sisu/hub_actions.rb', line 113

def prepare
  def site?
    if @opt.act[:site_init][:set]==:on               #% --init-site, -C initialize/configure
      require_relative 'conf'                        #% --init-site, -C initialize/configure
      SiSU_Initialize::Source.new(@opt).read
      if @opt.act[:rsync][:set]==:on
        if @opt.selections.str =~/--init(?:ialize)?=site/ \
        and @opt.selections.str =~/RZ/
          SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync_match
        else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync
        end
      elsif @opt.act[:scp][:set]==:on
        if @opt.selections.str =~/--init(?:ialize)?=site/ \
        and @opt.selections.str =~/CCr/
          SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_all
        else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site
        end
      end
    end
  end
  def remote_site?
    if @opt.act[:site_init][:set]==:on
      if @opt.act[:site_init][:set]==:on               #% --init-site, -C initialize/configure
        #require_relative 'conf'                        #% --init-site, -C initialize/configure
        #SiSU_Initialize::Source.new(@opt).read
        #if @opt.act[:rsync][:set]==:on
        #  if @opt.selections.str =~/--init(?:ialize)?=site/ \
        #  and @opt.selection =~/RZ/
        #    SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync_match
        #  else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync
        #  end
        #elsif @opt.act[:scp][:set]==:on
        #  if @opt.selections.str =~/--init(?:ialize)?=site/ \
        #  and @opt.selection =~/CCr/
        #    SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_all
        #  else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site
        #  end
        #end
      end
    end
  end
  def sql?
    if @opt.act[:psql_createdb][:set]==:on \
    or @opt.act[:psql_create][:set]==:on \
    or @opt.act[:psql_drop][:set]==:on
      done=:ok
      if @opt.act[:psql][:set]==:on
        require_relative 'dbi'
        SiSU_DBI::SQL.new(@opt).connect
      end
    end
    if @opt.act[:sqlite_createdb][:set]==:on \
    or @opt.act[:sqlite_create][:set]==:on \
    or @opt.act[:sqlite_drop][:set]==:on
      done=:ok
      if @opt.act[:sqlite][:set]==:on
        require_relative 'dbi'
        SiSU_DBI::SQL.new(@opt).connect
      end
    end
  end
  def search_form?
    if @opt.act[:sample_search_form][:set]==:on      #% --sample-search-form, -F cgi sample search form
      SiSU_Hub_Actions::Operations.new(@opt).cgi
    end
  end
  def webrick?
    if @opt.act[:webrick][:set]==:on                 #% --webrick, -W webrick
      SiSU_Hub_Actions::Operations.new(@opt).webrick
    end
  end
  self
end

#qrcode?Boolean

Returns:

  • (Boolean)


210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/sisu/hub_actions.rb', line 210

def qrcode?
  if @opt.act[:qrcode][:set]==:on                #% --qrcode, -Q
    if @opt.f_pths.length > 0
      require_relative 'qrcode'                  # qrcode.rb
      SiSU_QRcode::Source.new(@opt).read
    else
      msg='qrcode request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#remote_placement?Boolean

Returns:

  • (Boolean)


938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
# File 'lib/sisu/hub_actions.rb', line 938

def remote_placement?
  if @opt.act[:harvest][:set] !=:on
    if @opt.act[:scp][:set]==:on                 #% -r copy to remote server
      if @opt.f_pths.length > 0
        require_relative 'remote'                # remote.rb
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Remote::Put.new(@opt).scp
        end
      end
    end
    if @opt.act[:rsync][:set]==:on               #% -R copy to remote server
      if @opt.f_pths.length > 0
        require_relative 'remote'                # remote.rb
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Remote::Put.new(@opt).rsync
        end
      end
    end
  else
  end
end

#remote_site?Boolean

Returns:

  • (Boolean)


133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/sisu/hub_actions.rb', line 133

def remote_site?
  if @opt.act[:site_init][:set]==:on
    if @opt.act[:site_init][:set]==:on               #% --init-site, -C initialize/configure
      #require_relative 'conf'                        #% --init-site, -C initialize/configure
      #SiSU_Initialize::Source.new(@opt).read
      #if @opt.act[:rsync][:set]==:on
      #  if @opt.selections.str =~/--init(?:ialize)?=site/ \
      #  and @opt.selection =~/RZ/
      #    SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync_match
      #  else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync
      #  end
      #elsif @opt.act[:scp][:set]==:on
      #  if @opt.selections.str =~/--init(?:ialize)?=site/ \
      #  and @opt.selection =~/CCr/
      #    SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_all
      #  else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site
      #  end
      #end
    end
  end
end

#reportObject



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/sisu/hub_actions.rb', line 64

def report
  def version_info?
    if @opt.act[:version_info][:set]==:on
      SiSU_Env::InfoAbout.new(@opt).sisu_version
    end
  end
  def version_number_git?
    if @opt.act[:version_info][:set]==:on \
    || @opt.act[:verbose][:set]==:on \
    || @opt.act[:verbose_plus][:set]==:on \
    || @opt.act[:maintenance][:set]==:on
      SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        ' ' + SiSU_is.git_version_info?
      ).grey
    end
  end
  def version_dir?
    if @opt.act[:version_info][:set]==:on \
    || @opt.act[:verbose][:set]==:on \
    || @opt.act[:verbose_plus][:set]==:on \
    || @opt.act[:maintenance][:set]==:on
      SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        ' ' + File.dirname(__FILE__)
      ).grey
    end
  end
  def version_info_extra?
    if @opt.act[:version_info][:set]==:on \
    || @opt.act[:verbose][:set]==:on \
    || @opt.act[:verbose_plus][:set]==:on \
    || @opt.act[:maintenance][:set]==:on
      if SiSU_is.git_version_info?
        SiSU_Screen::Ansi.new(
          @opt.act[:color_state][:set],
          ' ' + File.dirname(__FILE__) + \
          '  vcr: ' + SiSU_is.git_version_info?
        ).grey
      else
        SiSU_Screen::Ansi.new(
          @opt.act[:color_state][:set],
          ' ' + File.dirname(__FILE__)
        ).grey
      end
    end
  end
  self
end

#run_termsheet?Boolean

broken, revisit later

Returns:

  • (Boolean)


856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
# File 'lib/sisu/hub_actions.rb', line 856

def run_termsheet? #broken, revisit later
  if @opt.selections.str =~/--termsheet/         #% -T termsheet/standard form #fix later
    if @opt.f_pths.length > 0
      @opt.files.each do |fns|
        if FileTest.file?(fns)
          @opt.fns=fns
          case @opt.fns
          when /\.(termsheet.rb)$/
            SiSU_Hub_Actions::Operations.new(@opt).termsheet
          else                                   #print "not processed --> ", fns, "\n"
          end
        else SiSU_Hub_Actions::Operations.new(@opt).not_found
        end
      end
    else
      msg='process termsheet request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
end

#search_form?Boolean

Returns:

  • (Boolean)


174
175
176
177
178
# File 'lib/sisu/hub_actions.rb', line 174

def search_form?
  if @opt.act[:sample_search_form][:set]==:on      #% --sample-search-form, -F cgi sample search form
    SiSU_Hub_Actions::Operations.new(@opt).cgi
  end
end

#share_source?Boolean

Returns:

  • (Boolean)


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
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
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
# File 'lib/sisu/hub_actions.rb', line 656

def share_source?
  if @opt.act[:sisupod][:set]==:on \
  or @opt.act[:share_source][:set]==:on \
  or @opt.act[:po4a_sstm][:set]==:on \
  or @opt.act[:git][:set]==:on
    begin
      if @opt.f_pths.length > 0
        require_relative 'src_shared'
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Source::SiSUpodSource.new(@opt).read
        end
      else
        msg='share markup source request requires sisu markup files'
        if (@opt.act[:verbose_plus][:set]==:on \
        || @opt.act[:maintenance][:set]==:on)
          SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
            mark(msg)
        else puts msg
        end
      end
      if @opt.act[:sisupod][:set]==:on           #% --sisupod, -S
        if @opt.f_pths.length > 0
          require_relative 'src_sisupod_make'    # src_sisupod_make.rb
          begin
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option_bundle do
              SiSU_Doc::Source.new(@opt).sisupod_tar_xz
            end
          ensure
          end
        else
          msg='sisupod (share markup source) request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if @opt.act[:git][:set]==:on               #% --git, -g
        if @opt.f_pths.length > 0
          require_relative 'git'                 # git.rb
          begin
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option do
              SiSU_Git::Source.new(@opt).read
            end
          ensure
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option_bundle do
              SiSU_Git::Source.new(@opt).git_commit
            end
          end
        else
          msg='git request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
      if (@opt.act[:sisupod][:set]==:on \
      || @opt.act[:share_source][:set]==:on \
      || @opt.act[:po4a_sstm][:set]==:on) \
      and @opt.act[:manifest][:set]==:on         #% --manifest, -y
        if @opt.f_pths.length > 0
          require_relative 'html_manifest'            # html_manifest.rb
          begin
          ensure
            SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
            loop_files_on_given_option_bundle do
              SiSU_Manifest::Source.new(@opt).read
            end
          end
        else
          msg='manifest request requires sisu markup files'
          if (@opt.act[:verbose_plus][:set]==:on \
          || @opt.act[:maintenance][:set]==:on)
            SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
              mark(msg)
          else puts msg
          end
        end
      end
    ensure
      if @opt.f_pths.length > 0
        env=SiSU_Env::InfoEnv.new(@opt.fns)
        path_pod=env.processing_path.processing_sisupod(@opt).paths
        unless @opt.act[:maintenance][:set]==:on
          FileUtils::rm_rf("#{path_pod[:sisupod]}/*") \
            if FileTest.directory?(path_pod[:sisupod])
        end
      else
        #SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
        #  mark('*** request requires sisu markup files')
      end
    end
  end
  if @opt.act[:share_source][:set]==:on
    if @opt.f_pths.length > 0
      require_relative 'src_sisupod_sstm'           # src_sisupod_sstm.rb
      begin
      ensure
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option_bundle do
          SiSU_Markup::Source_Sisupod.new(@opt).read
        end
      end
    else
      msg='share markup source request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:po4a_sstm][:set]==:on                    #% --po4a-sst
    if @opt.f_pths.length > 0
      require_relative 'src_po4a_sstm'
      begin
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Markup::Source_Po4a.new(@opt).read       # src_po4a_sstm.rb
        end
      ensure
      end
    else
      msg='sst request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:po4a_sst_ao_sst][:set]==:on               #% --po4a-ao
    if @opt.f_pths.length > 0
      require_relative 'src_po4a_sst_ao_sst'
      begin
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_SStm_AO_SStm::Source.new(@opt).read_setup # src_po4a_sst_ao_sst.rb
        end
      ensure
      end
    else
      msg='sst request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:po4a_shelf][:set]==:on            #% --po4a-shelf
    if @opt.f_pths.length > 0
      require_relative 'src_po4a_shelf'
      begin
        SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
        loop_files_on_given_option do
          SiSU_Po4a::Source.new(@opt).read       # src_po4a_shelf.rb
        end
      ensure
      end
    else
      msg='src_po4a_shelf request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:images][:set]==:on                #% --images, -j
    if @opt.f_pths.length > 0
      require_relative 'shared_images'
      SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
      loop_files_on_given_option do
        SiSU_Images::Source.new(@opt).read       # shared_images.rb
      end
    else
      msg='place images request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
end

#site?Boolean

Returns:

  • (Boolean)


114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/sisu/hub_actions.rb', line 114

def site?
  if @opt.act[:site_init][:set]==:on               #% --init-site, -C initialize/configure
    require_relative 'conf'                        #% --init-site, -C initialize/configure
    SiSU_Initialize::Source.new(@opt).read
    if @opt.act[:rsync][:set]==:on
      if @opt.selections.str =~/--init(?:ialize)?=site/ \
      and @opt.selections.str =~/RZ/
        SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync_match
      else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_rsync
      end
    elsif @opt.act[:scp][:set]==:on
      if @opt.selections.str =~/--init(?:ialize)?=site/ \
      and @opt.selections.str =~/CCr/
        SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site_all
      else SiSU_Hub_Actions::Operations.new(@opt).remote_put_base_site
      end
    end
  end
end

#sitemaps?Boolean

Returns:

  • (Boolean)


927
928
929
930
931
932
933
934
935
936
937
# File 'lib/sisu/hub_actions.rb', line 927

def sitemaps?
  if @opt.act[:sitemap][:set]==:on               #% --sitemap, -Y
    if @opt.f_pths.length > 0
      require_relative 'sitemaps'
      SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
      loop_files_on_given_option do
        SiSU_Sitemaps::Source.new(@opt).read     # sitemaps.rb
      end
    end
  end
end

#sql?Boolean

Returns:

  • (Boolean)


154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/sisu/hub_actions.rb', line 154

def sql?
  if @opt.act[:psql_createdb][:set]==:on \
  or @opt.act[:psql_create][:set]==:on \
  or @opt.act[:psql_drop][:set]==:on
    done=:ok
    if @opt.act[:psql][:set]==:on
      require_relative 'dbi'
      SiSU_DBI::SQL.new(@opt).connect
    end
  end
  if @opt.act[:sqlite_createdb][:set]==:on \
  or @opt.act[:sqlite_create][:set]==:on \
  or @opt.act[:sqlite_drop][:set]==:on
    done=:ok
    if @opt.act[:sqlite][:set]==:on
      require_relative 'dbi'
      SiSU_DBI::SQL.new(@opt).connect
    end
  end
end

#sqlite_discrete?Boolean

Returns:

  • (Boolean)


565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
# File 'lib/sisu/hub_actions.rb', line 565

def sqlite_discrete?
  if @opt.act[:sqlite_discrete][:set]==:on       #% --sqlite, -d
    if @opt.f_pths.length > 0
      require_relative 'dbi_discrete'            # dbi_discrete.rb
      SiSU_DBI_Discrete::SQL.new(@opt).build
    else
      msg='sqlite (discrete) request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#text?Boolean

Returns:

  • (Boolean)


242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
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
# File 'lib/sisu/hub_actions.rb', line 242

def text?
  if @opt.act[:txt][:set]==:on                   #% --txt, -t -a
    if @opt.f_pths.length > 0
      require_relative 'txt_plain'               #  txt_plain.rb
      SiSU_Txt_Plain::Source.new(@opt).read
    else
      msg='text request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:txt_textile][:set]==:on           #% --textile
    if @opt.f_pths.length > 0
      require_relative 'txt_textile'             #txt_textile.rb
      SiSU_Txt_Textile::Source.new(@opt).read
    else
      msg='textile request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:txt_asciidoc][:set]==:on          #% --asciidoc
    if @opt.f_pths.length > 0
      require_relative 'txt_asciidoc'            # txt_asciidoc.rb
      SiSU_Txt_AsciiDoc::Source.new(@opt).read
    else
      msg='asciidoc request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:txt_markdown][:set]==:on          #% --markdown
    if @opt.f_pths.length > 0
      require_relative 'txt_markdown'            # txt_markdown.rb
      SiSU_Txt_Markdown::Source.new(@opt).read
    else
      msg='markdown request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:txt_rst][:set]==:on               #% --rst, --rest
    if @opt.f_pths.length > 0
      require_relative 'txt_rst'                 # txt_rst.rb
      SiSU_Txt_rST::Source.new(@opt).read
    else
      msg='rst request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:txt_orgmode][:set]==:on          #% --orgmode
    if @opt.f_pths.length > 0
      require_relative 'txt_orgmode'            # txt_orgmode.rb
      SiSU_Txt_OrgMode::Source.new(@opt).read
    else
      msg='orgmode request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#urls?Boolean

Returns:

  • (Boolean)


961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/sisu/hub_actions.rb', line 961

def urls?
  if @opt.act[:urls_selected][:set]==:on         #% --urls
    if @opt.f_pths.length > 0
      require_relative 'urls'
      SiSU_Hub_Loops::OptionLoopFiles.new(@opt).
      loop_files_on_given_option do
        SiSU_Urls::Source.new(@opt).read         #% urls.rb
      end
    else
      msg='urls request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:cyan).
          mark(msg)
      else puts msg
      end
    end
  end
end

#version_dir?Boolean

Returns:

  • (Boolean)


81
82
83
84
85
86
87
88
89
90
91
# File 'lib/sisu/hub_actions.rb', line 81

def version_dir?
  if @opt.act[:version_info][:set]==:on \
  || @opt.act[:verbose][:set]==:on \
  || @opt.act[:verbose_plus][:set]==:on \
  || @opt.act[:maintenance][:set]==:on
    SiSU_Screen::Ansi.new(
      @opt.act[:color_state][:set],
      ' ' + File.dirname(__FILE__)
    ).grey
  end
end

#version_info?Boolean

Returns:

  • (Boolean)


65
66
67
68
69
# File 'lib/sisu/hub_actions.rb', line 65

def version_info?
  if @opt.act[:version_info][:set]==:on
    SiSU_Env::InfoAbout.new(@opt).sisu_version
  end
end

#version_info_extra?Boolean

Returns:

  • (Boolean)


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/sisu/hub_actions.rb', line 92

def version_info_extra?
  if @opt.act[:version_info][:set]==:on \
  || @opt.act[:verbose][:set]==:on \
  || @opt.act[:verbose_plus][:set]==:on \
  || @opt.act[:maintenance][:set]==:on
    if SiSU_is.git_version_info?
      SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        ' ' + File.dirname(__FILE__) + \
        '  vcr: ' + SiSU_is.git_version_info?
      ).grey
    else
      SiSU_Screen::Ansi.new(
        @opt.act[:color_state][:set],
        ' ' + File.dirname(__FILE__)
      ).grey
    end
  end
end

#version_number_git?Boolean

Returns:

  • (Boolean)


70
71
72
73
74
75
76
77
78
79
80
# File 'lib/sisu/hub_actions.rb', line 70

def version_number_git?
  if @opt.act[:version_info][:set]==:on \
  || @opt.act[:verbose][:set]==:on \
  || @opt.act[:verbose_plus][:set]==:on \
  || @opt.act[:maintenance][:set]==:on
    SiSU_Screen::Ansi.new(
      @opt.act[:color_state][:set],
      ' ' + SiSU_is.git_version_info?
    ).grey
  end
end

#webrick?Boolean

Returns:

  • (Boolean)


179
180
181
182
183
# File 'lib/sisu/hub_actions.rb', line 179

def webrick?
  if @opt.act[:webrick][:set]==:on                 #% --webrick, -W webrick
    SiSU_Hub_Actions::Operations.new(@opt).webrick
  end
end

#xhtml?Boolean

Returns:

  • (Boolean)


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
# File 'lib/sisu/hub_actions.rb', line 387

def xhtml?
  if @opt.act[:xhtml][:set]==:on                 #% --xhtml, -b
    if @opt.f_pths.length > 0
      require_relative 'xhtml'                   # xhtml.rb
      SiSU_XHTML::Source.new(@opt).read
    else
      msg='xhtml request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:epub][:set]==:on                  #% --epub, -e
    if @opt.f_pths.length > 0
      require_relative 'xhtml_epub2'             # xhtml_epub2.rb
      SiSU_XHTML_EPUB2::Source.new(@opt).read
    else
      msg='epub request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end

#xml?Boolean

Returns:

  • (Boolean)


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
446
447
448
449
450
451
452
453
454
455
456
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
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
# File 'lib/sisu/hub_actions.rb', line 417

def xml?
  if @opt.act[:odt][:set]==:on                   #% --odt, -o
    if @opt.f_pths.length > 0
      require_relative 'xml_odf_odt'             # xml_odf_odt.rb
      SiSU_XML_ODF_ODT::Source.new(@opt).read
    else
      msg='odt request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:xml_scaffold_structure_sisu][:set]==:on #% --xml-scaffold --xml-scaffold-sisu
    if @opt.f_pths.length > 0
      require_relative 'xml_scaffold_structure_sisu'   #  xml_scaffold_structure_sisu.rb
      SiSU_XML_Scaffold_Structure_Sisu::Source.new(@opt).read
    else
      msg='xml scaffold request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:xml_scaffold_structure_collapse][:set]==:on #% --xml-scaffold-collapse
    if @opt.f_pths.length > 0
      require_relative 'xml_scaffold_structure_collapsed'  # xml_scaffold_structure_collapsed.rb
      SiSU_XML_Scaffold_Structure_Collapse::Source.new(@opt).read
    else
      msg='xml scaffold request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:xml_docbook_book][:set]==:on      #% --xml-docbook
    if @opt.f_pths.length > 0
      require_relative 'xml_docbook5'            # xml_docbook5.rb
      SiSU_XML_Docbook_Book::Source.new(@opt).read
    else
      msg='docbook request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:xml_fictionbook][:set]==:on       #% --xml-fictionbook
    if @opt.f_pths.length > 0
      require_relative 'xml_fictionbook2'        # xml_fictionbook2.rb
      SiSU_XML_Fictionbook::Source.new(@opt).read
    else
      msg='fictionbook request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:xml_sax][:set]==:on               #% --xml-sax, -x
    if @opt.f_pths.length > 0
      require_relative 'xml_sax'                 # xml_sax.rb
      SiSU_XML_SAX::Source.new(@opt).read
    else
      msg='xml sax request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
  if @opt.act[:xml_dom][:set]==:on               #% --xml-dom, -X
    if @opt.f_pths.length > 0
      require_relative 'xml_dom'                 # xml_dom.rb
      SiSU_XML_DOM::Source.new(@opt).read
    else
      msg='xml dom request requires sisu markup files'
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:yellow).
          mark(msg)
      else puts msg
      end
    end
  end
end