krisleech/wisper-activerecord

Missing requires?

Closed this issue · 5 comments

Wisper::ActiveRecord::Publisher throws me uninitialized constant Wisper::Publisher when I follow the README instructions:

~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/wisper-activerecord-0.2.0/lib/wisper/active_record/publisher.rb:7:
in `block in <module:Publisher>': uninitialized constant Wisper::Publisher (NameError)

When I hack my gem to add a require "wisper/publisher" to lib/wisper/active_record/publisher.rb it then can't find Wisper::Publisher::GlobalListeners and Wisper::Publisher::BlockRegistration.

As a workaround I added an initializer with require "wisper" and the errors went away.

Suggestion as to best way to tackle this? I'm happy to do the needed PR to either project.

In theory because gemspec has wisper as a dependency it should get required by bundler.

Actually bundler/rubygems only adds to the loadpath.
I think we need require 'wisper' at the top of lib/wisper/active_record/publisher.rb

same problem here.

Fancy sending a pull request?

fixed