Skip to content

Commit 57cedf5

Browse files
sato11jeremy
authored andcommitted
Define a missing method #root for the development configurator
This fixes an unexpected NoMethodError that experimenting through `bin/console` causes: ``` irb(main):001> Kredis.string "mystring" /rails/kredis/lib/kredis/connections.rb:15:in `block in configured_for': undefined method `root' for an instance of #<Class:0x0000000108091a60> (NoMethodError) if configurator.root.join("config/redis/#{name}.yml").exist? ^^^^^ ``` This is a follow-up to #135.
1 parent 14c7575 commit 57cedf5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bin/console

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ end
1414

1515
require "debug"
1616

17-
Kredis.configurator = Class.new { def config_for(name) { db: "2" } end }.new
17+
Kredis.configurator = Class.new do
18+
def config_for(name) { db: "2" } end
19+
def root() Pathname.new(".") end
20+
end.new
1821
ActiveSupport::LogSubscriber.logger = ActiveSupport::Logger.new(STDOUT)
1922

2023
IRB.start

0 commit comments

Comments
 (0)