Class: TuyaCIDSL::Analyzer
- Inherits:
-
Object
- Object
- TuyaCIDSL::Analyzer
- Defined in:
- lib/tuya/ci/DSL/analyzer/file_parse.rb
Instance Method Summary collapse
-
#initialize(file = './CIFile') ⇒ Analyzer
constructor
A new instance of Analyzer.
- #p_monitor ⇒ Object
Constructor Details
#initialize(file = './CIFile') ⇒ Analyzer
Returns a new instance of Analyzer.
3 4 5 6 7 8 9 |
# File 'lib/tuya/ci/DSL/analyzer/file_parse.rb', line 3 def initialize(file='./CIFile') @file = file puts "Can not find: #{@file}".red unless File.exist? @file file_content = File.read @file file_content.gsub! /^\s*(#|\/\/).*$/,'' @content = file_content end |
Instance Method Details
#p_monitor ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/tuya/ci/DSL/analyzer/file_parse.rb', line 11 def p_monitor monitor_content = @content monitor = TuyaCIMonitor.new monitor.name = @file monitor.ci do begin eval monitor_content rescue Exception => e puts "Load trigger failed: #{e}".red ensure end end monitor end |