# File lib/thinking_sphinx/subscribers/populator_subscriber.rb, line 2 def self.attach_to(namespace) subscriber = new subscriber.public_methods(false).each do |event| next if event == :call ActiveSupport::Notifications.subscribe( "#{event}.#{namespace}", subscriber ) end end
# File lib/thinking_sphinx/subscribers/populator_subscriber.rb, line 14 def call(message, *args) send message.split('.').first, ActiveSupport::Notifications::Event.new(message, *args) end
# File lib/thinking_sphinx/subscribers/populator_subscriber.rb, line 27 def finish_populating(event) print "\n" end
# File lib/thinking_sphinx/subscribers/populator_subscriber.rb, line 23 def populated(event) print '.' end
# File lib/thinking_sphinx/subscribers/populator_subscriber.rb, line 19 def start_populating(event) puts "Generating index files for #{event.payload[:index].name}" end