소스 검색

add config

Dorian Snowball 2 년 전
부모
커밋
30188124b7
2개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      config.store
  2. 10 0
      lib/tron.rb

+ 5 - 0
config.store

@@ -0,0 +1,5 @@
+---
+name: <name>
+password: <password>
+host: <host>
+port: <port>

+ 10 - 0
lib/tron.rb

@@ -1,4 +1,14 @@
 require 'socket'
+require 'yaml/store'
+
+config = YAML::Store.new "config.store"
+config.transaction do
+  $name =  config["name"]
+  $password = config["password"]
+  $host = config["host"]
+  $port = config["port"]
+end
+
 
 def connect(host,port)