Class: SiSU_Manifest::Source

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

Direct Known Subclasses

Output

Defined Under Namespace

Classes: Output

Instance Method Summary collapse

Constructor Details

#initialize(opt) ⇒ Source

Returns a new instance of Source.



69
70
71
72
73
74
# File 'lib/sisu/html_manifest.rb', line 69

def initialize(opt)
  @opt=opt
  @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt)
  l=SiSU_Env::StandardiseLanguage.new(opt.lng).language
  @doc_language=l[:n]
end

Instance Method Details

#readObject



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
113
114
115
116
117
118
# File 'lib/sisu/html_manifest.rb', line 75

def read
  begin
    @env=SiSU_Env::InfoEnv.new(@opt.fns)
    @md=SiSU_Param::Parameters.new(@opt).get
    xbrowser=@env.program.web_browser
    browser=@env.program.console_web_browser
#       [email protected]_tell #fix in sysenv
    unless @opt.act[:quiet][:set]==:on
      url_html='file://' \
      + @md.file.output_path.manifest.dir + '/' \
      + @md.file.base_filename.manifest
      (@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],
          'Manifest',
          "#{xbrowser} #{url_html}"
        ).green_hi_blue
      : SiSU_Screen::Ansi.new(
          @opt.act[:color_state][:set],
          'Manifest',
          "[#{@opt.f_pth[:lng_is]}]",
          "#{url_html}"
        ).grey_title_grey_blue
      if (@md.opt.act[:verbose][:set]==:on \
      || @md.opt.act[:verbose_plus][:set]==:on)
        SiSU_Screen::Ansi.new(
          @opt.act[:color_state][:set],
          "#{browser} #{url_html}"
        ).grey_tab
      end
    end
    data=SiSU_HTML::Source::HTML_Environment.new(@particulars).tuned_file_instructions
    SiSU_Manifest::Source::Output.new(@md).check_output(data)
  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