diff --git a/astute/lib/astute/config.rb b/astute/lib/astute/config.rb index 9509203d7..4b80863bb 100644 --- a/astute/lib/astute/config.rb +++ b/astute/lib/astute/config.rb @@ -1,10 +1,6 @@ require 'symboltable' require 'singleton' -class SymbolTable - include Singleton -end - module Astute class ConfigError < StandardError; end class UnknownOptionError < ConfigError @@ -16,6 +12,15 @@ module Astute end end + class MyConfig + include Singleton + attr_reader :configtable + + def initialize + @configtable = SymbolTable.new + end + end + class ParseError < ConfigError attr_reader :line @@ -26,7 +31,7 @@ module Astute end def self.config - config = SymbolTable.instance + config = MyConfig.instance.configtable config.update(default_config) if config.empty? return config end diff --git a/naily/lib/naily/config.rb b/naily/lib/naily/config.rb index 0f379d3b5..f954873f6 100644 --- a/naily/lib/naily/config.rb +++ b/naily/lib/naily/config.rb @@ -1,10 +1,6 @@ require 'symboltable' require 'singleton' -class SymbolTable - include Singleton -end - module Naily class ConfigError < StandardError; end class UnknownOptionError < ConfigError @@ -16,6 +12,17 @@ module Naily end end + class MyConfig + include Singleton + attr_reader :configtable + + def initialize + # We need new instance of SymbolTable. If we use singleton for SymbolTable, + # the same instance will be used in Astute. + @configtable = SymbolTable.new + end + end + class ParseError < ConfigError attr_reader :line @@ -26,7 +33,7 @@ module Naily end def self.config - config = SymbolTable.instance + config = MyConfig.instance.configtable config.update(default_config) if config.empty? return config end