Class: SiSU_QRcode::Source
- Inherits:
-
Object
- Object
- SiSU_QRcode::Source
- Defined in:
- lib/sisu/qrcode.rb
Direct Known Subclasses
Defined Under Namespace
Classes: OutputInfo
Instance Method Summary collapse
-
#initialize(opt) ⇒ Source
constructor
A new instance of Source.
- #read ⇒ Object
Constructor Details
#initialize(opt) ⇒ Source
Returns a new instance of Source.
69 70 71 72 73 74 |
# File 'lib/sisu/qrcode.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
#read ⇒ Object
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 |
# File 'lib/sisu/qrcode.rb', line 75 def read begin @env=SiSU_Env::InfoEnv.new(@opt.fns,@opt) @md=SiSU_Param::Parameters.new(@opt).get xbrowser=@env.program.web_browser browser=@env.program.console_web_browser 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], 'QR code', "#{xbrowser} #{url_html}" ).green_hi_blue : SiSU_Screen::Ansi.new( @opt.act[:color_state][:set], 'QR code', "[#{@opt.f_pth[:lng_is]}] #{@opt.fns}" ).green_title_hi if (@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], "#{browser} #{url_html}" ).grey_tab end end data=SiSU_HTML::Source::HTML_Environment.new(@particulars).tuned_file_instructions OutputInfo.new(@md).check_output(data) rescue SiSU_Errors::Rescued.new($!,$@,@opt.selections.str,@opt.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure end end |