Class: SiSU_XML_DOM::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/sisu/xml_dom.rb

Defined Under Namespace

Classes: Output, Scroll, Songsheet, Tidy

Instance Method Summary collapse

Constructor Details

#initialize(opt) ⇒ Source

Returns a new instance of Source.



72
73
74
75
# File 'lib/sisu/xml_dom.rb', line 72

def initialize(opt)
  @opt=opt
  @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt)
end

Instance Method Details

#readObject



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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/sisu/xml_dom.rb', line 76

def read
  begin
    @env,              @md,            @ao_arr=
      @particulars.env,@particulars.md,@particulars.ao_array
    unless @opt.act[:quiet][:set]==:on
      tool=if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        @env.program.web_browser \
        + ' file://' \
        + @md.file.output_path.xml_dom.dir + '/' \
        + @md.file.base_filename.xml_dom + "\n\t" \
        + @env.program.xml_viewer \
        + ' file://' \
        + @md.file.output_path.xml_dom.dir + '/' \
        + @md.file.base_filename.xml_dom
      elsif @opt.act[:verbose][:set]==:on
        @env.program.web_browser \
        + ' file://' \
        + @md.file.output_path.xml_dom.dir + '/' \
        + @md.file.base_filename.xml_dom
      else "[#{@opt.f_pth[:lng_is]}] #{@opt.fno}"
      end
      (@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],
          'XML DOM',
          tool
        ).green_hi_blue
      : SiSU_Screen::Ansi.new(
          @opt.act[:color_state][:set],
          'XML DOM',
          tool
        ).green_title_hi
      if (@opt.act[:verbose_plus][:set]==:on \
      || @opt.act[:maintenance][:set]==:on)
        SiSU_Screen::Ansi.new(
          @opt.act[:color_state][:set],
          @opt.fns,
          'file://' \
          + @md.file.output_path.xml_dom.dir + '/' \
          + @md.file.base_filename.xml_dom
        ).flow
      end
    end
    SiSU_XML_DOM::Source::Songsheet.new(@particulars).songsheet
  rescue
    SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do
      __LINE__.to_s + ':' + __FILE__
    end
  ensure
    SiSU_Env::CreateSite.new(@opt).cp_css
    Dir.chdir(@opt.f_pth[:pth])
  end
end