... | ... |
@@ -12,15 +12,15 @@ module Rubysermon |
12 | 12 |
MOD_PATH = "#{LIB_PATH}/rubysermon/mod" |
13 | 13 |
|
14 | 14 |
class App |
15 |
- attr_accessor :config_path, :db_path |
|
16 |
- |
|
17 | 15 |
def initialize |
18 |
- @config = {repeat: 60} |
|
16 |
+ @config = { repeat: 60, |
|
17 |
+ config_path: "#{LIB_PATH}/rubysermon/config.json", |
|
18 |
+ db_path: "/tmp/rubysermon_history.db" |
|
19 |
+ } |
|
20 |
+ |
|
19 | 21 |
@running_mods = [] |
20 |
- @config_path = "#{LIB_PATH}/rubysermon/config.json" |
|
21 | 22 |
@enabled_mods = [] |
22 | 23 |
@db = nil |
23 |
- @db_path = "/tmp/rubysermon_history.db" |
|
24 | 24 |
end |
25 | 25 |
|
26 | 26 |
def run |
... | ... |
@@ -38,7 +38,7 @@ module Rubysermon |
38 | 38 |
private |
39 | 39 |
|
40 | 40 |
def read_config |
41 |
- configurator = Configurator.new(@config_path) |
|
41 |
+ configurator = Configurator.new(@config[:config_path]) |
|
42 | 42 |
config = configurator.get_settings() |
43 | 43 |
@config.merge!(config) |
44 | 44 |
end |
... | ... |
@@ -68,7 +68,7 @@ module Rubysermon |
68 | 68 |
end |
69 | 69 |
|
70 | 70 |
def start_db |
71 |
- @db = DB.new(@db_path) |
|
71 |
+ @db = DB.new(@config[:db_path]) |
|
72 | 72 |
end |
73 | 73 |
|
74 | 74 |
def start_fetch_process_sleep_cycle |