Top Level Namespace
Defined Under Namespace
Modules: JsChat, JsClient, Ncurses, Sinatra
Constant Summary collapse
- ClientConfig =
{ :port => ['port'] || '6789', :ip => ['hostname'] || '0.0.0.0', :name => ['nick'] || ENV['LOGNAME'], :auto_join => ['room'] || '#jschat' }
- ServerConfigDefaults =
{ 'port' => 6789, 'ip' => '0.0.0.0', 'logger' => logger, 'max_message_length' => 500, 'tmp_files' => File.join(Dir::tmpdir, 'jschat'), 'db_name' => 'jschat', 'db_host' => 'localhost', 'db_port' => 27017, #'db_username' => '', #'db_password' => '', # Register your instance of JsChat here: http://twitter.com/apps/create # 'twitter' => { 'key' => '', 'secret' => '' } }
- ServerConfig =
ServerConfigDefaults.merge
Instance Method Summary collapse
-
#load_options(path) ⇒ Object
Command line options will overrides these.
- #make_tmp_files ⇒ Object
Instance Method Details
#load_options(path) ⇒ Object
Command line options will overrides these
28 29 30 31 32 33 34 35 |
# File 'lib/jschat/client.rb', line 28 def (path) path = File. path if File.exists? path JSON.parse(File.read path) else {} end end |
#make_tmp_files ⇒ Object
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/jschat/server_options.rb', line 36 def make_tmp_files ServerConfig['use_tmp_files'] = false if File.exists? ServerConfig['tmp_files'] ServerConfig['use_tmp_files'] = true else if Dir.mkdir ServerConfig['tmp_files'] ServerConfig['use_tmp_files'] = true end end end |