Method: MyApp#start

Defined in:
lib/my_app_sample.rb

#start(argv) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/my_app_sample.rb', line 5

def start(argv)
  super
  begin
    @abort = false
    puts argv
    argv.each do |v|
      yield v if block_given?
    end

    # Browserにメッセージ送信
    app_send("popup:start app #{argv[0]}")

    # 履歴の保存
    add_history("history.json", argv[0])

    while true
      yield Time.now.to_s if block_given?
      puts Time.now.to_s
      yield @config["name1"]
      sleep 1
      break if @abort
    end
  rescue
    puts $!
    puts $@
  end
end