lib/modules/input/style/console.rb in aio_elin-1.0.2 vs lib/modules/input/style/console.rb in aio_elin-1.0.3
- old
+ new
@@ -134,12 +134,12 @@
class ContextState < State
def parse_line(line)
# 如果这行是命令行格式,那么就代表上一个cmd内容结束
- tmp_reg = ::Regexp.new "^[\\[|<]?#{cmd_context.device_name}(#|>|\\])"
-
+ #tmp_reg = ::Regexp.new "^[\\[|<]{0,1}#{cmd_context.device_name}[#|>|\\]]{1}"
+ tmp_reg = ::Regexp.new "^[\\[|<]?#{cmd_context.device_name}[#|>|\\]]{1}"
# 可能会出现UTF-8识别不出摄氏度符号的问题
# 已经通过安全字符解决
begin
if tmp_reg.match(line)
cmd_context.done
@@ -195,9 +195,10 @@
def parse_file(file)
fo = File.open(file, "r+", :encoding => "utf-8")
fo.each_line do |line|
begin
+ debugger if line =~ /more off/
line = Aio::Base::Toolkit::String.safe(line)
line = line.strip
rescue => e
print_error line + " : " + e.message
end