Sha256: 675e4aace3f41941b5e8ad534294a1cfeef82482dd3a5ea5ef2942d5b9907050

Contents?: true

Size: 630 Bytes

Versions: 15

Compression:

Stored size: 630 Bytes

Contents

require 'omnes'

module Spree
  # Global [Omnes](https://github.com/nebulab/omnes) bus.
  #
  # This is used for internal events, while host applications are also able to
  # use it.
  #
  # It has some modifications to support internal usage of the legacy event
  # system {see Spree::AppConfiguration#use_legacy_events}.
  Bus = Omnes::Bus.new
  def Bus.publish(event, **kwargs)
    if Spree::Config.use_legacy_events
      Spree::Event.fire(event, **kwargs)
    else
      # Override caller_location to point to the actual event publisher
      super(event, **kwargs, caller_location: caller_locations(1)[0])
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solidus_core-3.4.6 lib/spree/bus.rb
solidus_core-3.4.5 lib/spree/bus.rb
solidus_core-3.4.4 lib/spree/bus.rb
solidus_core-3.3.4 lib/spree/bus.rb
solidus_core-3.2.9 lib/spree/bus.rb
solidus_core-3.2.8 lib/spree/bus.rb
solidus_core-3.3.3 lib/spree/bus.rb
solidus_core-3.4.3 lib/spree/bus.rb
solidus_core-3.4.2 lib/spree/bus.rb
solidus_core-3.2.7 lib/spree/bus.rb
solidus_core-3.3.2 lib/spree/bus.rb
solidus_core-3.4.1 lib/spree/bus.rb
solidus_core-3.4.0 lib/spree/bus.rb
solidus_core-3.3.1 lib/spree/bus.rb
solidus_core-3.2.6 lib/spree/bus.rb