Sha256: f43b7520ef9e9ef834e0ffed33bf33988e6ff88a897ead1b2857b00fcf6f1e5e

Contents?: true

Size: 973 Bytes

Versions: 14

Compression:

Stored size: 973 Bytes

Contents

# -*- coding: utf-8 -*-
class AppMainBase
  def initialize
    @config = nil
    @aboet = false
    @exec = false
    @suspend = false
    @ws = nil
  end

  def app_send(str)
    if @ws != nil
      @ws.send(str)
    end
  end

  def set_ws(ws)
    @ws = ws
  end

  def set_config(config)
    @config = config
  end

  def start(argv)
    @exec = true
  end

  def stop()
    @abort = true
    @exec = false
  end

  def suspend()
    @suspend = true
  end

  def resume()
    @suspend = false
  end

  # 履歴の保存
  def add_history(file, history_data, max = 10)
    begin
      buf = File.read "#{$home_dir}history/#{file}"
    rescue
      buf = ""
    end
    data = eval(buf)
    if data == nil
      data = []
    end
    if history_data.to_s != ""
      data.prepend history_data
    end
    data = data.uniq[0..max - 1]
    File.open("#{$home_dir}history/#{file}", "w") do |f|
      f.write JSON.pretty_generate data
    end
  end
end

require "app_load.rb"

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
browser_app_base-0.1.8 lib/template/server_app_base.rb
python_uml_class-0.1.0 lib/server_app_base.rb
ruby_uml_class-0.5.0 lib/server_app_base.rb
ruby_uml_class-0.4.0 lib/server_app_base.rb
ruby_uml_class-0.3.0 lib/server_app_base.rb
ruby_uml_class-0.2.0 lib/server_app_base.rb
ruby_uml_class-0.1.0 lib/server_app_base.rb
browser_app_base-0.1.7 lib/template/server_app_base.rb
browser_app_base-0.1.6 lib/template/server_app_base.rb
browser_app_base-0.1.5 lib/template/server_app_base.rb
browser_app_base-0.1.4 lib/template/server_app_base.rb
browser_app_base-0.1.3 lib/template/server_app_base.rb
browser_app_base-0.1.2 lib/template/server_app_base.rb
browser_app_base-0.1.1 lib/template/server_app_base.rb