lib/octoshark.rb in octoshark-0.0.2 vs lib/octoshark.rb in octoshark-0.0.3

- old
+ new

@@ -15,17 +15,17 @@ delegate :current_connection, :with_connection, :connection, :current_or_default_connection, :connection_pools, :find_connection_pool, :disconnect!, to: :switcher - def setup(configs) + def configure(configs) @configs = configs @switcher = ConnectionSwitcher.new(configs) end def reset! - return unless enabled? + return unless configured? disconnect! @confings = nil @switcher = nil Thread.current[OCTOSHARK] = nil end @@ -34,19 +34,19 @@ raise_not_configured_error unless @configs disconnect! @switcher = ConnectionSwitcher.new(@configs) end - def enabled? + def configured? !@switcher.nil? end def switcher @switcher || raise_not_configured_error end private def raise_not_configured_error - raise NotConfiguredError, "Octoshark is not setup" + raise NotConfiguredError, "Octoshark is not configured, use Octoshark.configure" end end end